fixed asserts

This commit is contained in:
Torsten Ruger 2014-04-27 16:09:22 +03:00
parent 5423bc8f7e
commit 96a9cd3270
2 changed files with 4 additions and 5 deletions

View File

@ -19,19 +19,19 @@ class TestNodes < MiniTest::Test
def test_number
tree = parse "42"
assert tree.is_a? Vm::NumberExpression
assert_kind_of Vm::NumberExpression , tree
assert_equal 42 , tree.value
end
def test_args
tree = parse "( 42 )"
assert tree.is_a? Hash
assert tree[:args].is_a? Vm::NumberExpression
assert_kind_of Hash , tree
assert_kind_of Vm::NumberExpression , tree[:args]
assert_equal 42 , tree[:args].value
end
def test_arg_list
@parser = @parser.args
tree = parse "(42, foo)"
assert_equal Array , tree.class
assert_instance_of Array , tree
assert_equal 42 , tree.first.value
assert_equal "foo" , tree.last.name
end

View File

@ -1,5 +1,4 @@
require_relative 'helper'
require 'minitest/spec'
class ParserTest < MiniTest::Test