[rspec-devel] [ rspec-Feature Requests-9295 ] rake spec should run anything in the spec directory (not just rspec's standard dirs)
noreply at rubyforge.org
noreply at rubyforge.org
Wed Apr 4 05:45:46 EDT 2007
Feature Requests item #9295, was opened at 2007-03-14 22:20
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=9295&group_id=797
Category: rails plugin
Group: None
>Status: Closed
Priority: 3
Submitted By: David Chelimsky (dchelimsky)
>Assigned to: Aslak Hellesøy (aslak_hellesoy)
Summary: rake spec should run anything in the spec directory (not just rspec's standard dirs)
Initial Comment:
>From email from Bob Martin:
Recommend you add this to rspec.rake
desc "Run all specs in spec directory"
Spec::Rake::SpecTask.new(:all_specs => "db:test:prepare") do |t|
t.spec_opts = ['--options', "\#{RAILS_ROOT}/spec/spec.opts\"]
t.spec_files = FileList['spec/**/*_spec.rb']
end
Perhaps this should BE the 'spec' task.
----------------------------------------------------------------------
>Comment By: Aslak Hellesøy (aslak_hellesoy)
Date: 2007-04-04 05:45
Message:
Fixed on branches/0.9-dev#1689
The convention for spec locations is not to put them under app as you suggest, but under the spec directory. spec/models, spec/controllers etc.
As for wishing to add everything under app to the autoloader path, this sounds like a general Rails RFE.
----------------------------------------------------------------------
Comment By: Robert Martin (unclebob)
Date: 2007-03-15 10:42
Message:
I've only build one real rails app at this point. But before it got very large, I was creating subdirectories in the 'app/models' and 'app/specs' directory. I can't imaging that this isn't common practice. So my vote is for the default rake task to hunt out every subdirectory under spec, and execute any spec it finds. I also wish that every subdirectory under 'app' was automatically added to the rails autoloader path.
----------------------------------------------------------------------
Comment By: David Chelimsky (dchelimsky)
Date: 2007-03-14 22:32
Message:
I added the task (rev 1602), but I'm not sure about making it the default. As we add more types of specs for stories and browser tests, I think this will become problematic.
I do see some benefit in a task that runs the model/view/controller/helper specs in a single batch (rather than 4 separate batches, each w/ their own reload time). Should we make the default do that?
----------------------------------------------------------------------
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=9295&group_id=797
More information about the rspec-devel
mailing list