System notice: In light of the Debian OpenSSL security issue we've regenerated the server keys. See this thread for instructions and the new key fingerprints.

Commit 6111eeeb8ad02cf94d0652863abc4ad9c90d71e4

Added pending example for http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/352.

Commit diff

rspec/spec/spec/mocks/mock_spec.rb

 
7575 @mock.rspec_verify
7676 end
7777
78 it "should raise exception if args dont match when method called" do
78 it "should raise exception if args don't match when method called" do
7979 @mock.should_receive(:something).with("a","b","c").and_return("booh")
8080 lambda {
8181 @mock.something("a","d","c")
8383 }.should raise_error(MockExpectationError, "Mock 'test mock' expected :something with (\"a\", \"b\", \"c\") but received it with (\"a\", \"d\", \"c\")")
8484 end
8585
86 it "should raise exception if args don't match when method called even when the method is stubbed" do
87 pending("need to do some refactoring before trying to get this to pass")
88 @mock.stub!(:something)
89 @mock.should_receive(:something).with("a","b","c")
90 lambda {
91 @mock.something("a","d","c")
92 violated
93 }.should raise_error(MockExpectationError, "Mock 'test mock' expected :something with (\"a\", \"b\", \"c\") but received it with (\"a\", \"d\", \"c\")")
94 end
95
8696 it "should fail if unexpected method called" do
8797 lambda {
8898 @mock.something("a","b","c")
410410 mock = Mock.new('name', :message => :response)
411411 mock.message.should == :response
412412 end
413
413414 end
414415
415416 describe "a mock message receiving a block" do
toggle raw diff