siuying/motion-stump — pull request #3 by colinta (2013-03-14 17:58:59+00:00)
Title: I think this is better for testing

Runs the defined method as a block (e.g. closes over local testing variables) instead of in the context of the receiver.

```ruby
describe "Login form" do
tests LoginController
# ...

it 'should submit with good data' do
login_button = @controller.loginButton
# ... assign all valid data to the form ...
@submitted = false
@controller.stub!(:submit) do |email, password|
@submitted = true
end
tap login_button
@submitted.should == true
end
end
```