Skip to content

Instantly share code, notes, and snippets.

@k2works
Last active April 5, 2020 06:41
Show Gist options
  • Save k2works/ee1698c9b28e7e9e7488872d0600537e to your computer and use it in GitHub Desktop.
Save k2works/ee1698c9b28e7e9e7488872d0600537e to your computer and use it in GitHub Desktop.
Ruby TDD Startter
# Test::Unit
require 'test/unit'
class TestAdd < Test::Unit::TestCase
def setup;end
def test_add
assert_equal 5, add(2,2)
end
end
# Minitest
require 'minitest/autorun'
class MiniTestAdd < Minitest::Test
def setup;end
def test_add
assert_equal 5, add(2, 2)
end
end
def add(a, b)
a + b
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment