TwP/bones-rcov — Issue #1: spec:rcov does not load rspec and fails to run
Author: gioele
Created: 2012-01-01 23:20:48+00:00
State: open

The current rcov/rspec/bones versions do not play nicely with each other.

$ cd /tmp
$ bones create foo
$ cd foo
$ rake spec:rcov
WARNING: 'require 'rake/rdoctask'' is deprecated. Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
at .../gems/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
/usr/bin/ruby1.8 -w -S rcov -Ispec:lib --sort coverage -T --output coverage spec/foo_spec.rb
/usr/lib/ruby/1.8/pathname.rb:263: warning: `*' interpreted as argument prefix
.../gems/gems/rcov-0.9.11/lib/rcov.rb:26: warning: method redefined; discarding old lines
+----------------------------------------------------+-------+-------+--------+
| File | Lines | LOC | COV |
+----------------------------------------------------+-------+-------+--------+
|...s/rcov-0.9.11/lib/rcov/code_coverage_analyzer.rb | 284 | 168 | 4.8% |
|...ms/rcov-0.9.11/lib/rcov/differential_analyzer.rb | 116 | 82 | 9.8% |
|lib/foo.rb | 60 | 36 | 38.9% |
|spec/foo_spec.rb | 6 | 3 | 100.0% |
|spec/spec_helper.rb | 15 | 4 | 100.0% |
+----------------------------------------------------+-------+-------+--------+
|Total | 481 | 293 | 12.6% |
+----------------------------------------------------+-------+-------+--------+
12.6% 5 file(s) 481 Lines 293 LOC
./spec/spec_helper.rb:5: uninitialized constant Spec (NameError)
from .../lib/rubygems/custom_require.rb:36:in `gem_original_require'
from .../lib/rubygems/custom_require.rb:36:in `require'
from ./spec/foo_spec.rb:2
from .../gems/gems/rcov-0.9.11/bin/rcov:516:in `load'
from .../gems/gems/rcov-0.9.11/bin/rcov:516
from .../gems/bin/rcov:19:in `load'
from .../gems/bin/rcov:19
rake aborted!
ruby /usr/bin/ruby1.8 -w -S rcov -Ispec:lib --sort coverage -T --output coverage spec/foo_spec.rb failed

Tasks: TOP => spec:rcov
(See full trace by running task with --trace)

A possible workaround is to add `require "rspec"` to the `spec_helper.rb` file.