[rspec-users] can't get (r)spec to work in non-rails project

David Chelimsky dchelimsky at gmail.com
Sat Feb 16 14:26:50 EST 2008

On Feb 16, 2008 1:56 PM, Ivo Dancet <ivo.dancet at gmail.com> wrote:
> Op 16-feb-08, om 19:26 heeft Steve het volgende geschreven:
> > On Sat, 16 Feb 2008 13:06:00 -0500, David Chelimsky wrote:
> >>
> >> The rspec/rails plugin works because there are generators which
> >> create
> >> the files for you, not because of any auto-loading facility. The
> >> generated files have require statements that get you the right stuff.
> >>
> >> We could conceivably add generators for other-than-rails apps. The
> >> reason we have them in rails apps is because there is already a
> >> generation facility that is easy to hook into.
> >>
> >> If we were to add generators, how do you think they should work?
> >> Where
> >> should they live? Part of the spec command? A new shell command? A
> >> separate plugin?
> >>
> >
> > I would think just have the spec_helper.rb file for the specs try to
> > load
> > config/rspec.rb or something along those lines. Similar to how rspec
> > for
> > rails just loads the rails env. It would then be up to the user to
> > do the
> > necessary loading in that file. There's really no way to know what
> > crazy
> > way someone might layout their projects.
> >
> > Steve
> I second that. On the other side, autotest makes some assumptions
> about the layout of a project (that's how things got mixed up for me),
> why shouldn't rspec use the same conventions (and still keep the
> possibility to override conventions in config/rspec). Or it doesn't
> use conventions but it has a generator that makes a config/rspec file
> with some standard config in it.

I'd be more open to generators than convention-enforcement. The 1-1
mapping promoted by autotest is a very good convention, but is often
abused. This is something we discussed a lot in RSpec's early days.

As for generators, there are several project-bootstrapping gems out
there these days like newgem, mr bones, hoe that will set up a project
w/ the basic directories and all the files including the right stuff.
Hoe doesn't support rspec out of the box, but newgem and mr bones do.
So maybe we don't need one built into RSpec?

> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

More information about the rspec-users mailing list