Class: CabezaDeTermo::JsonSpec::Expectation

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

Instance Method Summary collapse

Methods inherited from AbstractExpectation

#is_satisfied_by?

Instance Method Details

#accept_walker(expression_walker) ⇒ Object

Walking



36
37
38
# File 'lib/cabeza-de-termo/json-spec/expectations/expectation.rb', line 36

def accept_walker(expression_walker)
	expression_walker.walk_expectation(self)
end

#expectation_methodObject



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

def expectation_method()
	@expectation_method
end

#explainObject

Explaining



42
43
44
# File 'lib/cabeza-de-termo/json-spec/expectations/expectation.rb', line 42

def explain()
	expectation_method.to_s + explain_parameters
end

#explain_parametersObject



46
47
48
# File 'lib/cabeza-de-termo/json-spec/expectations/expectation.rb', line 46

def explain_parameters()
	'()'
end

#failed_message_blockObject



30
31
32
# File 'lib/cabeza-de-termo/json-spec/expectations/expectation.rb', line 30

def failed_message_block()
	json_spec.message_formatter_for(expectation_method)
end

#failed_message_on(value_holder) ⇒ Object

Message format



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

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

#json_specObject



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

def json_spec()
	@json_spec
end

#set_expectation_method(expectation_method) ⇒ Object



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

def set_expectation_method(expectation_method)
	@expectation_method = expectation_method
end

#set_json_spec(json_spec) ⇒ Object

Accessing



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

def set_json_spec(json_spec)
	@json_spec = json_spec
end