summaryrefslogtreecommitdiff
path: root/spec/ruby/spec_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/spec_helper.rb')
-rw-r--r--spec/ruby/spec_helper.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/ruby/spec_helper.rb b/spec/ruby/spec_helper.rb
index c275e320ec..e7873ce594 100644
--- a/spec/ruby/spec_helper.rb
+++ b/spec/ruby/spec_helper.rb
@@ -3,6 +3,17 @@ root = File.dirname(__FILE__)
dir = "fixtures/code"
CODE_LOADING_DIR = use_realpath ? File.realpath(dir, root) : File.expand_path(dir, root)
+# Enable Thread.report_on_exception by default to catch thread errors earlier
+if Thread.respond_to? :report_on_exception=
+ Thread.report_on_exception = true
+else
+ class Thread
+ def report_on_exception=(value)
+ raise "shim Thread#report_on_exception used with true" if value
+ end
+ end
+end
+
# Running directly with ruby some_spec.rb
unless ENV['MSPEC_RUNNER']
begin