Module: Mana::TestHelpers
- Defined in:
- lib/mana/mock.rb
Overview
RSpec helper — include in your test suite for automatic mock setup. RSpec.configure { |c| c.include Mana::TestHelpers }
Class Method Summary collapse
-
.included(base) ⇒ Object
Auto-enable mock mode before each test, disable after.
Instance Method Summary collapse
-
#mock_prompt(pattern, **values, &block) ⇒ Object
Convenience method to register a stub within the current mock context.
Class Method Details
Instance Method Details
#mock_prompt(pattern, **values, &block) ⇒ Object
Convenience method to register a stub within the current mock context
87 88 89 90 91 |
# File 'lib/mana/mock.rb', line 87 def mock_prompt(pattern, **values, &block) raise Mana::MockError, "Mana mock mode not active. Call Mana.mock! first" unless Mana.mock_active? Mana.current_mock.prompt(pattern, **values, &block) end |