2019-08-08 11:18:36 +02:00
|
|
|
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
|
2019-08-19 13:33:02 +02:00
|
|
|
assert_equal ClassExpression , @clazz.class
|
2019-08-08 11:18:36 +02:00
|
|
|
assert_equal Statements , @clazz.body.class
|
2019-08-19 13:33:02 +02:00
|
|
|
assert_equal MethodExpression , method.class
|
2019-08-08 11:18:36 +02:00
|
|
|
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
|