Revision: 1297 http://trac.macosforge.org/projects/ruby/changeset/1297 Author: lsansonetti@apple.com Date: 2009-04-02 22:44:40 -0700 (Thu, 02 Apr 2009) Log Message: ----------- uncommented code that now compiles (and works, yay) Modified Paths: -------------- MacRuby/branches/experimental/spec/frozen/language/loop_spec.rb Modified: MacRuby/branches/experimental/spec/frozen/language/loop_spec.rb =================================================================== --- MacRuby/branches/experimental/spec/frozen/language/loop_spec.rb 2009-04-03 05:44:16 UTC (rev 1296) +++ MacRuby/branches/experimental/spec/frozen/language/loop_spec.rb 2009-04-03 05:44:40 UTC (rev 1297) @@ -42,29 +42,27 @@ a.should == [1, 2, 4] end - # MacRuby TODO: These do not compile yet. - # - # it "restarts the current iteration with redo" do - # a = [] - # loop do - # a << 1 - # redo if a.size < 2 - # a << 2 - # break if a.size == 3 - # end - # a.should == [1, 1, 2] - # end - # - # it "uses a spaghetti nightmare of redo, next and break" do - # a = [] - # loop do - # a << 1 - # redo if a.size == 1 - # a << 2 - # next if a.size == 3 - # a << 3 - # break if a.size > 6 - # end - # a.should == [1, 1, 2, 1, 2, 3, 1, 2, 3] - # end + it "restarts the current iteration with redo" do + a = [] + loop do + a << 1 + redo if a.size < 2 + a << 2 + break if a.size == 3 + end + a.should == [1, 1, 2] + end + + it "uses a spaghetti nightmare of redo, next and break" do + a = [] + loop do + a << 1 + redo if a.size == 1 + a << 2 + next if a.size == 3 + a << 3 + break if a.size > 6 + end + a.should == [1, 1, 2, 1, 2, 3, 1, 2, 3] + end end