On Sun, Sep 28, 2008 at 4:24 PM, Fernando Perez <[EMAIL PROTECTED]> wrote:
> Thank you David,
>
> Is there a way to skip database initialization? Because it takes too
> much time to run each test. Is there a similar way to mock objects or
> create objects and have them "saved" in memory? I don't understand how
> to do that.

Recommended practice is to use the database so you're exercising as
close to the full stack as possible. Depending on whether or not you
use any custom sql, you could try running against an in-memory sqlite3
database

http://nubyonrails.com/articles/2006/06/01/san-francisco-sqlite3-memory-tests-asteroids

>
> I use for instance Product.create!(:title => 'title', :price => '15'),
> but I am not sure the object gets saved or is accessible by RSpec. Do
> you have an exmaple for that?
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/rspec-users
>
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to