rubyx/test/vool/test_method_expression.rb
Torsten Rüger a722a4c285 Move vool block compilation into constant generation
When the lambda is passed as argument, it must be moved. This triggers the generation of a corresponding parfait object (as before, and as for other constants) but now also triggers the code build. The code being the constant as it were
Also some more name fixes from renames
2019-08-19 14:33:02 +03:00

30 lines
759 B
Ruby

require_relative "helper"
module Vool
class TestMethodStatement < MiniTest::Test
include VoolCompile
def setup
Parfait.boot!(Parfait.default_test_options)
ruby_tree = Ruby::RubyCompiler.compile( as_test_main("a = 5") )
@clazz = ruby_tree.to_vool
end
def method
@clazz.body.first
end
def test_setup
assert_equal ClassExpression , @clazz.class
assert_equal Statements , @clazz.body.class
assert_equal MethodExpression , method.class
end
def test_class
assert_equal Parfait::Class , @clazz.create_class_object.class
end
def test_method
clazz = @clazz.create_class_object
assert_equal Parfait::VoolMethod , method.make_method(clazz).class
end
end
end