lib/rspec/mocks/methods.rb in rspec-mocks-2.0.0.beta.4 vs lib/rspec/mocks/methods.rb in rspec-mocks-2.0.0.beta.5

- old
+ new

@@ -7,18 +7,18 @@ def should_not_receive(sym, &block) __mock_proxy.add_negative_message_expectation(caller(1)[0], sym.to_sym, &block) end - def stub!(sym_or_hash, opts={}, &block) + def stub(sym_or_hash, opts={}, &block) if Hash === sym_or_hash sym_or_hash.each {|method, value| stub!(method).and_return value } else __mock_proxy.add_stub(caller(1)[0], sym_or_hash.to_sym, opts, &block) end end - alias_method :stub, :stub! + alias_method :stub!, :stub def stub_chain(*methods) if methods.length > 1 next_in_chain = Object.new stub!(methods.shift) {next_in_chain}