lib/webmock/webmock.rb in webmock-0.8.2 vs lib/webmock/webmock.rb in webmock-0.9.0

- old
+ new

@@ -9,18 +9,18 @@ def request(method, uri) RequestProfile.new(method, uri) end - def assert_requested(method, uri, options = {}) + def assert_requested(method, uri, options = {}, &block) expected_times_executed = options.delete(:times) || 1 - request = RequestProfile.new(method, uri, options) + request = RequestProfile.new(method, uri, options).with(&block) verifier = RequestExecutionVerifier.new(request, expected_times_executed) assertion_failure(verifier.failure_message) unless verifier.matches? end - def assert_not_requested(method, uri, options = {}) - request = RequestProfile.new(method, uri, options) + def assert_not_requested(method, uri, options = {}, &block) + request = RequestProfile.new(method, uri, options).with(&block) verifier = RequestExecutionVerifier.new(request, options.delete(:times)) assertion_failure(verifier.negative_failure_message) unless verifier.does_not_match? end def allow_net_connect!