This file is indexed.

/usr/lib/ruby/vendor_ruby/rspec/mocks/any_instance/error_generator.rb is in ruby-rspec-mocks 3.5.0c3e0m0s0-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
module RSpec
  module Mocks
    module AnyInstance
      # @private
      class ErrorGenerator < ::RSpec::Mocks::ErrorGenerator
        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

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

        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

        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
      end

      def self.error_generator
        @error_generator ||= ErrorGenerator.new
      end
    end
  end
end