Created
March 17, 2010 22:42
-
-
Save apeiros/335821 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 data(:integer_division) | |
exercise ":@divident divided by :@divisor" do | |
@actual_quotient = @divident/@divisor | |
end | |
verify "returns an integer" do | |
kind_of Integer, @actual_quotient | |
end | |
verify "equals :@expected_quotient" do | |
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