Class: CabezaDeTermo::JsonSpec::BlockExpectation
- Inherits:
-
Expectation
- Object
- AbstractExpectation
- Expectation
- CabezaDeTermo::JsonSpec::BlockExpectation
- Defined in:
- lib/cabeza-de-termo/json-spec/expectations/block-expectation.rb
Instance Method Summary collapse
- #args ⇒ Object
-
#explain_parameters ⇒ Object
Explaining.
-
#initialize(block, *args) ⇒ BlockExpectation
constructor
A new instance of BlockExpectation.
- #is_satisfied_by?(value_holder) ⇒ Boolean
Methods inherited from Expectation
#accept_walker, #expectation_method, #explain, #failed_message_block, #failed_message_on, #json_spec, #set_expectation_method, #set_json_spec
Methods inherited from AbstractExpectation
#accept_walker, #explain, #failed_message_on, #set_expectation_method, #set_json_spec
Constructor Details
#initialize(block, *args) ⇒ BlockExpectation
Returns a new instance of BlockExpectation.
6 7 8 9 10 11 |
# File 'lib/cabeza-de-termo/json-spec/expectations/block-expectation.rb', line 6 def initialize(block , *args) super() @block = block @args = args end |
Instance Method Details
#args ⇒ Object
13 14 15 |
# File 'lib/cabeza-de-termo/json-spec/expectations/block-expectation.rb', line 13 def args @args end |
#explain_parameters ⇒ Object
Explaining
23 24 25 |
# File 'lib/cabeza-de-termo/json-spec/expectations/block-expectation.rb', line 23 def explain_parameters() '(' + args.join(', ') + ')' end |
#is_satisfied_by?(value_holder) ⇒ Boolean
17 18 19 |
# File 'lib/cabeza-de-termo/json-spec/expectations/block-expectation.rb', line 17 def is_satisfied_by?(value_holder) @block.call(value_holder, *args) end |