diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-12-11 16:19:49 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-12-11 16:52:06 +0900 |
commit | d2d42081ce76954ff55392a6e07e3eb4f26c696c (patch) | |
tree | 3dab49cb1f990a4b6a727efa54824f663aaadefe /spec/ruby/core/thread/shared/to_s.rb | |
parent | eb9c0070535bc088ab2921613830ba983bfe07a1 (diff) | |
download | ruby-d2d42081ce76954ff55392a6e07e3eb4f26c696c.tar.gz |
`Thread#to_s` has been added at ruby 2.5
Diffstat (limited to 'spec/ruby/core/thread/shared/to_s.rb')
-rw-r--r-- | spec/ruby/core/thread/shared/to_s.rb | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/spec/ruby/core/thread/shared/to_s.rb b/spec/ruby/core/thread/shared/to_s.rb index 7bc7234c85..0c4e3c0b96 100644 --- a/spec/ruby/core/thread/shared/to_s.rb +++ b/spec/ruby/core/thread/shared/to_s.rb @@ -1,15 +1,9 @@ require_relative '../fixtures/classes' describe :thread_to_s, shared: true do - sep = " " - ruby_version_is(''..."2.7"){ sep = '@' } + sep = ruby_version_is("2.7") ? " " : "@" it "returns a description including file and line number" do - ruby_version_is(''...'2.5') do - # Thread#to_s is not same as Thread#inspect until Ruby 2.4. - skip if @method == :to_s - end - Thread.new { "hello" }.send(@method).should =~ /^#<Thread:([^ ]*?)#{sep}#{Regexp.escape __FILE__}:#{__LINE__ } \w+>$/ end |