-
Notifications
You must be signed in to change notification settings - Fork 556
WebMock API
Olia Kremmyda edited this page Feb 23, 2018
·
3 revisions
stub_http_request(method, uri)
stub_request(method, uri)
More details can be found in README file
a_request(method, uri)
request(method, uri)
assert_requested(method_and_options, block)
assert_not_requested(method_and_options, block)
refute_requested(method_and_options, block)
hash_including(args)
hash_excluding(args)
Similar to RSpec::Mocks::ArgumentMatchers#hash_including()
Matches a hash that includes the specified key(s) or key/value pairs.
Ignores any additional keys.
Example:
object.should_receive(:message).with(hash_including(:key => val))
object.should_receive(:message).with(hash_including(:key))
object.should_receive(:message).with(hash_including(:key, :key2 => val2))
remove_request_stub(stub)