Skip to content

Instantly share code, notes, and snippets.

@sw17ch
Created January 9, 2012 17:06
Show Gist options
  • Save sw17ch/1583907 to your computer and use it in GitHub Desktop.
Save sw17ch/1583907 to your computer and use it in GitHub Desktop.
is this kosher?
describe "thing" do
before do
@obj_1 = Object.new
@obj_2 = Object.new
stub(@obj_1).foo { puts "stubbed foo (1)" }
stub(@obj_2).foo { puts "stubbed foo (2)" }
end
it "1 does things" do
mock(@obj_1).foo { puts "mocked foo (1)" }
@obj_1.foo
@obj_2.foo
end
it "2 does things" do
mock(@obj_2).foo { puts "mocked foo (2)" }
@obj_1.foo
@obj_2.foo
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment