Class: Less::Expectation
- Inherits:
-
Object
- Object
- Less::Expectation
- Defined in:
- lib/less_interactions/expectation.rb
Instance Attribute Summary collapse
-
#parameter ⇒ Object
readonly
Returns the value of attribute parameter.
Instance Method Summary collapse
- #allows_nil? ⇒ Boolean
-
#initialize(parameter, options = {}) ⇒ Expectation
constructor
A new instance of Expectation.
- #verify(params) ⇒ Object
Constructor Details
#initialize(parameter, options = {}) ⇒ Expectation
Returns a new instance of Expectation.
5 6 7 8 |
# File 'lib/less_interactions/expectation.rb', line 5 def initialize parameter, = {} @parameter = parameter @allow_nil = [:allow_nil] end |
Instance Attribute Details
#parameter ⇒ Object (readonly)
Returns the value of attribute parameter.
4 5 6 |
# File 'lib/less_interactions/expectation.rb', line 4 def parameter @parameter end |
Instance Method Details
#allows_nil? ⇒ Boolean
16 17 18 |
# File 'lib/less_interactions/expectation.rb', line 16 def allows_nil? @allow_nil end |
#verify(params) ⇒ Object
10 11 12 13 14 |
# File 'lib/less_interactions/expectation.rb', line 10 def verify(params) unless verifies_expectations?(params) raise MissingParameterError, "Parameter empty :#{@parameter}" end end |