Skip to content

Instantly share code, notes, and snippets.

@calorie
Last active December 18, 2015 13:59
Show Gist options
  • Save calorie/5793628 to your computer and use it in GitHub Desktop.
Save calorie/5793628 to your computer and use it in GitHub Desktop.
cspec improved
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