Revision
1945
Author
lsansonetti@apple.com
Date
2009-06-26 23:38:55 -0700 (Fri, 26 Jun 2009)

Log Message

1.9-related spec work

Modified Paths

Diff

Modified: MacRuby/branches/experimental/spec/frozen/core/thread/join_spec.rb (1944 => 1945)


--- MacRuby/branches/experimental/spec/frozen/core/thread/join_spec.rb	2009-06-27 05:57:24 UTC (rev 1944)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/join_spec.rb	2009-06-27 06:38:55 UTC (rev 1945)
@@ -45,8 +45,17 @@
     t.join.should equal(t)
   end
 
-  it "returns the dead thread even if an uncaught exception is thrown from ensure block" do
-    t = ThreadSpecs.dying_thread_ensures { raise "In dying thread" }
-    t.join.should equal(t)
+  ruby_version_is "" ... "1.9" do
+    it "returns the dead thread even if an uncaught exception is thrown from ensure block" do
+      t = ThreadSpecs.dying_thread_ensures { raise "In dying thread" }
+      t.join.should equal(t)
+    end
   end
+
+  ruby_version_is "1.9" do
+    it "raises any uncaught exception encountered in ensure block" do
+      t = ThreadSpecs.dying_thread_ensures { raise NotImplementedError.new("Just kidding") }
+      lambda { t.join }.should raise_error(NotImplementedError)
+    end
+  end
 end

Modified: MacRuby/branches/experimental/spec/frozen/core/thread/value_spec.rb (1944 => 1945)


--- MacRuby/branches/experimental/spec/frozen/core/thread/value_spec.rb	2009-06-27 05:57:24 UTC (rev 1944)
+++ MacRuby/branches/experimental/spec/frozen/core/thread/value_spec.rb	2009-06-27 06:38:55 UTC (rev 1945)
@@ -11,13 +11,24 @@
     lambda { t.value }.should raise_error(RuntimeError, "Hello")
   end
 
-  it "is false for a killed thread" do
-    t = Thread.new { Thread.current.exit }
-    t.value.should == false
+  ruby_version_is "" ... "1.9" do
+    it "is false for a killed thread" do
+      t = Thread.new { Thread.current.exit }
+      t.value.should == false
+    end
   end
 
-  it "is false for an uncaught exception thrown from a dying thread" do
-    t = ThreadSpecs.dying_thread_ensures { 1/0 }
-    t.value.should == false
+  ruby_version_is "1.9" do
+    it "is nil for a killed thread" do
+      t = Thread.new { Thread.current.exit }
+      t.value.should == nil
+    end
   end
+
+  ruby_version_is "" ... "1.9" do
+    it "is false for an uncaught exception thrown from a dying thread" do
+      t = ThreadSpecs.dying_thread_ensures { 1/0 }
+      t.value.should == false
+    end
+  end
 end