Skip to content

Commit 0ab5062

Browse files
committed
Fix test failures under jruby
1 parent 818b6c0 commit 0ab5062

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

sentry-ruby/spec/sentry/client_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,15 +321,15 @@ def sentry_context
321321
version = Gem::Version.new(RUBY_VERSION)
322322

323323
case
324-
when version >= Gem::Version.new("3.4.0-dev")
324+
when version >= Gem::Version.new("3.4.0-dev") && RUBY_ENGINE == "ruby"
325325
expect(hash[:exception][:values][0][:value]).to eq(
326326
"undefined method '[]' for nil (NoMethodError)\n\n {}[:foo][:bar]\n ^^^^^^"
327327
)
328-
when version >= Gem::Version.new("3.3.0-dev")
328+
when version >= Gem::Version.new("3.3.0-dev") && RUBY_ENGINE == "ruby"
329329
expect(hash[:exception][:values][0][:value]).to eq(
330330
"undefined method `[]' for nil (NoMethodError)\n\n {}[:foo][:bar]\n ^^^^^^"
331331
)
332-
when version >= Gem::Version.new("3.2")
332+
when version >= Gem::Version.new("3.2") && RUBY_ENGINE == "ruby"
333333
expect(hash[:exception][:values][0][:value]).to eq(
334334
"undefined method `[]' for nil:NilClass (NoMethodError)\n\n {}[:foo][:bar]\n ^^^^^^"
335335
)

sentry-ruby/spec/sentry/vernier/profiler_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require "sentry/vernier/profiler"
44

5-
RSpec.describe Sentry::Vernier::Profiler, when: { ruby_version?: [:>=, "3.3"] } do
5+
RSpec.describe Sentry::Vernier::Profiler, when: { ruby_version?: [:>=, "3.3"], ruby_engine?: "ruby" } do
66
subject(:profiler) { described_class.new(Sentry.configuration) }
77

88
before do
@@ -264,7 +264,7 @@
264264
expect(thread2[:name]).to eq("thread-bar-1")
265265
end
266266

267-
it 'has correct frames', when: { ruby_version?: [:>=, "3.3"] } do
267+
it 'has correct frames', when: { ruby_version?: [:>=, "3.3"], ruby_engine?: "ruby" } do
268268
frames = profiler.to_hash[:profile][:frames]
269269

270270
foo_frame = frames.find { |f| f[:function] =~ /foo/ }
@@ -277,7 +277,7 @@
277277
expect(foo_frame[:abs_path]).to include('sentry-ruby/spec/support/profiler.rb')
278278
end
279279

280-
it 'has correct stacks', when: { ruby_version?: [:>=, "3.3"] } do
280+
it 'has correct stacks', when: { ruby_version?: [:>=, "3.3"], ruby_engine?: "ruby" } do
281281
profile = profiler.to_hash[:profile]
282282
frames = profile[:frames]
283283
stacks = profile[:stacks]

0 commit comments

Comments
 (0)