Skip to content

Instantly share code, notes, and snippets.

@bil-bas
Forked from arwagner/gist:5289895
Last active December 15, 2015 21:29
Show Gist options
  • Save bil-bas/5326055 to your computer and use it in GitHub Desktop.
Save bil-bas/5326055 to your computer and use it in GitHub Desktop.
def foo1 obj
obj.bar(1)
obj.bar(2)
end
def foo2 obj
obj.bar(2)
end
describe "foo1" do
it "calls bar on obj" do
obj = mock
obj.should_receive(:bar).with(2)
obj.should_receive(:bar).with(anything()).any_number_of_times
foo1 obj
end
end
describe "foo2" do
it "calls bar on obj" do
obj = mock
obj.should_receive(:bar).with(2)
obj.should_receive(:bar).with(anything()).any_number_of_times
foo2 obj
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment