Skip to content

Instantly share code, notes, and snippets.

@lulalala
Created April 16, 2015 07:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lulalala/4c15fd799f2b4ffdba77 to your computer and use it in GitHub Desktop.
Save lulalala/4c15fd799f2b4ffdba77 to your computer and use it in GitHub Desktop.
it do
expect{
@return_result = foo()
}.to change(Foo, :count).from(1).to(0)
expect(@return_result).to eq(true)
end
@myronmarston
Copy link

That works, or this:

it do
  expect{
    expect(foo).to eq(true)
  }.to change(Foo, :count).from(1).to(0)
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment