Class: RSpec::Tabular::Wrapped
- Inherits:
-
Object
- Object
- RSpec::Tabular::Wrapped
- Defined in:
- lib/rspec/tabular/wrapped.rb
Overview
This class is a wrapper around a proc that will indicate to tabular that the provided proc should be run against a spec’s context such that variables defined with let and helper methods like instance_double are available.
This class should not be called directly. Instead use the helper function ‘with_context`
Instance Attribute Summary collapse
-
#proc ⇒ Object
readonly
Returns the value of attribute proc.
Instance Method Summary collapse
-
#initialize(proc, pretty_val = nil) ⇒ Wrapped
constructor
A new instance of Wrapped.
- #to_s ⇒ Object (also: #inspect)
Constructor Details
#initialize(proc, pretty_val = nil) ⇒ Wrapped
Returns a new instance of Wrapped.
13 14 15 16 |
# File 'lib/rspec/tabular/wrapped.rb', line 13 def initialize(proc, pretty_val = nil) @proc = proc @pretty_val = pretty_val end |
Instance Attribute Details
#proc ⇒ Object (readonly)
Returns the value of attribute proc.
18 19 20 |
# File 'lib/rspec/tabular/wrapped.rb', line 18 def proc @proc end |
Instance Method Details
#to_s ⇒ Object Also known as: inspect
20 21 22 |
# File 'lib/rspec/tabular/wrapped.rb', line 20 def to_s @pretty_val || 'wrapped_value' end |