Skip to content

Instantly share code, notes, and snippets.

@subelsky
Last active August 30, 2016 14:03
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 subelsky/75d8161f5517c9467d77bce92b920107 to your computer and use it in GitHub Desktop.
Save subelsky/75d8161f5517c9467d77bce92b920107 to your computer and use it in GitHub Desktop.
Really simple Ruby test example
class Adder
def add(a,b)
a + b
end
end
if __FILE__ == $0
adder = Adder.new
result = adder.add(1,2)
if result == 3
puts "OK"
else
abort "Expected 3, but got #{result}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment