[Rspec-devel] Rake Task - not for Windows ?
aslak.hellesoy at gmail.com
Tue Aug 22 06:48:09 EDT 2006
On 8/22/06, DeeJay <smartgpx at gmail.com> wrote:
> "Question to DeeJay:
> 1) What exactly should we do to reproduce this on a windows box?
> 2) Does the spec task behave badly for both plain ruby and rcov usage?"
> To answer your questions first -
> 1) As documented in #4891
> > rake examples_with_rcov --trace
> where rakefile contains the example given
> in the first reversed-out code box at
> (rcov is installed on the system and produces results in coverage if invoked
> from the command line.)
> The response, ignoring the file-selection report, is:
> rake aborted!
> undefined method `exitstatus' for nil:NilClass
> [..further backtrace suppressed]
> 2) This only happens when t.rcov = true is set
Ok, I think I know what causes the bug. Ruby/Rubygems/Windows has a
"bug" that makes it impossible to run a shell script without its
extension. On Windows, there is no rcov script (but an rcov.cmd or
rcov.bat one) and telling ruby to run rcov won't work. The error
message that is seen is a sideeffect and doesn't really help
I think we can fix this in the next release (using "ruby -S rcov"
instead of "rcov") to fire up rcov.
In the meanwhile, try to hack your spectask.rb and change the line:
interpreter = @rcov ? "rcov" : "ruby"
interpreter = @rcov ? "rcov.cmd" : "ruby"
interpreter = @rcov ? "rcov.bat" : "ruby"
Hope this helps.
> Some background.
> Assume (as a 'user-story' if you like) that I am coming to this with little
> experience or understanding of rake, rcov or rspec.
> Refer to http://rspec.rubyforge.org/tools/rcov.html
> What is the nature of the code in the reversed-out box? It looked like Ruby,
> I tried passing it to ruby. Silence. It starts with "require 'rake' ", so it
> seem logical to try to pass it to rake, but I tried. Silence. So I started
> clicking through
> and when I got to the source for 'run' and could not find 'sh' documented in
> fxri I assumed I had found the reason for what I perceived to be an
> incompatibility between SpecTask and Windows.
> A note with the sample task documenting how to run it would make
> life easier for newcomers. :-)}
> I now know, by reference to bug #4891, that I have to invoke rake
> with an argument that is extracted from a text string buried half-way
> down the sample code. (I think I can see why, but I hope you can
> see why it isn't obvious to a newcomer?)
I have updated the website documentation in subversion so it's more
newcomer friendly. It will be on the website after the next release
(we only upload the website when we release a new version of RSpec).
> Thanks for listening -
Thanks for helping us improve things.
> Rspec-devel mailing list
> Rspec-devel at rubyforge.org
More information about the Rspec-devel