rubyx/test/vool/blocks/test_class_blocks.rb
Torsten Ruger 3db7707614 Get a basic MetaClass going
Does get created in new, but not in boot.
Also not yet used in compiling
2019-02-16 23:24:16 +02:00

28 lines
748 B
Ruby

require_relative "../helper"
module VoolBlocks
class TestClassAssignMom < MiniTest::Test
include MomCompile
def setup
Parfait.boot!(Parfait.default_test_options)
end
def as_class_method(source)
"class Space;def self.main();#{source};end;end"
end
def test_block_not_compiles
source = "main{|val| val = 0}"
vool = Ruby::RubyCompiler.compile( as_class_method(source) ).to_vool
begin
vool.to_mom(nil)
rescue => err
assert err.message.include?("Blocks") , err.message
end
end
def test_assign_compiles
vool = Ruby::RubyCompiler.compile( as_class_method("val = 0") ).to_vool
assert_equal Mom::MomCompiler , vool.to_mom(nil).class
end
end
end