Skip to content

Instantly share code, notes, and snippets.

@cannikin
Created March 9, 2021 01:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cannikin/7b5ad1c7b1b90428ae594ae8364c9780 to your computer and use it in GitHub Desktop.
Save cannikin/7b5ad1c7b1b90428ae594ae8364c9780 to your computer and use it in GitHub Desktop.
Simple inline Ruby tests
# Just run this file with ruby to run tests: `ruby math.rb`
require 'minitest/autorun'
class Math
def self.add(a, b)
a + b
end
end
class MathTest < Minitest::Test
def test_add
result = Math.add(1,2)
assert_equal result, 3
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment