Sha256: 096cd96541532f2d137d94904fb43145f1a0c82c67edc5eb6410cef8245eab0b

Contents?: true

Size: 1.23 KB

Versions: 150

Compression:

Stored size: 1.23 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

        def invocation_order
          @invocation_order ||= {
            :with => [nil],
            :and_return => [:with, nil],
            :and_raise => [:with, nil]
          }
        end
      end
    end
  end
end

Version data entries

150 entries across 137 versions & 36 rubygems

Version Path
suzuko-0.1.7 vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.2.1/lib/rspec/mocks/any_instance/expectation_chain.rb
opal-rspec-0.5.0.beta3 rspec-mocks/lib/rspec/mocks/any_instance/expectation_chain.rb
logstash-input-beats-0.9.2 vendor/jruby/1.9/gems/rspec-mocks-3.1.3/lib/rspec/mocks/any_instance/expectation_chain.rb
logstash-input-beats-0.9.1 vendor/jruby/1.9/gems/rspec-mocks-3.1.3/lib/rspec/mocks/any_instance/expectation_chain.rb
mastermind_adeybee-0.1.4 vendor/bundle/ruby/2.2.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/expectation_chain.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/expectation_chain.rb
mastermind_adeybee-0.1.3 vendor/bundle/ruby/2.2.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/expectation_chain.rb
mastermind_adeybee-0.1.2 vendor/bundle/ruby/2.2.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/expectation_chain.rb
mastermind_adeybee-0.1.1 vendor/bundle/ruby/2.2.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/expectation_chain.rb
sublimetheme-1.0.1 path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/expectation_chain.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/expectation_chain.rb
sublimetheme-1.0.0 path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/expectation_chain.rb
opal-rspec-0.5.0.beta2 rspec-mocks/lib/rspec/mocks/any_instance/expectation_chain.rb
opal-rspec-0.5.0.beta1 rspec-mocks/lib/rspec/mocks/any_instance/expectation_chain.rb
geminfo-0.1.0 path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/expectation_chain.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/rspec-mocks-3.3.1/lib/rspec/mocks/any_instance/expectation_chain.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/rspec-mocks-3.3.1/lib/rspec/mocks/any_instance/expectation_chain.rb
scoot-0.0.4 .bundle/gems/ruby/2.2.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/expectation_chain.rb
rspec-mocks-3.3.2 lib/rspec/mocks/any_instance/expectation_chain.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/rspec-mocks-3.3.1/lib/rspec/mocks/any_instance/expectation_chain.rb