Method: XSpec::Context.create_shared_context
- Defined in:
- lib/xspec/data_structures.rb
.create_shared_context(&block) ⇒ Object
A shared context is a floating context that isn’t part of any context heirachy, so its units of work will not be visible to the root node. It can be brought into any point in the heirachy using ‘copy_into_tree` (aliased as `include_context` in the DSL), and this can be done multiple times, which allows definitions to be reused.
This is leaky abstraction, since only units of work are copied from shared contexts. Methods and child contexts are ignored.
93 94 95 |
# File 'lib/xspec/data_structures.rb', line 93 def create_shared_context(&block) make(nil, evaluator, &block) end |