Created
July 9, 2014 00:20
-
-
Save mayfer/dde7f45785c1c88997a0 to your computer and use it in GitHub Desktop.
Rent testing example
This file contains hidden or 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
# must be baller and either furnished or rent cheaper than 2100 | |
def rent?(furnished, rent, baller) | |
if baller && furnished || rent < 2100 | |
return true | |
else | |
return false | |
end | |
end | |
puts "should be true" | |
puts rent?(true, 2000, true) | |
puts | |
puts "should be false" | |
puts rent?(true, 2000, false) | |
puts | |
# so on and so forth | |
puts rent?(true, 3000, true) | |
puts rent?(true, 3000, false) | |
puts rent?(false, 2000, true) | |
puts rent?(false, 2000, false) | |
puts rent?(false, 3000, true) | |
puts rent?(false, 3000, false) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment