Method: Sentry::TestHelper#teardown_sentry_test
- Defined in:
- lib/sentry/test_helper.rb
permalink #teardown_sentry_test ⇒ void
This method returns an undefined value.
Clears all stored events and envelopes. It should be called after every test case.
46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/sentry/test_helper.rb', line 46 def teardown_sentry_test return unless Sentry.initialized? # pop testing layer created by `setup_sentry_test` # but keep the base layer to avoid nil-pointer errors # TODO: find a way to notify users if they somehow popped the test layer before calling this method if Sentry.get_current_hub.instance_variable_get(:@stack).size > 1 Sentry.get_current_hub.pop_scope end Sentry::Scope.global_event_processors.clear end |