Created
March 9, 2021 01:03
-
-
Save cannikin/7b5ad1c7b1b90428ae594ae8364c9780 to your computer and use it in GitHub Desktop.
Simple inline Ruby tests
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
# 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