Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

add a small example to README #190

Merged
merged 1 commit into from

2 participants

@goblin

It may be obvious, but took me a while to figure out

@goblin goblin add a small example to README
It may be obvious, but took me a while to figure out
56102c1
@myronmarston myronmarston merged commit a337af7 into from
@myronmarston
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 8, 2012
  1. @goblin

    add a small example to README

    goblin authored
    It may be obvious, but took me a while to figure out
This page is out of date. Refresh to see the latest.
Showing with 13 additions and 0 deletions.
  1. +13 −0 README.md
View
13 README.md
@@ -233,6 +233,19 @@ double.should_receive(:msg) do |arg|
end
```
+If the method being stubbed itself takes a block, and you need to yield to it
+in some special way, you can use this:
+
+```ruby
+double.should_receive(:msg) do |&arg|
+ begin
+ arg.call
+ ensure
+ # cleanup
+ end
+end
+```
+
## Combining Expectation Details
Combining the message name with specific arguments, receive counts and responses
Something went wrong with that request. Please try again.