Closed panjan closed 8 years ago
How will we check whether Rakefile is a "working" one?
How about looking for the spec
task in the output of rake --tasks --all
?
That would be pretty slow: first, we have to use bundle exec
anyway. If Rakefile
loads the environment, we'll basically incur the gem loading overhead twice.
In one of my work projects, that takes ~4 seconds. An sample Rails project: 2 seconds.
Maybe the better choice would be to simply make rspec-use-rake-when-possible
default to nil. I definitely had to use this value in the recent projects at works.
@pezra What do you think?
Hmm... it has the downside of breaking projects that do setup work in rake. (Eg, every rails project whenever there is a new migration.) Otoh, it would make individual test runs a bit, or a lot, faster.
I think I lean toward changing the default as @dgutov suggests because I rarely use rake to run specs these days. Even in rails projects. I'd be interested in hearing the views of others in the community, thoguh. (@rranelli, @pedz, @timcharper, @asok, @dgtized ,etc)
I too never run "rake test" with rspec mode. I have set the option to ignore the Rakefile since my first day with rspec-mode I guess. On Jan 8, 2016 11:07 PM, "Peter Williams" notifications@github.com wrote:
Hmm... it has the downside of breaking projects that do setup work in rake. (Eg, every rails project whenever there is a new migration.) Otoh, it would make individual test runs a bit, or a lot, faster.
I think I lean toward changing the default as @dgutov https://github.com/dgutov suggests because I rarely use rake to run specs these days. Even in rails projects. I'd be interested in hearing the views of others in the community, thoguh. (@rranelli https://github.com/rranelli, @pedz https://github.com/pedz, @timcharper https://github.com/timcharper, @asok https://github.com/asok, @dgtized https://github.com/dgtized ,etc)
— Reply to this email directly or view it on GitHub https://github.com/pezra/rspec-mode/issues/135#issuecomment-170174191.
Hello, I tried to run tests on a project with an empty Rakefile and got the following output:
This is the minimal working Rakefile:
Things should work even with an empty Rakefile.