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