Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

$? is thread-local in 1.9

  • Loading branch information...
commit 0a65ce9bf500cbc6ddd2518151f63a055d188783 1 parent 213d862
John Firebaugh jfirebaugh authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 spec/ruby/language/predefined_spec.rb
15 spec/ruby/language/predefined_spec.rb
View
@@ -454,6 +454,21 @@ def obj.foo2; yield; end
$? = nil
}.should raise_error(NameError)
end
+
+ ruby_version_is ""..."1.9" do
+ it "is shared across threads" do
+ system("true")
+ pid = $?.pid
+ Thread.new { $?.pid.should == pid }.join
+ end
+ end
+
+ ruby_version_is "1.9" do
+ it "is thread-local" do
+ system("true")
+ Thread.new { $?.should be_nil }.join
+ end
+ end
end
describe "Global variable $-a" do
Please sign in to comment.
Something went wrong with that request. Please try again.