Skip to content

Commit

Permalink
Fix Thread#native_thread_id spec
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Oct 31, 2022
1 parent dc2caa7 commit afe5341
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions core/thread/native_thread_id_spec.rb
Original file line number Diff line number Diff line change
@@ -1,31 +1,9 @@
require_relative '../../spec_helper'

ruby_version_is ''...'3.1' do
describe "Thread#native_thread_id" do
it "raises NoMethodError" do
th = Thread.new {}
-> { th.native_thread_id }.should raise_error(NoMethodError)
th.join
end
end
end

ruby_version_is "3.1" do
describe "Thread#native_thread_id" do
platform_is_not :linux do
it "returns an integer" do
th = Thread.new {}
th.native_thread_id.should be_kind_of(Integer)
th.join
end
end

platform_is :linux do
it "returns nil" do
th = Thread.new {}
th.native_thread_id.should be_nil
th.join
end
it "returns an integer" do
Thread.current.native_thread_id.should be_kind_of(Integer)
end
end
end

0 comments on commit afe5341

Please sign in to comment.