From cb2323a98366bb7afb7b2fee2547804bbbc9d345 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 8 Nov 2022 09:31:58 +0900 Subject: [PATCH] Thread#native_thread_id is very platform specific --- spec/ruby/core/thread/native_thread_id_spec.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/ruby/core/thread/native_thread_id_spec.rb b/spec/ruby/core/thread/native_thread_id_spec.rb index 5a6c0c8632..d6cc332bf6 100644 --- a/spec/ruby/core/thread/native_thread_id_spec.rb +++ b/spec/ruby/core/thread/native_thread_id_spec.rb @@ -1,6 +1,8 @@ require_relative '../../spec_helper' -ruby_version_is "3.1" do +if ruby_version_is "3.1" and Thread.method_defined?(:native_thread_id) + # This method is very platform specific + describe "Thread#native_thread_id" do it "returns an integer when the thread is alive" do Thread.current.native_thread_id.should be_kind_of(Integer)