Class: RSpec::Mocks::AnyInstance::ErrorGenerator

Inherits:
ErrorGenerator show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-mocks-3.12.2/lib/rspec/mocks/any_instance/error_generator.rb

Instance Attribute Summary

Attributes inherited from ErrorGenerator

#opts

Instance Method Summary collapse

Methods inherited from ErrorGenerator

#default_error_message, #describe_expectation, #expectation_on_nil_message, #initialize, #intro, #method_call_args_description, #raise_already_invoked_error, #raise_cant_constrain_count_for_negated_have_received_error, #raise_double_negation_error, #raise_expectation_error, #raise_expectation_on_mocked_method, #raise_expectation_on_nil_error, #raise_expectation_on_unstubbed_method, #raise_expired_test_double_error, #raise_have_received_disallowed, #raise_invalid_arguments_error, #raise_method_not_stubbed_error, #raise_missing_block_error, #raise_missing_default_stub_error, #raise_non_public_error, #raise_only_valid_on_a_partial_double, #raise_out_of_order_error, #raise_similar_message_args_error, #raise_unexpected_message_args_error, #raise_unexpected_message_error, #raise_unimplemented_error, #raise_verifying_double_not_defined_error, #raise_wrong_arity_error

Constructor Details

This class inherits a constructor from RSpec::Mocks::ErrorGenerator

Instance Method Details

#raise_does_not_implement_error(klass, method_name) ⇒ Object



11
12
13
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-mocks-3.12.2/lib/rspec/mocks/any_instance/error_generator.rb', line 11

def raise_does_not_implement_error(klass, method_name)
  __raise "#{klass} does not implement ##{method_name}"
end

#raise_message_already_received_by_other_instance_error(method_name, object_inspect, invoked_instance) ⇒ Object



15
16
17
18
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-mocks-3.12.2/lib/rspec/mocks/any_instance/error_generator.rb', line 15

def raise_message_already_received_by_other_instance_error(method_name, object_inspect, invoked_instance)
  __raise "The message '#{method_name}' was received by #{object_inspect} " \
          "but has already been received by #{invoked_instance}"
end

#raise_not_supported_with_prepend_error(method_name, problem_mod) ⇒ Object



20
21
22
23
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-mocks-3.12.2/lib/rspec/mocks/any_instance/error_generator.rb', line 20

def raise_not_supported_with_prepend_error(method_name, problem_mod)
  __raise "Using `any_instance` to stub a method (#{method_name}) that has been " \
          "defined on a prepended module (#{problem_mod}) is not supported."
end

#raise_second_instance_received_message_error(unfulfilled_expectations) ⇒ Object



6
7
8
9
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-mocks-3.12.2/lib/rspec/mocks/any_instance/error_generator.rb', line 6

def raise_second_instance_received_message_error(unfulfilled_expectations)
  __raise "Exactly one instance should have received the following " \
          "message(s) but didn't: #{unfulfilled_expectations.sort.join(', ')}"
end