Add ruby class methods

Ruby parser and ruby level for #24
This commit is contained in:
Torsten Ruger
2019-02-12 22:36:37 +02:00
parent 403540b3ca
commit 37571a0ff9
5 changed files with 39 additions and 1 deletions

View File

@ -53,4 +53,18 @@ module Ruby
assert_equal LocalAssignment , lst.body.class
end
end
class TestClassMethodStatement < MiniTest::Test
include RubyTests
def test_basic_method
input = "def self.tryout() ; return true ; end "
@lst = compile( input )
assert_equal Ruby::ClassMethodStatement , @lst.class
end
def test_method_arg
input = "def self.tryout(arg) ; arg = true ; return arg ; end "
@lst = compile( input )
assert_equal Ruby::ClassMethodStatement , @lst.class
end
end
end