rubyx/test/mom/test_callable_compiler.rb
Torsten Rüger 7ee57f2b08 generalize get_main and get_init to get_method
to get at those know methods that really
__must__ exists, hence the bang, raise if don't
about to add method missing and raise to the list
2019-09-15 12:58:43 +03:00

31 lines
676 B
Ruby

require_relative "helper"
module Mom
class FakeCallableCompiler < CallableCompiler
def source_name
"luke"
end
end
class TestCallableCompiler < MiniTest::Test
def setup
@compiler = FakeCallableCompiler.new(FakeCallable.new)
end
def test_ok
assert @compiler
end
def test_current
assert @compiler.current
end
def test_current_label
assert_equal Label , @compiler.current.class
assert_equal @compiler.source_name , @compiler.current.name
end
def test_mom
assert @compiler.mom_instructions
end
def test_const
assert_equal Array , @compiler.constants.class
end
end
end