Module: AeEasy::Core::Plugin::ContextIntegrator
- Included in:
- ConfigBehavior, ExecutorBehavior
- Defined in:
- lib/ae_easy/core/plugin/context_integrator.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Last mocked ontext object.
Instance Method Summary collapse
-
#initialize_hook_core_context_integrator(opts = [{}]) ⇒ Object
Hook to mock context on initialize.
-
#mock_context(origin) ⇒ Object
Mock a context methods into self.
Instance Attribute Details
#context ⇒ Object (readonly)
Last mocked ontext object.
6 7 8 |
# File 'lib/ae_easy/core/plugin/context_integrator.rb', line 6 def context @context end |
Instance Method Details
#initialize_hook_core_context_integrator(opts = [{}]) ⇒ Object
Hook to mock context on initialize.
53 54 55 56 |
# File 'lib/ae_easy/core/plugin/context_integrator.rb', line 53 def initialize_hook_core_context_integrator opts = [{}] raise ':context object is required.' if opts[:context].nil? mock_context opts[:context] end |
#mock_context(origin) ⇒ Object
Mock a context methods into self.
44 45 46 47 |
# File 'lib/ae_easy/core/plugin/context_integrator.rb', line 44 def mock_context origin @context = origin AeEasy::Core.mock_instance_methods context, self end |