Module: Beacon::Testing
- Defined in:
- lib/beacon/testing.rb
Defined Under Namespace
Classes: FakeTransport, NullSink
Class Method Summary collapse
-
.reset_client! ⇒ Object
Alias for Beacon.shutdown, kept as a separate name because ‘reset_client!` reads correctly at call sites that are logically “replace the client without changing config” — Beacon.shutdown at those sites would be semantically correct but misleading (it sounds like tearing down the whole gem).
-
.reset_config! ⇒ Object
Drop the memoized Configuration and any associated Client.
Class Method Details
.reset_client! ⇒ Object
Alias for Beacon.shutdown, kept as a separate name because ‘reset_client!` reads correctly at call sites that are logically “replace the client without changing config” —Beacon.shutdown at those sites would be semantically correct but misleading (it sounds like tearing down the whole gem).
93 94 95 |
# File 'lib/beacon/testing.rb', line 93 def self.reset_client! Beacon.shutdown end |
.reset_config! ⇒ Object
Drop the memoized Configuration and any associated Client. Use in test setup so each test gets a fresh Configuration.
Reaches into Beacon’s internals via instance_variable_set because we deliberately removed ‘Beacon.reset_config!` from the production surface (Card 10) — test-only machinery should not live on the main module. If you’re tempted to “clean this up” by adding ‘reset_config!` back to Beacon, read the pitch first.
83 84 85 86 |
# File 'lib/beacon/testing.rb', line 83 def self.reset_config! Beacon.shutdown Beacon.instance_variable_set(:@config, nil) end |