Class: ConvenientService::RSpec::Matchers::Classes::Results::Base
- Inherits:
-
Object
- Object
- ConvenientService::RSpec::Matchers::Classes::Results::Base
show all
- Includes:
- Support::AbstractMethod
- Defined in:
- lib/convenient_service/rspec/matchers/classes/results/base.rb,
lib/convenient_service/rspec/matchers/classes/results/base/constants.rb,
lib/convenient_service/rspec/matchers/classes/results/base/exceptions.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/chain.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/validator.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/base.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/null.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/error.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/failure.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/success.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/validator/commands/validate_result.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/validator/commands/validate_result_code.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/validator/commands/validate_result_data.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/validator/commands/validate_result_step.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/validator/commands/validate_result_type.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/base/commands/generate_got_parts.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/validator/commands/validate_result_status.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/validator/commands/validate_result_message.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/validator/commands/validate_result_service.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/base/commands/generate_got_step_part.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/base/commands/generate_expected_parts.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/base/commands/generate_got_service_part.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/base/commands/generate_expected_code_part.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/base/commands/generate_expected_data_part.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/base/commands/generate_expected_step_part.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/validator/commands/validate_result_original_service.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/base/commands/generate_expected_status_part.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/base/commands/generate_expected_message_part.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/base/commands/generate_expected_service_part.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/error/commands/generate_got_jsend_attributes_part.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/failure/commands/generate_got_jsend_attributes_part.rb,
lib/convenient_service/rspec/matchers/classes/results/base/entities/printers/success/commands/generate_got_jsend_attributes_part.rb
Defined Under Namespace
Modules: Constants, Entities, Exceptions
Instance Attribute Summary collapse
Instance Method Summary
collapse
abstract_method
Constructor Details
#initialize(statuses: self.statuses, result: nil) ⇒ void
This method is part of a private API.
You should avoid using this method if possible, as it may be removed or be changed in the future.
35
36
37
38
39
|
# File 'lib/convenient_service/rspec/matchers/classes/results/base.rb', line 35
def initialize(statuses: self.statuses, result: nil)
chain.statuses = statuses
@result = result
end
|
Instance Attribute Details
#result ⇒ Object
This method is part of a private API.
You should avoid using this method if possible, as it may be removed or be changed in the future.
21
22
23
|
# File 'lib/convenient_service/rspec/matchers/classes/results/base.rb', line 21
def result
@result
end
|
Instance Method Details
#==(other) ⇒ Boolean?
This method is part of a private API.
You should avoid using this method if possible, as it may be removed or be changed in the future.
279
280
281
282
283
284
285
286
|
# File 'lib/convenient_service/rspec/matchers/classes/results/base.rb', line 279
def ==(other)
return unless other.instance_of?(self.class)
return false if chain != other.chain
return false if result != other.result
true
end
|
#and_code(code) ⇒ String, ...
181
182
183
184
185
|
# File 'lib/convenient_service/rspec/matchers/classes/results/base.rb', line 181
def and_code(code)
chain.code = code
self
end
|
122
123
124
125
126
|
# File 'lib/convenient_service/rspec/matchers/classes/results/base.rb', line 122
def and_data(data)
chain.data = data
self
end
|
157
158
159
160
161
|
# File 'lib/convenient_service/rspec/matchers/classes/results/base.rb', line 157
def and_message(message)
chain.message = message
self
end
|
This method is part of a private API.
You should avoid using this method if possible, as it may be removed or be changed in the future.
251
252
253
|
# File 'lib/convenient_service/rspec/matchers/classes/results/base.rb', line 251
def chain
@chain ||= Entities::Chain.new
end
|
240
241
242
243
244
|
# File 'lib/convenient_service/rspec/matchers/classes/results/base.rb', line 240
def comparing_by(comparison_method)
chain.comparison_method = comparison_method
self
end
|
#description ⇒ String
79
80
81
|
# File 'lib/convenient_service/rspec/matchers/classes/results/base.rb', line 79
def description
printer.description
end
|
#failure_message ⇒ String
88
89
90
|
# File 'lib/convenient_service/rspec/matchers/classes/results/base.rb', line 88
def failure_message
printer.failure_message
end
|
#failure_message_when_negated ⇒ String
100
101
102
|
# File 'lib/convenient_service/rspec/matchers/classes/results/base.rb', line 100
def failure_message_when_negated
printer.failure_message_when_negated
end
|
#matches?(result) ⇒ Boolean
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
# File 'lib/convenient_service/rspec/matchers/classes/results/base.rb', line 47
def matches?(result)
@result = result
result.class.commit_config!(trigger: Constants::Triggers::BE_RESULT) if result.class.respond_to?(:commit_config!)
validator.valid_result?
end
|
205
206
207
208
209
|
# File 'lib/convenient_service/rspec/matchers/classes/results/base.rb', line 205
def of_original_service(service)
chain.original_service = service
self
end
|
193
194
195
196
197
|
# File 'lib/convenient_service/rspec/matchers/classes/results/base.rb', line 193
def of_service(service)
chain.service = service
self
end
|
217
218
219
220
221
|
# File 'lib/convenient_service/rspec/matchers/classes/results/base.rb', line 217
def of_step(step)
chain.step = step
self
end
|
This method is part of a private API.
You should avoid using this method if possible, as it may be removed or be changed in the future.
260
261
262
|
# File 'lib/convenient_service/rspec/matchers/classes/results/base.rb', line 260
def printer
@printer ||= Entities::Printers.create(matcher: self)
end
|
#statuses ⇒ String, Symbol
This method is part of a private API.
You should avoid using this method if possible, as it may be removed or be changed in the future.
28
|
# File 'lib/convenient_service/rspec/matchers/classes/results/base.rb', line 28
abstract_method :statuses
|
This method is part of a private API.
You should avoid using this method if possible, as it may be removed or be changed in the future.
269
270
271
|
# File 'lib/convenient_service/rspec/matchers/classes/results/base.rb', line 269
def validator
@validator ||= Entities::Validator.new(matcher: self)
end
|
#with_code(code) ⇒ String, ...
169
170
171
172
173
|
# File 'lib/convenient_service/rspec/matchers/classes/results/base.rb', line 169
def with_code(code)
chain.code = code
self
end
|
110
111
112
113
114
|
# File 'lib/convenient_service/rspec/matchers/classes/results/base.rb', line 110
def with_data(data)
chain.data = data
self
end
|
145
146
147
148
149
|
# File 'lib/convenient_service/rspec/matchers/classes/results/base.rb', line 145
def with_message(message)
chain.message = message
self
end
|
133
134
135
136
137
|
# File 'lib/convenient_service/rspec/matchers/classes/results/base.rb', line 133
def without_data
chain.data = {}
self
end
|
228
229
230
231
232
|
# File 'lib/convenient_service/rspec/matchers/classes/results/base.rb', line 228
def without_step
chain.step = nil
self
end
|