Skip to content

Commit

Permalink
Added info to README to ensure have_requested matcher is invoked wi…
Browse files Browse the repository at this point in the history
…th a block declared with curly brackets, to ensure correct binding precedence.
  • Loading branch information
bblimke committed Nov 5, 2014
1 parent 0e20ee5 commit d7da183
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -546,6 +546,8 @@ WebMock.should have_requested(:get, "www.example.com").
WebMock.should_not have_requested(:get, "www.something.com")

WebMock.should have_requested(:post, "www.example.com").with { |req| req.body == "abc" }
# Note that the block with `do ... end` instead of curly brackets won't work!
# Why? See this comment https://github.com/bblimke/webmock/issues/174#issuecomment-34908908

WebMock.should have_requested(:get, "www.example.com").with(:query => {"a" => ["b", "c"]})

Expand Down

0 comments on commit d7da183

Please sign in to comment.