RSpec expect change:
it \"should increment the count\" do
expect{Foo.bar}.to change{Counter.count}.by 1
end
Is there a way to expect chan
If you don't want to use the shorthand/context based approach suggested earlier, you can also do something like this but be warned it will run the expectation twice so it might not be appropriate for all tests.
it "should increment the count" do
expectation = expect { Foo.bar }
expectation.to change { Counter.count }.by 1
expectation.to change { AnotherCounter.count }.by 1
end