Created
March 17, 2010 22:52
-
-
Save apeiros/335829 to your computer and use it in GitHub Desktop.
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
BareTest.suite "Integer Division" do | |
data :integer_division, :csv, <<-DATA | |
@divident, @divisor, @expected_quotient | |
1, 1, 1 | |
1, 2, 0 | |
2, 2, 1 | |
DATA | |
setup :addition, data(:addition) | |
assert ":@divident divided by :@divisor returns an integer" do | |
@actual_quotient = @divident/@divisor | |
kind_of Integer, @actual_quotient | |
end | |
assert ":@divident divided by :@divisor equals :@expected_quotient" do | |
@actual_quotient = @divident/@divisor | |
equal @expected_quotient, @actual_quotient | |
end | |
end |
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
Integer Division | |
[ success ] 1 divided by 1 returns an integer | |
[ success ] 1 divided by 2 returns an integer | |
[ success ] 2 divided by 2 returns an integer | |
[ success ] 1 divided by 1 equals 1 | |
[ success ] 1 divided by 2 equals 0 | |
[ success ] 2 divided by 2 equals 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment