Sha256: 062c525ab0a755ecc6610cbf17e3a7e7ff7c4dbcf7e33f694b67d1e6c4c4957f

Contents?: true

Size: 1.26 KB

Versions: 6948

Compression:

Stored size: 1.26 KB

Contents

module RSpec
  module Mocks
    module AnyInstance
      # @private
      class ExpectationChain < Chain
        def expectation_fulfilled?
          @expectation_fulfilled || constrained_to_any_of?(:never)
        end

        def initialize(*args, &block)
          @expectation_fulfilled = false
          super
        end

      private

        def verify_invocation_order(_rspec_method_name, *_args, &_block)
        end
      end

      # @private
      class PositiveExpectationChain < ExpectationChain
      private

        def create_message_expectation_on(instance)
          proxy = ::RSpec::Mocks.space.proxy_for(instance)
          method_name, opts = @expectation_args
          opts = (opts || {}).merge(:expected_form => IGNORED_BACKTRACE_LINE)

          me = proxy.add_message_expectation(method_name, opts, &@expectation_block)
          if RSpec::Mocks.configuration.yield_receiver_to_any_instance_implementation_blocks?
            me.and_yield_receiver_to_implementation
          end

          me
        end

        ExpectationInvocationOrder =
          {
            :and_return => [:with, nil],
            :and_raise => [:with, nil],
          }.freeze

        def invocation_order
          ExpectationInvocationOrder
        end
      end
    end
  end
end

Version data entries

6,948 entries across 6,873 versions & 100 rubygems

Version Path
cybrid_api_organization_ruby-0.122.48 vendor/bundle/ruby/3.3.0/gems/rspec-mocks-3.13.2/lib/rspec/mocks/any_instance/expectation_chain.rb
cybrid_api_bank_ruby-0.122.47 vendor/bundle/ruby/3.3.0/gems/rspec-mocks-3.13.2/lib/rspec/mocks/any_instance/expectation_chain.rb
cybrid_api_id_ruby-0.122.47 vendor/bundle/ruby/3.3.0/gems/rspec-mocks-3.13.2/lib/rspec/mocks/any_instance/expectation_chain.rb
cybrid_api_organization_ruby-0.122.47 vendor/bundle/ruby/3.3.0/gems/rspec-mocks-3.13.2/lib/rspec/mocks/any_instance/expectation_chain.rb
cybrid_api_id_ruby-0.122.46 vendor/bundle/ruby/3.3.0/gems/rspec-mocks-3.13.2/lib/rspec/mocks/any_instance/expectation_chain.rb
cybrid_api_bank_ruby-0.122.46 vendor/bundle/ruby/3.3.0/gems/rspec-mocks-3.13.2/lib/rspec/mocks/any_instance/expectation_chain.rb
cybrid_api_organization_ruby-0.122.46 vendor/bundle/ruby/3.3.0/gems/rspec-mocks-3.13.2/lib/rspec/mocks/any_instance/expectation_chain.rb
cybrid_api_organization_ruby-0.122.45 vendor/bundle/ruby/3.3.0/gems/rspec-mocks-3.13.2/lib/rspec/mocks/any_instance/expectation_chain.rb
cybrid_api_id_ruby-0.122.45 vendor/bundle/ruby/3.3.0/gems/rspec-mocks-3.13.2/lib/rspec/mocks/any_instance/expectation_chain.rb
cybrid_api_bank_ruby-0.122.45 vendor/bundle/ruby/3.3.0/gems/rspec-mocks-3.13.2/lib/rspec/mocks/any_instance/expectation_chain.rb
cybrid_api_bank_ruby-0.122.44 vendor/bundle/ruby/3.3.0/gems/rspec-mocks-3.13.2/lib/rspec/mocks/any_instance/expectation_chain.rb
cybrid_api_id_ruby-0.122.44 vendor/bundle/ruby/3.3.0/gems/rspec-mocks-3.13.2/lib/rspec/mocks/any_instance/expectation_chain.rb
cybrid_api_organization_ruby-0.122.44 vendor/bundle/ruby/3.3.0/gems/rspec-mocks-3.13.2/lib/rspec/mocks/any_instance/expectation_chain.rb
cybrid_api_bank_ruby-0.122.43 vendor/bundle/ruby/3.3.0/gems/rspec-mocks-3.13.2/lib/rspec/mocks/any_instance/expectation_chain.rb
cybrid_api_organization_ruby-0.122.43 vendor/bundle/ruby/3.3.0/gems/rspec-mocks-3.13.2/lib/rspec/mocks/any_instance/expectation_chain.rb
cybrid_api_id_ruby-0.122.43 vendor/bundle/ruby/3.3.0/gems/rspec-mocks-3.13.2/lib/rspec/mocks/any_instance/expectation_chain.rb
cybrid_api_bank_ruby-0.122.42 vendor/bundle/ruby/3.3.0/gems/rspec-mocks-3.13.2/lib/rspec/mocks/any_instance/expectation_chain.rb
cybrid_api_id_ruby-0.122.42 vendor/bundle/ruby/3.3.0/gems/rspec-mocks-3.13.2/lib/rspec/mocks/any_instance/expectation_chain.rb
cybrid_api_organization_ruby-0.122.42 vendor/bundle/ruby/3.3.0/gems/rspec-mocks-3.13.2/lib/rspec/mocks/any_instance/expectation_chain.rb
ory-client-1.15.10 vendor/bundle/ruby/3.1.0/gems/rspec-mocks-3.13.2/lib/rspec/mocks/any_instance/expectation_chain.rb