Class: ConvenientService::RSpec::Matchers::Classes::DelegateTo::Entities::SubMatchers::Arguments
- Inherits:
-
SubMatchers::Base
- Object
- SubMatchers::Base
- ConvenientService::RSpec::Matchers::Classes::DelegateTo::Entities::SubMatchers::Arguments
- Defined in:
- lib/convenient_service/rspec/matchers/classes/delegate_to/entities/sub_matchers/arguments.rb,
lib/convenient_service/rspec/matchers/classes/delegate_to/entities/sub_matchers/arguments/commands/generate_printable_arguments.rb,
lib/convenient_service/rspec/matchers/classes/delegate_to/entities/sub_matchers/arguments/commands/apply_stub_to_track_delegations.rb
Defined Under Namespace
Modules: Commands
Instance Method Summary collapse
- #apply_stubs! ⇒ void
- #failure_message ⇒ String
- #failure_message_when_negated ⇒ String
- #matches?(block_expectation_value) ⇒ Boolean
- #printable_actual_arguments ⇒ String
Instance Method Details
#apply_stubs! ⇒ void
This method returns an undefined value.
21 22 23 |
# File 'lib/convenient_service/rspec/matchers/classes/delegate_to/entities/sub_matchers/arguments.rb', line 21 def apply_stubs! Commands::ApplyStubToTrackDelegations.call(matcher: matcher) end |
#failure_message ⇒ String
41 42 43 44 45 46 47 |
# File 'lib/convenient_service/rspec/matchers/classes/delegate_to/entities/sub_matchers/arguments.rb', line 41 def <<~MESSAGE.chomp #{} #{} MESSAGE end |
#failure_message_when_negated ⇒ String
52 53 54 |
# File 'lib/convenient_service/rspec/matchers/classes/delegate_to/entities/sub_matchers/arguments.rb', line 52 def "expected `#{inputs.printable_block_expectation}` NOT to delegate to `#{inputs.printable_method}` #{printable_expected_arguments} at least once, but it did." end |
#matches?(block_expectation_value) ⇒ Boolean
29 30 31 32 33 |
# File 'lib/convenient_service/rspec/matchers/classes/delegate_to/entities/sub_matchers/arguments.rb', line 29 def matches?(block_expectation_value) super outputs.delegations.any? { |delegation| matches_arguments?(delegation.arguments) } end |
#printable_actual_arguments ⇒ String
59 60 61 62 63 64 65 66 |
# File 'lib/convenient_service/rspec/matchers/classes/delegate_to/entities/sub_matchers/arguments.rb', line 59 def printable_actual_arguments return "" if outputs.delegations.none? outputs.delegations .map { |delegation| Commands::GeneratePrintableArguments.call(arguments: delegation.arguments) } .join(", ") .prepend("with ") end |