Skip to content

Instantly share code, notes, and snippets.

@sbellware
Created December 5, 2010 03:39
Show Gist options
  • Select an option

  • Save sbellware/728743 to your computer and use it in GitHub Desktop.

Select an option

Save sbellware/728743 to your computer and use it in GitHub Desktop.
Implicit Expectations Work Differently
# See the spec report at: http://screencast.com/t/lzXadGVp
# sample class to mock and test against
class Thing
def foo
bar
end
def bar
end
end
describe Thing do
after do
subject.foo
end
# this one works
it { subject.should_receive :bar }
# this one doesn't
it { should_receive :bar }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment