File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed
Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
3- class ExceptionWithContext < StandardError
4- def sentry_context
5- {
6- foo : "bar"
7- }
8- end
9- end
10-
113RSpec . describe Sentry ::Client do
4+ subject { Sentry ::Client . new ( configuration ) }
5+
126 let ( :configuration ) do
137 Sentry ::Configuration . new . tap do |config |
148 config . dsn = Sentry ::TestHelper ::DUMMY_DSN
159 config . transport . transport_class = Sentry ::DummyTransport
1610 end
1711 end
18- subject { Sentry ::Client . new ( configuration ) }
1912
2013 let ( :hub ) do
2114 Sentry ::Hub . new ( subject , Sentry ::Scope . new )
@@ -571,8 +564,18 @@ module ExcTag; end
571564 end
572565
573566 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+
574577 let ( :hash ) do
575- event = subject . event_from_exception ( ExceptionWithContext . new )
578+ event = subject . event_from_exception ( exception_with_context . new )
576579 event . to_h
577580 end
578581
You can’t perform that action at this time.
0 commit comments