Module: ActiveDryDeps::StubDeps
- Defined in:
- lib/active_dry_deps/stub.rb
Instance Method Summary collapse
- #global_stub(key, value) ⇒ Object
- #global_unstub(*keys) ⇒ Object
- #reset ⇒ Object
- #stub(key, value) ⇒ Object
- #unstub(*keys) ⇒ Object
Instance Method Details
#global_stub(key, value) ⇒ Object
17 18 19 20 |
# File 'lib/active_dry_deps/stub.rb', line 17 def global_stub(key, value) ORIGINAL_WITH_GLOBAL[key] = value self::CONTAINER.stub(key, value) end |
#global_unstub(*keys) ⇒ Object
22 23 24 |
# File 'lib/active_dry_deps/stub.rb', line 22 def global_unstub(*keys) self::CONTAINER.unstub(*keys, container: ORIGINAL) end |
#reset ⇒ Object
13 14 15 |
# File 'lib/active_dry_deps/stub.rb', line 13 def reset self::CONTAINER.reset(ORIGINAL_WITH_GLOBAL) end |
#stub(key, value) ⇒ Object
5 6 7 |
# File 'lib/active_dry_deps/stub.rb', line 5 def stub(key, value) self::CONTAINER.stub(key, value) end |
#unstub(*keys) ⇒ Object
9 10 11 |
# File 'lib/active_dry_deps/stub.rb', line 9 def unstub(*keys) self::CONTAINER.unstub(*keys, container: ORIGINAL_WITH_GLOBAL) end |