Skip to content

Commit 3d8e960

Browse files
committed
separate test for http_options attribute
1 parent 453fa1a commit 3d8e960

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/test_ruby_http_client.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ def setup
3333
@version = 'v3'
3434
@http_options = {open_timeout: 60, read_timeout: 60}
3535
@client = MockRequest.new(host: @host,
36+
request_headers: @headers,
37+
version: @version)
38+
@client_with_options = MockRequest.new(host: @host,
3639
request_headers: @headers,
3740
version: @version,
3841
http_options: @http_options)
@@ -173,4 +176,11 @@ def test_method_missing
173176
assert_equal({'message' => 'success'}, response.body)
174177
assert_equal({'headers' => 'test'}, response.headers)
175178
end
179+
180+
def test_http_options
181+
url1 = @client_with_options._('test')
182+
assert_equal(@host, @client_with_options.host)
183+
assert_equal(@headers, @client_with_options.request_headers)
184+
assert_equal(['test'], url1.url_path)
185+
end
176186
end

0 commit comments

Comments
 (0)