Skip to content

Commit f7b7438

Browse files
committed
fix(specs): remove global class from client spec
1 parent 772ae6f commit f7b7438

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

sentry-ruby/spec/sentry/client_spec.rb

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
# frozen_string_literal: true
22

3-
class ExceptionWithContext < StandardError
4-
def sentry_context
5-
{
6-
foo: "bar"
7-
}
8-
end
9-
end
10-
113
RSpec.describe Sentry::Client do
124
subject { Sentry::Client.new(configuration) }
135

@@ -572,8 +564,18 @@ module ExcTag; end
572564
end
573565

574566
context 'when the exception responds to sentry_context' do
567+
let(:exception_with_context) do
568+
Class.new(StandardError) do
569+
def sentry_context
570+
{
571+
foo: "bar"
572+
}
573+
end
574+
end
575+
end
576+
575577
let(:hash) do
576-
event = subject.event_from_exception(ExceptionWithContext.new)
578+
event = subject.event_from_exception(exception_with_context.new)
577579
event.to_h
578580
end
579581

0 commit comments

Comments
 (0)