aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2019-12-11 14:00:32 +0900
committerKoichi Sasada <ko1@atdot.net>2019-12-11 14:00:32 +0900
commit6025783a3b0b37517728c635250669449bb21a53 (patch)
treee36d5dca5672e3d434c56e958a86e16e22ff8d7b /spec
parentfe8caf0ab93e69b743470d16f6cf7416fe9c98da (diff)
downloadruby-6025783a3b0b37517728c635250669449bb21a53.tar.gz
fix for old MRI versions
Diffstat (limited to 'spec')
-rw-r--r--spec/ruby/core/thread/shared/to_s.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/spec/ruby/core/thread/shared/to_s.rb b/spec/ruby/core/thread/shared/to_s.rb
index 0c4e3c0b96..c3718cef88 100644
--- a/spec/ruby/core/thread/shared/to_s.rb
+++ b/spec/ruby/core/thread/shared/to_s.rb
@@ -1,7 +1,8 @@
require_relative '../fixtures/classes'
describe :thread_to_s, shared: true do
- sep = ruby_version_is("2.7") ? " " : "@"
+ sep = " "
+ ruby_version_is(''..."2.7"){ sep = '@' }
it "returns a description including file and line number" do
Thread.new { "hello" }.send(@method).should =~ /^#<Thread:([^ ]*?)#{sep}#{Regexp.escape __FILE__}:#{__LINE__ } \w+>$/