[Rubygems-developers] Problems with --test

Jim Freeze rubygems at freeze.org
Mon Jun 13 18:53:05 EDT 2005


Hi 

I have a simple test script that looks like:

  % cat test/testall.rb 
  #!/usr/bin/env ruby 

  $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib")

  require 'commandline/optionparser'

  tc = %w( tc_option.rb tc_optionparser.rb tc_optiondata.rb )

  tc.each { |lib|
    puts "== Testing #{lib} =="
    fork { require lib }
  }

A partial error list is below:

gem install OptionParser --test
Attempting local installation of 'OptionParser'
Successfully installed OptionParser, version 0.5.0
Installing RDoc documentation for OptionParser-0.5.0...
./test/../lib/commandline/optionparser.rb:32: warning: already initialized
constant GENERAL_OPT_EQ_ARG_RE
[bunch of similar messages deleted]
== Testing tc_option.rb ==
/Users/jdf/local_ruby/ruby-1.8.2/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in
`require__': No such file to load -- tc_option.rb (LoadError)
        from
/Users/jdf/local_ruby/ruby-1.8.2/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in
`require'
        from ./test/testall.rb:12
        from ./test/testall.rb:12:in `fork'
        from ./test/testall.rb:12
        from ./test/testall.rb:10:in `each'
        from ./test/testall.rb:10
        from
/Users/jdf/local_ruby/ruby-1.8.2/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in
`require__'
        from
/Users/jdf/local_ruby/ruby-1.8.2/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in
`require'
         ... 9 levels...
        from
/Users/jdf/local_ruby/ruby-1.8.2/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:92:in
`process_args'
        from
/Users/jdf/local_ruby/ruby-1.8.2/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:65:in
`run'
        from
/Users/jdf/local_ruby/ruby-1.8.2/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:9:in
`run'
        from /Users/jdf/local_ruby/ruby-1.8.2/bin/gem:17
== Testing tc_optionparser.rb ==
/Users/jdf/local_ruby/ruby-1.8.2/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in
`require__': No such file to load -- tc_optionparser.rb (LoadError)

One of the puzzling things is that it complains that constants
are being redefined. Ruby won't do this and the fork in my test
code prevents this type of thing. So it must be rubygems. ;)

How are tests to be handled with rubygems?

-- 
Jim Freeze


More information about the Rubygems-developers mailing list