[rspec-users] "warning: object#id will be deprecated" with mocks

David Green justnothing at tiscali.co.uk
Sat Feb 17 16:45:22 EST 2007


hi all

I have the following code in a spec:
  
  @user = mock("user")
  User.stub!(:authenticate).and_return(@user)
  @user.should_receive(:id).once.and_return(99)
  post :login, {:username => 'username', :password => 'password'}
  session[:user_id].should == 99

it works as expected but I get the following warning when I run the spec:
 warning: object#id will be deprecated; use Object#object_id instead

I'm new to testing with mocks, am I using them correctly and does anyone
know how to disable the warning?

thanks
-- 
View this message in context: http://www.nabble.com/%22warning%3A-object-id-will-be-deprecated%22-with-mocks-tf3246300.html#a9024353
Sent from the rspec-users mailing list archive at Nabble.com.



More information about the rspec-users mailing list