Class: RailsMocks::SharedContext
- Inherits:
-
Object
- Object
- RailsMocks::SharedContext
- Defined in:
- lib/rails_mocks/shared_context.rb
Instance Method Summary collapse
- #execute(scope) ⇒ Object
-
#initialize(context_name) ⇒ SharedContext
constructor
A new instance of SharedContext.
Constructor Details
#initialize(context_name) ⇒ SharedContext
Returns a new instance of SharedContext.
6 7 8 |
# File 'lib/rails_mocks/shared_context.rb', line 6 def initialize(context_name) @context_name = context_name end |
Instance Method Details
#execute(scope) ⇒ Object
10 11 12 13 |
# File 'lib/rails_mocks/shared_context.rb', line 10 def execute(scope) scope.instance_exec(&context_definition) scope.hooks.send(:run_owned_hooks_for, :before, :example, scope) end |