Skip to content

Instantly share code, notes, and snippets.

@apeiros
Created March 17, 2010 22:56
Show Gist options
  • Save apeiros/335835 to your computer and use it in GitHub Desktop.
Save apeiros/335835 to your computer and use it in GitHub Desktop.
BareTest.suite "Integer Division" do
setup :addition do
@divident, @divisor, @expected_quotient = 1, 1, 1
end
setup :addition do
@divident, @divisor, @expected_quotient = 1, 2, 0
end
setup :addition do
@divident, @divisor, @expected_quotient = 2, 2, 1
end
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment