Module: BrainzLab::Testing
- Defined in:
- lib/brainzlab/testing.rb,
lib/brainzlab/testing/helpers.rb,
lib/brainzlab/testing/matchers.rb,
lib/brainzlab/testing/event_store.rb
Overview
Testing utilities for BrainzLab SDK
Provides helpers for stubbing SDK calls, capturing events, and custom matchers for RSpec/Minitest.
Defined Under Namespace
Modules: Helpers, Matchers Classes: AlertExpectation, ErrorExpectation, EventExpectation, EventStore, LogExpectation, MetricExpectation, TraceExpectation
Class Method Summary collapse
-
.disable! ⇒ Object
Disable testing mode.
-
.enable! ⇒ Object
Enable testing mode (stubs all SDK calls).
-
.enabled? ⇒ Boolean
Check if testing mode is active.
-
.event_store ⇒ Object
Global event store for capturing events during tests.
-
.reset! ⇒ Object
Reset the event store (called between tests).
Class Method Details
.disable! ⇒ Object
Disable testing mode
55 56 57 58 59 60 |
# File 'lib/brainzlab/testing.rb', line 55 def disable! return unless @enabled @enabled = false remove_stubs! end |
.enable! ⇒ Object
Enable testing mode (stubs all SDK calls)
47 48 49 50 51 52 |
# File 'lib/brainzlab/testing.rb', line 47 def enable! return if @enabled @enabled = true install_stubs! end |
.enabled? ⇒ Boolean
Check if testing mode is active
42 43 44 |
# File 'lib/brainzlab/testing.rb', line 42 def enabled? @enabled == true end |
.event_store ⇒ Object
Global event store for capturing events during tests
32 33 34 |
# File 'lib/brainzlab/testing.rb', line 32 def event_store @event_store ||= EventStore.new end |
.reset! ⇒ Object
Reset the event store (called between tests)
37 38 39 |
# File 'lib/brainzlab/testing.rb', line 37 def reset! @event_store = EventStore.new end |