[rspec-devel] [ rspec-Bugs-11562 ] Rake RCov task should work out of the box with --drb in spec.opts

noreply at rubyforge.org noreply at rubyforge.org
Sun Nov 18 22:19:40 EST 2007


Bugs item #11562, was opened at 2007-06-13 23:26
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11562&group_id=797

Category: None
Group: None
>Status: Closed
Resolution: None
Priority: 3
Submitted By: Scott Taylor (smtlaissezfaire)
Assigned to: Nobody (None)
Summary: Rake RCov task should work out of the box with --drb in spec.opts

Initial Comment:

The rake task spec:rcov does not work if --drb is specified in spec.opts (in a rails project).  Here is the output:

euclid% rake spec:rcov
(in /Users/smtlaissezfaire/Sites/rails/changelog)
................................*..*..*...................*............. 
...................................

Finished in 5.751487 seconds

107 examples, 0 failures, 4 not implemented

No file to analyze was found. All the files loaded by rcov matched  
one of the
following expressions, and were thus ignored:
[/\A\/opt\/local\/lib/,
/\btc_[^.]*.rb/,
/_test\.rb\z/,
/\btest\//,
/\bvendor\//,
/\A\/opt\/local\/lib\/ruby\/gems\/1\.8\/gems\/rcov\-0\.8\.0\.2\/lib\/ 
rcov\/report\.rb\z/,
/spec/,
/\bvendor\//,
/\bconfig\//,
/\benvironment\//]

You can solve this by doing one or more of the following:
* rename the files not to be ignored so they don't match the above  
regexps
* use --include-file to give a list of patterns for files not to be  
ignored
* use --exclude-only to give the new list of regexps to match against
* structure your code as follows:
       test/test_*.rb  for the test cases
       lib/**/*.rb     for the target source code whose coverage you  
want
   making sure that the test/test_*.rb files are loading from lib/,  
e.g. by
   using the -Ilib command-line argument, adding
     $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
   to test/test_*.rb, or running rcov via a Rakefile (read the RDoc
   documentation or README.rake in the source distribution).



But without --drb in spec.opts it works just fine.  Here is my setup:

Mac OS X.4.9

Fetching external item into 'vendor/rails'
External at revision 7014.

Fetching external item into 'vendor/plugins/rspec'
External at revision 2098.

Fetching external item into 'vendor/plugins/rspec_on_rails'
External at revision 2098.

Fetching external item into 'vendor/plugins/rails_rcov'
External at revision 12.

rcov gem @version 0.8.0.2


If you have some tips on how to write a spec for this, I'd be glad to write a patch.





----------------------------------------------------------------------

Comment By: Chad Humphries (spicycode)
Date: 2007-11-19 03:18

Message:
Moved to http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/50-11562-rake-rcov-task-should-work-out-of-the-box-with-drb-in-spec-opts

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11562&group_id=797


More information about the rspec-devel mailing list