[rspec-users] Testing discovered a problem in my code

Fernando Perez lists at ruby-forum.com
Thu Apr 16 10:52:55 EDT 2009


> This is one example of how global variables suck.
> 
> Also your code doesn't make sense to me. I'd you called it twice, each
> with different users, you would get the same result which is prob not
> what you want.

Yup, that's why I corrected it. Now the method is an instance method of 
User, so I call it as following:

current_user.membership_expiry_date
-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list