[Rake-devel] Option handling in rake_test_loader.rb

Greg Fast gdf at speakeasy.net
Fri Aug 19 13:25:48 EDT 2005

On Fri, Aug 19, 2005 at 02:22:19PM -0000, Jim Weirich wrote:
> > Here's a tiny patch to rake_test_loader.rb that makes it ignore command
> > line options.  As it is now, you can't do things like `rake test
> > TESTOPTS="--runner=fox"`, since it tries to load() "--runner=fox".
> Hmmm ... I seem to have no problems with TESTOPTS="--runner=fox".  For
> example, given a Rakefile:

I'm on linux, ruby-1.8.2, with (gem) rake 0.5.4.

I'm doing this in my rakefile:

  Rake::TestTask.new( :xmltest ) do |t|
    t.libs << "test"
    t.test_files = tf
    t.verbose = true
    t.options = "--runner=fox"

And getting this (without the modification to rake_test_loader):

  % rake test
  (in /home/gfast/cheese/rscm-accurev)
  ruby -Ilib:test "/opt/ruby-1.8.2/lib/ruby/gems/1.8/gems/rake-0.5.4/lib/rake/rake_test_loader.rb" "test/t_scrubio.rb" "test/t_load.rb" "test/t_filterio.rb" "test/t_xmlmapper.rb" "test/t_command.rb" "test/t_api.rb" --runner=fox
  /opt/ruby-1.8.2/lib/ruby/gems/1.8/gems/rake-0.5.4/lib/rake/rake_test_loader.rb:5:in `load': No such file to load -- --runner=fox (LoadError)
          from /opt/ruby-1.8.2/lib/ruby/gems/1.8/gems/rake-0.5.4/lib/rake/rake_test_loader.rb:5
          from /opt/ruby-1.8.2/lib/ruby/gems/1.8/gems/rake-0.5.4/lib/rake/rake_test_loader.rb:5:in `each'
          from /opt/ruby-1.8.2/lib/ruby/gems/1.8/gems/rake-0.5.4/lib/rake/rake_test_loader.rb:5

The problem is in the way rake_test_loader.rb handles the command
line, not rake itself.

Greg Fast
gdf at speakeasy.net

More information about the Rake-devel mailing list