Created
January 30, 2009 17:51
-
-
Save rubyredrick/55162 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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