test/shared_test.rb in webmock-2.0.3 vs test/shared_test.rb in webmock-2.1.0
- old
+ new
@@ -28,17 +28,17 @@
end
end
def test_verification_that_expected_request_occured
http_request(:get, "http://www.example.com/")
- assert_requested(:get, "http://www.example.com", :times => 1)
+ assert_requested(:get, "http://www.example.com", times: 1)
assert_requested(:get, "http://www.example.com")
end
def test_verification_that_expected_stub_occured
http_request(:get, "http://www.example.com/")
- assert_requested(@stub_http, :times => 1)
+ assert_requested(@stub_http, times: 1)
assert_requested(@stub_http)
end
def test_verification_that_expected_request_didnt_occur
expected_message = "The request GET http://www.example.com/ was expected to execute 1 time but it executed 0 times"
@@ -56,19 +56,19 @@
end
end
def test_verification_that_expected_request_occured_with_body_and_headers
http_request(:get, "http://www.example.com/",
- :body => "abc", :headers => {'A' => 'a'})
+ body: "abc", headers: {'A' => 'a'})
assert_requested(:get, "http://www.example.com",
- :body => "abc", :headers => {'A' => 'a'})
+ body: "abc", headers: {'A' => 'a'})
end
def test_verification_that_expected_request_occured_with_query_params
- stub_request(:any, "http://www.example.com").with(:query => hash_including({"a" => ["b", "c"]}))
+ stub_request(:any, "http://www.example.com").with(query: hash_including({"a" => ["b", "c"]}))
http_request(:get, "http://www.example.com/?a[]=b&a[]=c&x=1")
assert_requested(:get, "http://www.example.com",
- :query => hash_including({"a" => ["b", "c"]}))
+ query: hash_including({"a" => ["b", "c"]}))
end
def test_verification_that_non_expected_request_didnt_occur
expected_message = %r(The request GET http://www.example.com/ was not expected to execute but it executed 1 time\n\nThe following requests were made:\n\nGET http://www.example.com/ with headers .+ was made 1 time\n\n============================================================)
assert_fail(expected_message) do