[rspec-users] Sqlite3, in-memory db and rspec_server
ed.howland at gmail.com
Thu Jun 21 14:54:18 EDT 2007
On 6/21/07, Scott Taylor <mailing_lists at railsnewbie.com> wrote:
> On Jun 21, 2007, at 1:32 PM, Ed Howland wrote:
> > Hi everyone.
> > I can't get the above(subject line) combination to work. If I use a
> > standard sqlite3 file db for the test db, and spec_server all the
> > specs on my models pass. If I use an in-memory db for the test db,
> > script/spec w/o spec_server, they all pass. But if I use in-memory and
> > spec_server I get the following error:
> > 1)
> > ActiveRecord::StatementInvalid in 'User should be valid'
> > ActiveRecord::StatementInvalid
> > ./spec/models/user_spec.rb:5:in `new'
> > ./spec/models/user_spec.rb:5:
> > ./script/spec_server:23:in `run'
> > ./script/spec_server:44:
> > Line 5 is the User.new in the before clause.
> > I have tried this on various versions of things. RSpec 1.0.5, Ubuntu
> > 6.04, Rails 1.2.3, Sqlite 3.2.8, sqlit3-ruby 1.2.1 (gem)
> > And on Ubuntu 7.04, Sqlite 3.3.13
> > Same results.
> > Any ideas?
> I've had the same problem before, even using the in-memory plugin (by
> Geoffrey Grosenbach).
> If my memory serves me right, I believe that something like the
> following is going on: the DRB server performs certain actions (like
> creating the test database schema) only once. Normally the test
> database schema would be recreated after every Test::Unit class /
> RSpec Behavior. Since the database schema isn't recreated when using
> the drb server, the in memory database no longer exists (go figure)
> after a bit (say, after the first few specs), and Rails throws an
> I'd be interesting in seeing a full trace. Maybe we can get to the
> bottom of this bug.
Here it is:
rspec -b spec/models/user_spec.rb
ActiveRecord::StatementInvalid in 'User should be valid'
Finished in 0.009507 seconds
1 example, 1 failure
> rspec-users mailing list
> rspec-users at rubyforge.org
"The information transmitted is intended only for the person or entity
to which it is addressed and may contain proprietary, confidential
and/or legally privileged material. Any review, retransmission,
dissemination or other use of, or taking of any action in reliance
upon, this information by persons or entities other than the intended
recipient is prohibited. If you received this in error, please contact
the sender and delete the material from all computers."
More information about the rspec-users