RakeTask and hardcoded path separator when using RCov #289

Closed
luislavena opened this Issue Jan 25, 2011 · 8 comments

Projects

None yet

3 participants

@luislavena
Contributor

Hello,

RakeTask, when used with RCov enabled generates a non-portable Ruby include option -I, the offending line is here:

https://github.com/rspec/rspec-core/blob/master/lib/rspec/core/rake_task.rb#L164

A simple patch is change it to read like this:

  cmd_parts << ["-Ispec#{File::PATH_SEPARATOR}lib", rcov_opts]

Which might reduce readability, but works across platforms.

Thank you.

@dchelimsky
Member

Use File::PATH_SEPARATOR

  • thanks to Luis Lavena for the pointer
  • Closed by dbbb891.
@dchelimsky
Member

@luislavena - rcov specifies this should be a colon, not defined by the file separator:

$ bin/rcov --help
rcov 0.9.10 2010-02-28
Usage: rcov [options] <script1.rb> [script2.rb] [-- --extra-options]

Options:
    -o, --output PATH                Destination directory.
    -I, --include PATHS              Prepend PATHS to $: (colon separated list)
...
@dchelimsky dchelimsky added a commit that referenced this issue Aug 25, 2011
@dchelimsky dchelimsky Use : as file separator when passing args to rcov.
This is based on rcov's own command line documentation.

- Closes #307.
- Reverses #289.
06b4122
@luislavena
Contributor

@dchelimsky, hmm, weird, because I wouldn't have reported this if wasn't it failed on me :P

I believe the inconsistency came from here Rcov::RcovTask own usage of File::PATH_SEPARATOR:

https://github.com/relevance/rcov/blob/master/lib/rcov/rcovtask.rb#L100

And then uses : instead.

The behavior of Rcov itself is inconsistent with Ruby one, where -I uses the right File::PATH_SEPARATOR for the platform.

@dchelimsky
Member

@luislavena - maybe we should just extend the rcov task then, or perhaps even deprecate support for rcov in the task since rcov has its own task.

@luislavena
Contributor

@hoffmanc I think @dchelimsky will need to revert the usage of : once rcov releases that change.

@hoffmanc
hoffmanc commented Dec 2, 2011

@luislavena I ran into errors on a Windows machine with these versions of the gems:

rcov (0.9.11)
rspec (2.7.0)
@luislavena
Contributor

@hoffmanc

Until this is fixed, please use RCov task outside RSpec, not from RSpec own definition, please see previous comment about it.

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