rspec/rspec-core — pull request #560 by exviva (2012-01-21 22:02:46+00:00)
Title: Add "calling_it" method to the ExampleGroup DSL

Treats the subject as a proc, to allow expressing expectations
on consequences of calling the subject, not only its properties.

The following examples are equivalent:

```ruby
describe BankTransfer, "::perform" do
let(:bank_account) { BankAccount.new(100) }
subject { BankTransfer.perform(bank_account, 30) }

it "should change bank account deposit" do
expect { subject }.to change { bank_account.deposit }.by(30)
# or: proc { subject }.should change { bank_account.deposit }.by(30)
end
end

describe BankTransfer, "::perform" do
let(:bank_account) { BankAccount.new(100) }
subject { BankTransfer.perform(bank_account, 30) }
calling_it { should change { bank_account.deposit }.by(30) }
end
```

I'm not 100% happy with the name, but maybe the community would have better suggestions?

Also, I'd gladly add more documentation if the idea gets accepted (just need some hints where exactly to add it).