Skip to content

Instantly share code, notes, and snippets.

@Sixeight
Created September 21, 2008 04:05
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 Sixeight/11838 to your computer and use it in GitHub Desktop.
Save Sixeight/11838 to your computer and use it in GitHub Desktop.
require 'test/unit'
require 'rpn'
class TestRPN < Test::Unit::TestCase
def setup
@rpn = RPN.new
end
def test_1_plus_1
assert_equal(2, @rpn.calc('1 1 +'))
end
def test_2_plus_2
assert_equal(4, @rpn.calc('2 2 +'))
end
def test_3_minus_2
assert_equal(1, @rpn.calc('3 2 -'))
end
def test_3_kakeru_2
assert_equal(6, @rpn.calc('3 2 *'))
end
def test_6_waru_2
assert_equal(3, @rpn.calc('6 2 /'))
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment