Sha256: 67c87652bad8134027ff5caea2722e40fd8da0f1914b738b16f6dd34d5ef704c

Contents?: true

Size: 670 Bytes

Versions: 185

Compression:

Stored size: 670 Bytes

Contents

require 'spec_helper'

module RSpec
  module Mocks

    describe "only stashing the original method" do
      let(:klass) do
        Class.new do
          def self.foo(arg)
            :original_value
          end
        end
      end
      it "keeps the original method intact after multiple expectations are added on the same method" do
        klass.should_receive(:foo).with(:fizbaz).and_return(:wowwow)
        klass.should_receive(:foo).with(:bazbar).and_return(:okay)

        klass.foo(:fizbaz)
        klass.foo(:bazbar)
        klass.rspec_verify

        klass.rspec_reset
        klass.foo(:yeah).should equal(:original_value)
      end
    end
  end
end

Version data entries

185 entries across 131 versions & 17 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/rspec-mocks-2.10.1/spec/rspec/mocks/stash_spec.rb
classiccms-0.7.5 vendor/bundle/gems/rspec-mocks-2.9.0/spec/rspec/mocks/stash_spec.rb
classiccms-0.7.4 vendor/bundle/gems/rspec-mocks-2.10.1/spec/rspec/mocks/stash_spec.rb
classiccms-0.7.4 vendor/bundle/gems/rspec-mocks-2.9.0/spec/rspec/mocks/stash_spec.rb
classiccms-0.7.3 vendor/bundle/gems/rspec-mocks-2.9.0/spec/rspec/mocks/stash_spec.rb
classiccms-0.7.3 vendor/bundle/gems/rspec-mocks-2.10.1/spec/rspec/mocks/stash_spec.rb
tnargav-1.3.3 vendor/bundle/ruby/1.9.1/gems/rspec-mocks-2.11.3/spec/rspec/mocks/stash_spec.rb
tnargav-1.2.3 vendor/bundle/ruby/1.9.1/gems/rspec-mocks-2.11.3/spec/rspec/mocks/stash_spec.rb
classiccms-0.7.2 vendor/bundle/gems/rspec-mocks-2.9.0/spec/rspec/mocks/stash_spec.rb
classiccms-0.7.2 vendor/bundle/gems/rspec-mocks-2.10.1/spec/rspec/mocks/stash_spec.rb
classiccms-0.7.1 vendor/bundle/gems/rspec-mocks-2.9.0/spec/rspec/mocks/stash_spec.rb
classiccms-0.7.1 vendor/bundle/gems/rspec-mocks-2.10.1/spec/rspec/mocks/stash_spec.rb
classiccms-0.7.0 vendor/bundle/gems/rspec-mocks-2.9.0/spec/rspec/mocks/stash_spec.rb
classiccms-0.7.0 vendor/bundle/gems/rspec-mocks-2.10.1/spec/rspec/mocks/stash_spec.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/rspec-mocks-2.10.1/spec/rspec/mocks/stash_spec.rb
classiccms-0.6.9 vendor/bundle/gems/rspec-mocks-2.9.0/spec/rspec/mocks/stash_spec.rb
classiccms-0.6.9 vendor/bundle/gems/rspec-mocks-2.10.1/spec/rspec/mocks/stash_spec.rb
rspec-mocks-2.12.0 spec/rspec/mocks/stash_spec.rb
classiccms-0.6.8 vendor/bundle/gems/rspec-mocks-2.9.0/spec/rspec/mocks/stash_spec.rb
classiccms-0.6.8 vendor/bundle/gems/rspec-mocks-2.10.1/spec/rspec/mocks/stash_spec.rb