what’s the alias for any_instance in rspec v1.2?
Object.any_instance.stub(:foo).and_return("return_value")
P.S.
Sorry for my English.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The “hack” was to to redefine a class’ method in scope of the test:
e.g. if you want to make a stub like:
—