rubyx/test/parfait/test_vool_method.rb
Torsten Rüger dd810cfc49 Make to_mom a 2 stage process
First baby baby step on the way to passes
Create all parfait objects in first pass, so methods exist to be resolved in second path
2019-09-24 15:44:33 +03:00

29 lines
729 B
Ruby

require_relative "helper"
module Vool
class TestVoolMethod < MiniTest::Test
include VoolCompile
def setup
Parfait.boot!(Parfait.default_test_options)
ruby_tree = Ruby::RubyCompiler.compile( as_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.to_parfait.class
end
def test_method
clazz = @clazz.to_parfait
assert_equal Parfait::VoolMethod , method.to_parfait(clazz).class
end
end
end