Class: CabezaDeTermo::JsonSpec::NegatedExpectation

Inherits:
Expectation show all
Defined in:
lib/cabeza-de-termo/json-spec/expectations/negated-expectation.rb

Instance Method Summary collapse

Methods inherited from Expectation

#accept_walker, #expectation_method, #explain_parameters, #failed_message_block, #json_spec, #set_expectation_method, #set_json_spec

Methods inherited from AbstractExpectation

#accept_walker, #set_expectation_method, #set_json_spec

Constructor Details

#initialize(expectation) ⇒ NegatedExpectation

Returns a new instance of NegatedExpectation.



6
7
8
9
10
# File 'lib/cabeza-de-termo/json-spec/expectations/negated-expectation.rb', line 6

def initialize(expectation)
	super()

	@negated_expectation = expectation
end

Instance Method Details

#explainObject

Explaining



26
27
28
# File 'lib/cabeza-de-termo/json-spec/expectations/negated-expectation.rb', line 26

def explain()
	expectation_method.to_s + negated_expectation.explain_parameters
end

#failed_message_on(value_holder) ⇒ Object



20
21
22
# File 'lib/cabeza-de-termo/json-spec/expectations/negated-expectation.rb', line 20

def failed_message_on(value_holder)
	failed_message_block.message_on(negated_expectation, value_holder)
end

#is_satisfied_by?(value_holder) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/cabeza-de-termo/json-spec/expectations/negated-expectation.rb', line 16

def is_satisfied_by?(value_holder)
	!negated_expectation.is_satisfied_by?(value_holder)
end

#negated_expectationObject



12
13
14
# File 'lib/cabeza-de-termo/json-spec/expectations/negated-expectation.rb', line 12

def negated_expectation()
	@negated_expectation
end