Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Adding rake task for specs.
Ugh. This is so stupid. If I name this :spec, it doesn't work. But :spec_lolz does.
- Loading branch information
15625a8There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:specis the default argument toRSpec::Core::RakeTask.new15625a8There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And by not work, you mean it still uses the default (rspec-rails provided) "spec" rake task?
15625a8There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. If I make it
:spec, and I runrake spec, the argument is not respected. It's very strange.15625a8There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You basically have two options:
1.) Keep the "spec_lolz" task. It works because it's not named "spec".
2.) Add
Rake.application.instance_variable_get('@tasks').delete('spec')to the top of yourrspec.rakefile. This will delete the "spec" task that rspec-rails provides via railties.15625a8There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh I didn't know about that! I swear that I used to be able to just override it, did something change?
I don't have time to do that right now, but if you worked up a pull request, I'd totally merge it. :)
15625a8There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RSpec::Core::RakeTask.newjust creates new rake tasks using thetaskDSL. And, Rake doesn't allow you to "override" tasks, it just creates new ones:To overwrite a task, you have get hacky.