Your single test may be relying on database data that is set up (and left
there) by a different test.  (In your non-sqlite database, the data may be
sitting there as the result of previous testing activity, so the single test
may pass there and not on sqlite)

On Thu, Apr 16, 2009 at 7:51 AM, Fernando Perez <li...@ruby-forum.com>wrote:

> When trying to test using sqlite in-memory in ran into a problem:
>
> - rake test raises an error on a test
> - running the failing test alone works perfectly.
>
> So what's the problem? here is the method giving the trouble:
>
> def self.expiry_date_for(user)
>  @expiry_date_cache ||= find_if_expiry_date_for(user)
> end
>
> That cached method is also called by another file, and therefore sets
> the @expiry_date_cache to some value therefore not acting correctly.
>
> So is my code flawed or is it the testing framework that doesn't clear
> correctly the cached variable? In production, would my code work
> correctly?
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to