RSpec Rails Rake Tasks are not configurable #521

Closed
dlindahl opened this Issue Mar 29, 2012 · 3 comments

Comments

Projects
None yet
3 participants
@dlindahl

RSpec provides a great mechanism to define and customize Rake Tasks for spec running. Unfortunately, RSpec Rails removes the benefit of those features by pre-defining common task names such as :default and :spec.

To make development of my app easier, and to support our CI server, I want the :default and :spec tasks to run RSpec in a particular configuration. Due to how Rake Tasks work, it is not possible to "monkey patch" a pre-existing task. It merely runs both in order.

I realize that part of this can be accomplished by using the RSpec.configure block, but one option that I want to use is --require spec_helper. The spec_helper is the natural place for the RSpec.configure block to reside, hence the problem.

I also realize that the .rspec file can provide similar features, but I'd rather not commit such a file to my codebase so that other developers can further customize RSpec in ways they prefer.

So, is there any way to either:

  1. Allow the additional configuration of the pre-defined RSpec Rails tasks.
  2. Allow the end-user to avoid loading the predefined Rake Tasks so that they can define their own
@dchelimsky

This comment has been minimized.

Show comment Hide comment
@dchelimsky

dchelimsky Mar 29, 2012

Owner

task('spec').clear

This, unfortunately, does not remove the descriptions, but that's a rake issue.

Owner

dchelimsky commented Mar 29, 2012

task('spec').clear

This, unfortunately, does not remove the descriptions, but that's a rake issue.

@dchelimsky dchelimsky closed this Mar 29, 2012

@dlindahl

This comment has been minimized.

Show comment Hide comment
@dlindahl

dlindahl Mar 29, 2012

Is it worth making a mention of this issue somewhere in the docs or README? This took quite awhile to debug since I did not realize that there was already a :spec task defined.

Is it worth making a mention of this issue somewhere in the docs or README? This took quite awhile to debug since I did not realize that there was already a :spec task defined.

@dchelimsky dchelimsky reopened this Mar 29, 2012

@dchelimsky

This comment has been minimized.

Show comment Hide comment
@dchelimsky

dchelimsky Mar 29, 2012

Owner

Probably right in the README. Wanna send a pull request w/ the wording you'd like to see? If not I'll come up with something.

Owner

dchelimsky commented Mar 29, 2012

Probably right in the README. Wanna send a pull request w/ the wording you'd like to see? If not I'll come up with something.

@ghost ghost assigned dchelimsky Jun 2, 2012

@alindeman alindeman closed this in 00ee369 Oct 27, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment