Class: ConvenientService::RSpec::PrimitiveMatchers::Classes::DelegateTo
- Inherits:
-
Object
- Object
- ConvenientService::RSpec::PrimitiveMatchers::Classes::DelegateTo
show all
- Defined in:
- lib/convenient_service/rspec/primitive_matchers/classes/delegate_to.rb,
lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/exceptions.rb,
lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/inputs.rb,
lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/outputs.rb,
lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/delegation.rb,
lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matchers/base.rb,
lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matcher_collection.rb,
lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matchers/arguments.rb,
lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/commands/generate_printable_method.rb,
lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matchers/without_arguments.rb,
lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matchers/with_any_arguments.rb,
lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matchers/return_custom_value.rb,
lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matchers/return_delegation_value.rb,
lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matchers/with_concrete_arguments.rb,
lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matchers/arguments/commands/generate_printable_arguments.rb,
lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/sub_matchers/arguments/commands/apply_stub_to_track_delegations.rb
Defined Under Namespace
Modules: Commands, Entities, Exceptions
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(object, method, block_expectation = proc { Support::UNDEFINED }) ⇒ 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.
71
72
73
74
|
# File 'lib/convenient_service/rspec/primitive_matchers/classes/delegate_to.rb', line 71
def initialize(object, method, block_expectation = proc { Support::UNDEFINED })
@inputs = Entities::Inputs.new(object: object, method: method, block_expectation: block_expectation)
@outputs = Entities::Outputs.new
end
|
Instance Attribute Details
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.
47
48
49
|
# File 'lib/convenient_service/rspec/primitive_matchers/classes/delegate_to.rb', line 47
def inputs
@inputs
end
|
#outputs ⇒ 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.
55
56
57
|
# File 'lib/convenient_service/rspec/primitive_matchers/classes/delegate_to.rb', line 55
def outputs
@outputs
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.
251
252
253
254
255
256
257
258
|
# File 'lib/convenient_service/rspec/primitive_matchers/classes/delegate_to.rb', line 251
def ==(other)
return unless other.instance_of?(self.class)
return false if inputs != other.inputs
return false if outputs != other.outputs
true
end
|
#description ⇒ String
116
117
118
|
# File 'lib/convenient_service/rspec/primitive_matchers/classes/delegate_to.rb', line 116
def description
"delegate to `#{inputs.printable_method}`"
end
|
#does_not_match?(block_expectation) ⇒ Boolean
94
95
96
97
98
|
# File 'lib/convenient_service/rspec/primitive_matchers/classes/delegate_to.rb', line 94
def does_not_match?(block_expectation)
inputs.block_expectation = block_expectation
!sub_matchers.matches?(inputs.block_expectation)
end
|
#failure_message ⇒ String
125
126
127
|
# File 'lib/convenient_service/rspec/primitive_matchers/classes/delegate_to.rb', line 125
def failure_message
sub_matchers.failure_message
end
|
#failure_message_when_negated ⇒ String
134
135
136
|
# File 'lib/convenient_service/rspec/primitive_matchers/classes/delegate_to.rb', line 134
def failure_message_when_negated
sub_matchers.failure_message_when_negated
end
|
#matches?(block_expectation) ⇒ Boolean
82
83
84
85
86
|
# File 'lib/convenient_service/rspec/primitive_matchers/classes/delegate_to.rb', line 82
def matches?(block_expectation)
inputs.block_expectation = block_expectation
sub_matchers.matches?(inputs.block_expectation)
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.
241
242
243
|
# File 'lib/convenient_service/rspec/primitive_matchers/classes/delegate_to.rb', line 241
def sub_matchers
@sub_matchers ||= Entities::SubMatcherCollection.new(matcher: self)
end
|
#supports_block_expectations? ⇒ Boolean
107
108
109
|
# File 'lib/convenient_service/rspec/primitive_matchers/classes/delegate_to.rb', line 107
def supports_block_expectations?
true
end
|