fixes on existing plugin option checks

This commit is contained in:
HoneyryderChuck 2022-07-05 23:00:30 +01:00
parent daf9fcee1d
commit 7819079b71
3 changed files with 3 additions and 3 deletions

View File

@ -267,7 +267,7 @@ module HTTPX
instance_variables.each do |ivar|
value = other.instance_variable_get(ivar)
value = case value
when Symbol, Fixnum, TrueClass, FalseClass # rubocop:disable Lint/UnifiedInteger
when Symbol, Numeric, TrueClass, FalseClass
value
else
value.dup

View File

@ -22,7 +22,7 @@ module HTTPX
module OptionsMethods
def option_expect_timeout(value)
seconds = Integer(value)
seconds = Float(value)
raise TypeError, ":expect_timeout must be positive" unless seconds.positive?
seconds

View File

@ -67,7 +67,7 @@ module HTTPX
end
def option_retry_on(value)
raise ":retry_on must be called with the response" unless value.respond_to?(:call)
raise TypeError, ":retry_on must be called with the response" unless value.respond_to?(:call)
value
end