Created
September 21, 2008 04:05
-
-
Save Sixeight/11838 to your computer and use it in GitHub Desktop.
This file contains 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
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