Skip to content

Commit

Permalink
Avoid double cleanup in teardown_sentry_test tests
Browse files Browse the repository at this point in the history
  • Loading branch information
st0012 committed Sep 24, 2023
1 parent 84c5eac commit 0967062
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions sentry-ruby/spec/sentry/test_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
expect(Sentry.get_current_client.transport).to be_a(Sentry::HTTPTransport)
end

after do
teardown_sentry_test
end

describe "#setup_sentry_test" do
after do
teardown_sentry_test
end

it "raises error when the SDK is not initialized" do
allow(Sentry).to receive(:initialized?).and_return(false)

Expand Down Expand Up @@ -51,6 +51,10 @@
setup_sentry_test
end

after do
teardown_sentry_test
end

it "returns the last sent event" do
Sentry.capture_message("foobar")
Sentry.capture_message("barbaz")
Expand All @@ -66,6 +70,10 @@
setup_sentry_test
end

after do
teardown_sentry_test
end

it "extracts exceptions from an ErrorEvent" do
event = Sentry.get_current_client.event_from_exception(Exception.new("foobar"))

Expand Down

0 comments on commit 0967062

Please sign in to comment.