From b5ca886069e8b391b24273d298bdfc7f1424b36b Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Thu, 7 Sep 2017 08:16:37 +0300 Subject: [PATCH] moving helper for all to use --- test/support/compiling.rb | 20 +++++++++++++++++++- test/vool/to_mom/helper.rb | 13 ------------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/test/support/compiling.rb b/test/support/compiling.rb index 89ca6f04..4a563ca3 100644 --- a/test/support/compiling.rb +++ b/test/support/compiling.rb @@ -14,7 +14,25 @@ module CompilerHelper end def as_test_main( statements ) - in_Test("def main(arg) ; #{statements}; end") + in_Test("def main(arg) ; #{statements}; end") + end +end + +module MomCompile + include CompilerHelper + + def compile_first_method input + lst = Vool::VoolCompiler.compile as_test_main( input ) + assert_equal Parfait::Class , lst.clazz.class , input + @method = lst.clazz.get_method(:main) + assert @method + res = lst.to_mom( nil ) + #puts "#{res.class}" + res.first + end + + def compile_first_method_flat(input) + compile_first_method(input).flatten end end diff --git a/test/vool/to_mom/helper.rb b/test/vool/to_mom/helper.rb index 93f4dd6c..26258082 100644 --- a/test/vool/to_mom/helper.rb +++ b/test/vool/to_mom/helper.rb @@ -1,14 +1 @@ require_relative "../helper" - -module MomCompile - include CompilerHelper - - def compile_first_method input - lst = Vool::VoolCompiler.compile as_test_main( input ) - assert_equal Parfait::Class , lst.clazz.class , input - @method = lst.clazz.get_method(:main) - assert @method - lst.to_mom( nil ).first - end - -end