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

Matthew Krom matthew.krom at gmail.com
Thu Apr 16 08:43:38 EDT 2009


I missed that; sorry.  When code uses class-cached data for performance,
I've developed a testing pattern that explicitly clears class-cached data as
part of the test data setup.  It does require careful attention.  I'd be
interested in what others do!

On Thu, Apr 16, 2009 at 8:20 AM, Fernando Perez <lists at ruby-forum.com>wrote:

> Matthew Krom wrote:
> > Your single test may be relying on database data that is set up (and
> The tests don't hit the database. Only one previous test hits the same
> method and forces the class to set this instance variable.
>
> But I thing that I really have a flaw in my code, as this class instance
> variable will be set once by the process and will keep the same value as
> long as the process is running. I should probably rewrite it to an
> instance variable.
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090416/e495a24d/attachment.html>


More information about the rspec-users mailing list