Sha256: 08882e9b4fff3b70236da8906e2c67560cd85b0b1bcfb0a53d65c7cac0915992

Contents?: true

Size: 1.02 KB

Versions: 29

Compression:

Stored size: 1.02 KB

Contents

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

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

        private
        def verify_invocation_order(rspec_method_name, *args, &block)
        end
      end

      # @api private
      class PositiveExpectationChain < ExpectationChain

        private

        def create_message_expectation_on(instance)
          proxy = ::RSpec::Mocks.proxy_for(instance)
          expected_from = IGNORED_BACKTRACE_LINE
          proxy.add_message_expectation(expected_from, *@expectation_args, &@expectation_block)
        end

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

Version data entries

29 entries across 29 versions & 8 rubygems

Version Path
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/rspec-mocks-2.14.6/lib/rspec/mocks/any_instance/expectation_chain.rb
vagrant-unbundled-1.9.5.1 vendor/bundle/ruby/2.4.0/gems/rspec-mocks-2.14.6/lib/rspec/mocks/any_instance/expectation_chain.rb
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/gems/rspec-mocks-2.14.6/lib/rspec/mocks/any_instance/expectation_chain.rb
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/lib/rspec/mocks/any_instance/expectation_chain.rb
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/lib/rspec/mocks/any_instance/expectation_chain.rb
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/lib/rspec/mocks/any_instance/expectation_chain.rb
vagrant-unbundled-1.8.4.1 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/lib/rspec/mocks/any_instance/expectation_chain.rb
vagrant-unbundled-1.8.1.1 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/lib/rspec/mocks/any_instance/expectation_chain.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/rspec-mocks-2.14.6/lib/rspec/mocks/any_instance/expectation_chain.rb
dxruby_rp5-0.0.4 spec/vendor/rspec-mocks-2.14.4/lib/rspec/mocks/any_instance/expectation_chain.rb
rspec-mocks-2.14.6 lib/rspec/mocks/any_instance/expectation_chain.rb
rspec-mocks-2.14.5 lib/rspec/mocks/any_instance/expectation_chain.rb
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/rspec-mocks-2.14.4/lib/rspec/mocks/any_instance/expectation_chain.rb
mango-0.7.1 vendor/bundler/ruby/2.0.0/gems/rspec-mocks-2.14.4/lib/rspec/mocks/any_instance/expectation_chain.rb
dxruby_rp5-0.0.3 spec/vendor/rspec-mocks-2.14.4/lib/rspec/mocks/any_instance/expectation_chain.rb
tuktuk-rails-0.0.10 vendor/bundle/ruby/2.0.0/gems/rspec-mocks-2.14.4/lib/rspec/mocks/any_instance/expectation_chain.rb
tuktuk-rails-0.0.9 vendor/bundle/ruby/2.0.0/gems/rspec-mocks-2.14.4/lib/rspec/mocks/any_instance/expectation_chain.rb
tuktuk-rails-0.0.8 vendor/bundle/ruby/2.0.0/gems/rspec-mocks-2.14.4/lib/rspec/mocks/any_instance/expectation_chain.rb
tuktuk-rails-0.0.7 vendor/bundle/ruby/2.0.0/gems/rspec-mocks-2.14.4/lib/rspec/mocks/any_instance/expectation_chain.rb
dxruby_rp5-0.0.2 spec/vendor/rspec-mocks-2.14.4/lib/rspec/mocks/any_instance/expectation_chain.rb