Modified: MacRuby/branches/experimental/spec/frozen/language/retry_spec.rb (1109 => 1110)
--- MacRuby/branches/experimental/spec/frozen/language/retry_spec.rb 2009-03-23 15:15:49 UTC (rev 1109)
+++ MacRuby/branches/experimental/spec/frozen/language/retry_spec.rb 2009-03-23 15:25:14 UTC (rev 1110)
@@ -1,12 +1,6 @@
require File.dirname(__FILE__) + '/../spec_helper'
describe "The retry statement" do
- it "raises a LocalJumpError if used outside of a block" do
- def bad_meth_retry; retry; end
- lambda { bad_meth_retry() }.should raise_error(LocalJumpError)
- lambda { lambda { retry }.call }.should raise_error(LocalJumpError)
- end
-
it "re-executes the closest block" do
retry_first = true
retry_second = true
@@ -36,21 +30,6 @@
results.should == [1, 2, 3, 1, 2, 4, 5, 6, 4, 5]
end
-
- # block retry has been officially deprecated by matz and is unsupported in 1.9
- ruby_version_is "" ... "1.9" do
- not_compliant_on :rubinius do
- it "re-executes the entire enumeration" do
- list = []
- [1,2,3].each do |x|
- list << x
- break if list.size == 6
- retry if x == 3
- end
- list.should == [1,2,3,1,2,3]
- end
- end
- end
end
describe "The retry keyword inside a begin block's rescue block" do
@@ -67,3 +46,5 @@
counter.should == 7
end
end
+
+language_version __FILE__, "retry"
\ No newline at end of file
Added: MacRuby/branches/experimental/spec/frozen/language/versions/retry_1.8.rb (0 => 1110)
--- MacRuby/branches/experimental/spec/frozen/language/versions/retry_1.8.rb (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/versions/retry_1.8.rb 2009-03-23 15:25:14 UTC (rev 1110)
@@ -0,0 +1,20 @@
+describe "The retry statement" do
+ it "raises a LocalJumpError if used outside of a block" do
+ def bad_meth_retry; retry; end
+ lambda { bad_meth_retry() }.should raise_error(LocalJumpError)
+ lambda { lambda { retry }.call }.should raise_error(LocalJumpError)
+ end
+
+ # block retry has been officially deprecated by matz and is unsupported in 1.9
+ not_compliant_on :rubinius do
+ it "re-executes the entire enumeration" do
+ list = []
+ [1,2,3].each do |x|
+ list << x
+ break if list.size == 6
+ retry if x == 3
+ end
+ list.should == [1,2,3,1,2,3]
+ end
+ end
+end
\ No newline at end of file
Added: MacRuby/branches/experimental/spec/frozen/language/versions/retry_1.9.rb (0 => 1110)
--- MacRuby/branches/experimental/spec/frozen/language/versions/retry_1.9.rb (rev 0)
+++ MacRuby/branches/experimental/spec/frozen/language/versions/retry_1.9.rb 2009-03-23 15:25:14 UTC (rev 1110)
@@ -0,0 +1,6 @@
+describe "The retry statement" do
+ it "raises a SyntaxError if used outside of a block" do
+ lambda { eval "def bad_meth_retry; retry; end" }.should raise_error(SyntaxError)
+ lambda { eval "lambda { retry }.call" }.should raise_error(SyntaxError)
+ end
+end
\ No newline at end of file