Skip to content

Instantly share code, notes, and snippets.

@mayfer
Created July 9, 2014 00:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mayfer/dde7f45785c1c88997a0 to your computer and use it in GitHub Desktop.
Save mayfer/dde7f45785c1c88997a0 to your computer and use it in GitHub Desktop.
Rent testing example
# 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