-
-
Save calorie/5793628 to your computer and use it in GitHub Desktop.
cspec improved
This file contains 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(fabs, "double fabs( double arg )") | |
it( "returns the same number if the input number is positive" ) | |
should_equal( fabs(1.0), 1.0) | |
should_equal( fabs(0.0), 0.0) | |
should_equal( fabs(6.7), 6.7) | |
end | |
it( "returns the opposite number if the number is negative" ) | |
should_equal( fabs(-1.0, 1.0) | |
should_equal( fabs(-6.7), 6.7) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment