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