Skip to content

Instantly share code, notes, and snippets.

@goosmurf
Created March 13, 2009 09:38
Show Gist options
  • Save goosmurf/78506 to your computer and use it in GitHub Desktop.
Save goosmurf/78506 to your computer and use it in GitHub Desktop.
describe "test" do
it "should return and then raise error" do
mock = mock("Test")
crazy = 0
mock.should_receive(:blah).twice do
if crazy > 0
raise StandardError
end
crazy += 1
end
puts mock.blah
lambda { mock.blah }.should raise_error(StandardError)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment