diff options
author | Benoit Daloze <eregontp@gmail.com> | 2019-12-27 16:46:08 +0100 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2019-12-27 16:46:08 +0100 |
commit | a2fac1d72c225192018f8f3f3dfcfcc46f66c08a (patch) | |
tree | dc2d44079962ce242d971a4d1c2a2b1333e64cec /spec/ruby/core/thread | |
parent | 26a9f80c823a9f536a235d80d600aa9e03ed7a2f (diff) | |
download | ruby-a2fac1d72c225192018f8f3f3dfcfcc46f66c08a.tar.gz |
Update to ruby/spec@d419e74
Diffstat (limited to 'spec/ruby/core/thread')
-rw-r--r-- | spec/ruby/core/thread/shared/to_s.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/ruby/core/thread/shared/to_s.rb b/spec/ruby/core/thread/shared/to_s.rb index e47426cf3f..45c04af627 100644 --- a/spec/ruby/core/thread/shared/to_s.rb +++ b/spec/ruby/core/thread/shared/to_s.rb @@ -4,11 +4,13 @@ describe :thread_to_s, shared: true do sep = ruby_version_is("2.7") ? " " : "@" it "returns a description including file and line number" do - Thread.new { "hello" }.send(@method).should =~ /^#<Thread:([^ ]*?)#{sep}#{Regexp.escape __FILE__}:#{__LINE__ } \w+>$/ + thread, line = Thread.new { "hello" }, __LINE__ + thread.join + thread.send(@method).should =~ /^#<Thread:([^ ]*?)#{sep}#{Regexp.escape __FILE__}:#{line} \w+>$/ end it "has a binary encoding" do - Thread.new { "hello" }.send(@method).encoding.should == Encoding::BINARY + ThreadSpecs.status_of_current_thread.send(@method).encoding.should == Encoding::BINARY end it "can check it's own status" do |