class TestInfix

Public Instance Methods

setup() click to toggle source
# File test/test.rb, line 106
def setup
        @type = "rpn" 
        @string = "12 + 18 / ( 3 ^ 2 ) - 13"
        @rpn_array = [12.0, 18.0, 3.0, 2.0, "**", "/", 13.0, "-", "+"]
        @result = 1
        @Infix = MathNotation.new(@string, "infix")
end
test_result_access() click to toggle source
# File test/test.rb, line 126
def test_result_access
        assert_equal(@result, @Infix.result)
end
test_shunting_yard() click to toggle source
# File test/test.rb, line 122
def test_shunting_yard
        assert_equal(@rpn_array, @Infix.array)
end
test_string_access() click to toggle source
# File test/test.rb, line 118
def test_string_access
        assert_equal(@string, @Infix.string)
end
test_type() click to toggle source
# File test/test.rb, line 114
def test_type
        assert_equal(@type, @Infix.type)
end