b9caad937a
as that is what is does, compile ruby strings into vool st
31 lines
654 B
Ruby
31 lines
654 B
Ruby
require_relative "helper"
|
|
|
|
module Vool
|
|
class TestMethodStatement < MiniTest::Test
|
|
|
|
def basic_setup()
|
|
input = "def tryout(arg1, arg2) ; true ; false ; end "
|
|
@lst = RubyCompiler.compile( input )
|
|
end
|
|
def test_method
|
|
basic_setup
|
|
assert_equal MethodStatement , @lst.class
|
|
end
|
|
|
|
def test_method_name
|
|
basic_setup
|
|
assert_equal :tryout , @lst.name
|
|
end
|
|
|
|
def test_method_args
|
|
basic_setup
|
|
assert_equal [:arg1, :arg2] , @lst.args
|
|
end
|
|
def test_basic_body
|
|
basic_setup
|
|
assert_equal ScopeStatement , @lst.body.class
|
|
assert_equal 2 , @lst.body.length
|
|
end
|
|
end
|
|
end
|