summaryrefslogtreecommitdiff
path: root/spec/ruby
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-14 13:08:02 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-14 13:08:02 +0000
commit2e315baf48b7c06d487cf6082e82377e93442bc7 (patch)
tree2aa7dce3d3326c0b2f4ef53962e1ab958449588a /spec/ruby
parent13ea7a876159ef67d57a90e2020e28cb6082e580 (diff)
The main Thread should have report_on_exception=true for consistency
* Adapt test and add specs. * See [Feature #14143] [ruby-core:84227] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby')
-rw-r--r--spec/ruby/core/thread/report_on_exception_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/ruby/core/thread/report_on_exception_spec.rb b/spec/ruby/core/thread/report_on_exception_spec.rb
index 74b7984a32..d8400c080a 100644
--- a/spec/ruby/core/thread/report_on_exception_spec.rb
+++ b/spec/ruby/core/thread/report_on_exception_spec.rb
@@ -34,6 +34,16 @@ ruby_version_is "2.4" do
end
describe "Thread#report_on_exception" do
+ ruby_version_is "2.5" do
+ it "returns true for the main Thread" do
+ Thread.current.report_on_exception.should == true
+ end
+
+ it "returns true for new Threads" do
+ Thread.new { Thread.current.report_on_exception }.value.should == true
+ end
+ end
+
it "returns whether the Thread will print a backtrace if it exits with an exception" do
t = Thread.new { Thread.current.report_on_exception = true }
t.join