do not allow the request methods to be called without URIs (closes #29)

This commit is contained in:
HoneyryderChuck 2018-08-29 11:32:01 +01:00
parent bb89d1230e
commit c79987f76c

View File

@ -69,7 +69,7 @@ module HTTPX
end
def __build_reqs(*args, **options)
case args.size
requests = case args.size
when 1
reqs = args.first
reqs.map do |verb, uri|
@ -87,6 +87,8 @@ module HTTPX
else
raise ArgumentError, "unsupported number of arguments"
end
raise ArgumentError, "wrong number of URIs (given 0, expect 1..+1)" if requests.empty?
requests
end
def __send_reqs(*requests, **options)