Class: RSpecOutlines::Outline
- Inherits:
-
Object
- Object
- RSpecOutlines::Outline
- Defined in:
- lib/rspec_outlines.rb
Instance Attribute Summary collapse
-
#definition ⇒ Object
readonly
Returns the value of attribute definition.
-
#example_group ⇒ Object
readonly
Returns the value of attribute example_group.
-
#fields ⇒ Object
Returns the value of attribute fields.
Instance Method Summary collapse
- #eval(*values) ⇒ Object
-
#initialize(example_group, &definition) ⇒ Outline
constructor
A new instance of Outline.
Constructor Details
#initialize(example_group, &definition) ⇒ Outline
Returns a new instance of Outline.
91 92 93 94 95 |
# File 'lib/rspec_outlines.rb', line 91 def initialize(example_group, &definition) @example_group = example_group @definition = definition @fields = nil end |
Instance Attribute Details
#definition ⇒ Object (readonly)
Returns the value of attribute definition.
97 98 99 |
# File 'lib/rspec_outlines.rb', line 97 def definition @definition end |
#example_group ⇒ Object (readonly)
Returns the value of attribute example_group.
97 98 99 |
# File 'lib/rspec_outlines.rb', line 97 def example_group @example_group end |
#fields ⇒ Object
Returns the value of attribute fields.
97 98 99 |
# File 'lib/rspec_outlines.rb', line 97 def fields @fields end |
Instance Method Details
#eval(*values) ⇒ Object
103 104 105 106 107 108 |
# File 'lib/rspec_outlines.rb', line 103 def eval(*values) fields or raise Error, "no fields defined" outline_binding = OutlineBinding.new(fields, values) example_group.instance_eval_with_outline_binding(outline_binding, &definition) end |