Class: CabezaDeTermo::JsonSpec::ExpectationReport

Inherits:
Object
  • Object
show all
Defined in:
lib/cabeza-de-termo/json-spec/walkers/reporter/expectation-report.rb

Instance Method Summary collapse

Constructor Details

#initializeExpectationReport

Returns a new instance of ExpectationReport.



4
5
6
7
8
9
10
# File 'lib/cabeza-de-termo/json-spec/walkers/reporter/expectation-report.rb', line 4

def initialize()
	super()

	@expectation_method = nil
	@failed_message = nil
	@status = nil
end

Instance Method Details

#expectation_methodObject



18
19
20
# File 'lib/cabeza-de-termo/json-spec/walkers/reporter/expectation-report.rb', line 18

def expectation_method()
	@expectation_method
end

#failed?Boolean

Returns:

  • (Boolean)


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

def failed?()
	status == :failed
end

#failed_messageObject



28
29
30
# File 'lib/cabeza-de-termo/json-spec/walkers/reporter/expectation-report.rb', line 28

def failed_message()
	@failed_message
end

#set_expectation_method(expectation_method) ⇒ Object



12
13
14
15
16
# File 'lib/cabeza-de-termo/json-spec/walkers/reporter/expectation-report.rb', line 12

def set_expectation_method(expectation_method)
	@expectation_method = expectation_method

	self
end

#set_failed_message(failed_message) ⇒ Object



22
23
24
25
26
# File 'lib/cabeza-de-termo/json-spec/walkers/reporter/expectation-report.rb', line 22

def set_failed_message(failed_message)
	@failed_message = failed_message

	self
end

#set_status(status) ⇒ Object



32
33
34
35
36
# File 'lib/cabeza-de-termo/json-spec/walkers/reporter/expectation-report.rb', line 32

def set_status(status)
	@status = status

	self
end

#set_was_satisfied(was_satisfied) ⇒ Object



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

def set_was_satisfied(was_satisfied)
	set_status(was_satisfied ? :was_satisfied : :failed)
end

#statusObject



38
39
40
# File 'lib/cabeza-de-termo/json-spec/walkers/reporter/expectation-report.rb', line 38

def status()
	@status
end

#to_arrayObject



54
55
56
57
58
59
60
# File 'lib/cabeza-de-termo/json-spec/walkers/reporter/expectation-report.rb', line 54

def to_array()
	[
		expectation_method,
		status,
		failed_message
	]
end

#was_satisfied?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/cabeza-de-termo/json-spec/walkers/reporter/expectation-report.rb', line 50

def was_satisfied?()
	status == :was_satisfied
end