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

Fernando Perez lists at ruby-forum.com
Thu Apr 16 09:00:13 EDT 2009

> @expiry_date_cache ||= {}
> @expiry_date_cache[user.id] ||= find_if_expiry_date_for(user)

>From the beginning my code was silly. The cache has to be tied to an 
object that only exists for the current request being processed. So I 
have refactored it.

tdd/bdd/rspec/test::unit/whatever helped me to discover this.
Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list