From 165b4199ddd31a2faa59bd230bba56c19ebd6d1e Mon Sep 17 00:00:00 2001 From: Mike Blumtritt Date: Thu, 30 May 2024 22:01:40 +0200 Subject: [PATCH] Use platform specific test --- spec/lib/im-lost_spec.rb | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/spec/lib/im-lost_spec.rb b/spec/lib/im-lost_spec.rb index fe3f0ba..3cd90e4 100644 --- a/spec/lib/im-lost_spec.rb +++ b/spec/lib/im-lost_spec.rb @@ -408,14 +408,25 @@ def bar = :bar thread[:var] = 41 ImLost.vars(thread.join) - expect(output).to eq <<~OUTPUT - = #{__FILE__}:#{__LINE__ - 3} - terminated Thread - > fiber-local variables - var: 21 - > thread variables - result: 42 - OUTPUT + if defined?(thread.native_thread_id) + expect(output).to eq <<~OUTPUT + = #{__FILE__}:#{__LINE__ - 3} + terminated Thread + > fiber-local variables + var: 21 + > thread variables + result: 42 + OUTPUT + else + expect(output).to eq <<~OUTPUT + = #{__FILE__}:#{__LINE__ - 3} + terminated Thread #{thread.__id__} + > fiber-local variables + var: 21 + > thread variables + result: 42 + OUTPUT + end end it 'returns given thread' do