From 8bac096f7428214b05bcba050bd4c6a3ebd63c7e Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Tue, 20 Mar 2018 13:29:18 +0530 Subject: [PATCH] fix while statements each MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit wasn’t picking up condition --- lib/vool/statements/while_statement.rb | 2 +- test/vool/to_mom/test_while_simple.rb | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/vool/statements/while_statement.rb b/lib/vool/statements/while_statement.rb index 5e3c3f4d..b36be95b 100644 --- a/lib/vool/statements/while_statement.rb +++ b/lib/vool/statements/while_statement.rb @@ -29,7 +29,7 @@ module Vool def each(&block) block.call(self) - @condition.each(&block) + block.call(@condition) @body.each(&block) end diff --git a/test/vool/to_mom/test_while_simple.rb b/test/vool/to_mom/test_while_simple.rb index 6112e0a9..b02787a0 100644 --- a/test/vool/to_mom/test_while_simple.rb +++ b/test/vool/to_mom/test_while_simple.rb @@ -11,9 +11,6 @@ module Vool @ins = compile_first_method( "while(@a) ; 5.mod4 ; end") end - def test_compiles_not_array - assert Array != @ins.class , @ins - end def test_compiles_as_while assert_equal Label , @ins.class , @ins end