Hi,

I'm trying to run RSpec test cases with the following code in my test
case:

prof = Profile[8]
prof.values.should be_an_instance_of(Hash)
prof.ProfileID.should eq(8)
prof.FirstName.should eq("Karen")

with Profile < Sequel::Model of course from another file. How can I
set the DB for the prof.Profile[8] call to use a Sequel.mock adapter?
I know I can do

DB = Sequel.mock
ds = DB[:tblProfiles]
ds._fetch = [{:ProfileID => 8, :FirstName => 'Karen'}]

or similar in my test case, but this seems to only affect new uses of
that DB constant. Would I need to somehow re-declare my Profile class
to re-invoke the Sequel::Model stuff? Or is there another better way
to mock the actual database behind my Model.[] call?

One more note: this is only my second week of Ruby, so feel free to
explain anything I'm missing :)

-- 
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