On Oct 29, 12:14 am, fairchild <[EMAIL PROTECTED]> wrote:
> Im still working on getting this to work
> I think what you use is a more succinct version of what I had.  I
> tried it out but with no luck still.  I think the problem may be
> trying to find the DB handle.  When rspec runs, DB is not available:
>  uninitialized constant Spec::Example::ExampleGroup::DB

Instead of DB, use whatever you Database instance is (generally a
constant).  DB is the recommended name for the instance if you are
only using one database, as it is what the sequel command line tool
uses.  Merb apparently uses something different, maybe they have it
documented somewhere.  There's always ObjectSpace if you really want
to find it.

Your examples may not be rolling back because you overriding
execute_examples and I am overriding execute.  I don't know RSpec
enough to know the difference, but I know my way works for me.

FWIW, for testing web apps, I prefer to use plain unit testing of just
the models, and blackbox testing by sending actual requests to the
running web app via net-http, parsing the responses with hpricot, and
checking that the HTML is what I expect.  However, with blackbox
testing you can't use transactions, as the testing program and the
program being tested are running in two separate processes.

Jeremy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to