cavalle / steak

DISCONTINUED - The delicious combination of RSpec and Capybara for Acceptance BDD
MIT License
763 stars 32 forks source link

RFC: ability to override "spec/acceptance" directory #11

Closed wincent closed 14 years ago

wincent commented 14 years ago

Still having problems pushing to GitHub, so have pasted a patch here:

http://gist.github.com/449281

It modifies the "steak:install" generator to accept an optional argument that overrides the default "spec/acceptance" target directory.

The motivation for the change is to allow the acceptance specs to be kept entirely separate. In this way, if the user wants, he/she can do "rake spec" for low-level unit tests and "rake spec:acceptance" for high-level acceptance tests. Alternatively, the user can accept the existing default and "rake spec" will continue to run absolutely everything.

If the user overrides the directory, note that the generator has to further tweak some of the templates such as the acceptance_helper.rb template and the steak.rake template.

Not sure whether this will be controversial or not, but this commit also introduces a "steak.yml" configuration file that sits in the project root. Cucumber creates such a file too, so there are precedents.

The purpose of this file is to record the custom "spec_dir", so that the "steak:spec" task knows where to put the generated files.

So, at this stage I'm just posting this as an "RFC" (ie. Request For Comments). I am not sure if it should be applied, or should be further refined, or whether there is perhaps another better solution to the problem.

Cheers, Wincent

fullofcaffeine commented 14 years ago

Hey Wincent, seems like we posted about the same subject on the same day ;)

cavalle commented 14 years ago

Right, the topic is the same as #12 which I've just answered. As I say there I don't see compelling reasons to move the acceptance directory to a different place. And even less to allow the user to configure it.

You can always stop using the generators and put the specs where you prefer. It's not that a big deal. You can even write your own generators or rake tasks (i.e to run just your unit specs: task 'spec:unit' => ['spec:models', 'spec:controllers', 'spec:views', 'spec:helpers'])

I'd rather offer simple conventions with Steak, than configuration.

I'll keep this issue opened though, to allow discussion and other reasons to come up.

wincent commented 14 years ago

Seems fair to me. May as well close the issue.

wincent commented 14 years ago

Doh, forgot to hit the "Comment and Close" button.