[rspec-users] can't get (r)spec to work in non-rails project
ivo.dancet at gmail.com
Sat Feb 16 13:56:43 EST 2008
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
>> 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?
>> 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
> config/rspec.rb or something along those lines. Similar to how rspec
> 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
> way someone might layout their projects.
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.
More information about the rspec-users