Revision: 1069 http://trac.macosforge.org/projects/ruby/changeset/1069 Author: eloy.de.enige@gmail.com Date: 2009-03-22 16:34:17 -0700 (Sun, 22 Mar 2009) Log Message: ----------- Using the 'redo' keyword outside a block or while/for loop on Ruby 1.9 results in a SyntaxError instead of LocalJumpError. Moved the example into a 1.8 version spec file and added a new one which describes the behaviour on Ruby 1.9. Modified Paths: -------------- MacRuby/branches/experimental/spec/frozen/language/redo_spec.rb Added Paths: ----------- MacRuby/branches/experimental/spec/frozen/language/versions/redo_1.8.rb MacRuby/branches/experimental/spec/frozen/language/versions/redo_1.9.rb Modified: MacRuby/branches/experimental/spec/frozen/language/redo_spec.rb =================================================================== --- MacRuby/branches/experimental/spec/frozen/language/redo_spec.rb 2009-03-22 22:35:50 UTC (rev 1068) +++ MacRuby/branches/experimental/spec/frozen/language/redo_spec.rb 2009-03-22 23:34:17 UTC (rev 1069) @@ -1,11 +1,6 @@ require File.dirname(__FILE__) + '/../spec_helper' describe "The redo statement" do - it "raises a LocalJumpError if used not within block or while/for loop" do - def bad_meth_redo; redo; end - lambda { bad_meth_redo() }.should raise_error(LocalJumpError) - end - it "restarts block execution if used within block" do a = [] lambda { @@ -66,3 +61,5 @@ end end end + +language_version __FILE__, "redo" \ No newline at end of file Added: MacRuby/branches/experimental/spec/frozen/language/versions/redo_1.8.rb =================================================================== --- MacRuby/branches/experimental/spec/frozen/language/versions/redo_1.8.rb (rev 0) +++ MacRuby/branches/experimental/spec/frozen/language/versions/redo_1.8.rb 2009-03-22 23:34:17 UTC (rev 1069) @@ -0,0 +1,6 @@ +describe "The redo statement" do + it "raises a LocalJumpError if used not within block or while/for loop" do + def bad_meth_redo; redo; end + lambda { bad_meth_redo() }.should raise_error(LocalJumpError) + end +end \ No newline at end of file Added: MacRuby/branches/experimental/spec/frozen/language/versions/redo_1.9.rb =================================================================== --- MacRuby/branches/experimental/spec/frozen/language/versions/redo_1.9.rb (rev 0) +++ MacRuby/branches/experimental/spec/frozen/language/versions/redo_1.9.rb 2009-03-22 23:34:17 UTC (rev 1069) @@ -0,0 +1,7 @@ +describe "The redo statement" do + it "raises a SyntaxError if used not within block or while/for loop" do + lambda do + eval "def bad_meth_redo; redo; end" + end.should raise_error(SyntaxError) + end +end \ No newline at end of file
participants (1)
-
source_changes@macosforge.org