Skip to content

Instantly share code, notes, and snippets.

@rubyredrick
Created January 30, 2009 17:51
Show Gist options
  • Select an option

  • Save rubyredrick/55162 to your computer and use it in GitHub Desktop.

Select an option

Save rubyredrick/55162 to your computer and use it in GitHub Desktop.
describe "calculator" do
it "should add two numbers together" do
expect_that "2 + 3 = 5" do
Calculator.new.add(2,3).should == 5
end
end
end
# if the expectation failed then the message would be 'expected 2 + 3 == 5, but got 6'
# perhaps this could be altered/extended with a way to insert the actual result with something like...
describe "calculator" do
it "should add two numbers together" do
expect_that "2 + 3 = 5 but we got $ACTUAL" do
Calculator.new.add(2,3).should == 5
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment