Hi Gernot,

> To speed up the execution of my specs I would like to use spork.
> Unfortunately, Datamapper preloads all models at startup. Therefore, I
> have to restart spork whenever I change a model.
>
> Is there a way to disable model preloading or can I preload the models
> on reach test run using the prefork configuration of spork?

Here's an example of what I usually do in Rails 3 w/DataMapper and
Spork:

  http://pastie.org/1647636

I've also found that using guard and guard-spork is a really nice way
to manage the spork process and setup a modern autotest-like
environment. The DSL to configure which specs are executed is much
nicer than autotest, and you can configure other tasks to run when
specific files are updated too. In my Gemfile I have something like
this:

  group :development do
    gem 'rb-fsevent',    '~> 0.3.10'  # OSX only
    gem 'growl',         '~> 1.0.3'
    gem 'guard',         '~> 0.3.0'
    gem 'guard-bundler', '~> 0.1.2'
    gem 'guard-ego',     '~> 0.0.1'
    gem 'guard-rspec',   '~> 0.1.9'
    gem 'guard-spork',   '~> 0.1.4'
  end

Be sure to read the guard documentation on how to setup and configure
it.. it's pretty easy, but you do have to configure a few things that
you might not normally have to deal with (i.e. like adding --drb to
the rspec config options).

--

Dan
(dkubb)

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" 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/datamapper?hl=en.

Reply via email to