Hi,

2008/10/8 Eric Hodel <drbrain / segment7.net>:
> On Oct 7, 2008, at 07:43 AM, Yusuke ENDOH wrote:
>
>> Executing gem with --test may fail because of requiring
>> test/unit/ui/console/testrunner.
>
> Is it also ok if I check in some windows RubyGems fixes at the same time?

I think Yugui or Matz has a duty to reply to this :-(


By the way, the original problem which I reported disappeared currently
since test/unit was recovered.  But I still doubt the behavior of gem when
`gem install' is executed with --test and the package has no unit tests.

The current behavior is:

  - require 'test/unit/ui/console/testrunner'
    (at unit_test in lib/rubygems/validator.rb)

  - check the return value of TestResult#passed?
    (at execute in lib/rubygems/commands/install_command.rb).

But test/unit executes its tests in at_exit.  No tests are executed yet
when passed? is called, and the call always returns true.  So I think that
the check for passed? is meaningless.  Is it intended?


Here is the current result of `gem install ramaze --test'.  test/unit
seems to receive ARGV which I passed to gem.  The last exception `$! is a
read-only variable' is another problem which I have already reported at
[ruby-dev:36712].


$ gem19 install ramaze --test
============================================================

Thank you for installing Ramaze!
You can now do following:

* Create a new project using the `ramaze' command:
    ramaze --create yourproject

============================================================
Successfully installed ramaze-2008.06
1 gem installed
Installing ri documentation for ramaze-2008.06...
Updating class cache with 1878 classes...
Installing RDoc documentation for ramaze-2008.06...
Gem::SourceIndex#search support for String patterns is deprecated
/home/mame/work/ruby19/local/lib/ruby/1.9.0/rubygems/commands/install_command.rb:134:in
`block in execute' is outdated
There are no unit tests to run for ramaze-2008.06
missing argument: --test
Test::Unit automatic runner.
Usage: /home/mame/local/bin/gem19 [options] [-- untouched arguments]

    -r, --runner=RUNNER              Use the given RUNNER.
                                     (c[onsole], f[ox], g[tk], g[tk]2, t[k])
    -n, --name=NAME                  Runs tests matching NAME.
                                     (patterns may be used).
    -t, --testcase=TESTCASE          Runs tests in TestCases matching TESTCASE.
                                     (patterns may be used).
    -I, --load-path=DIR[:DIR...]     Appends directory list to $LOAD_PATH.
    -v, --verbose=[LEVEL]            Set the output level (default is verbose).
                                     (s[ilent], p[rogress], n[ormal], v[erbose])
        --                           Stop processing options so that the
                                     remaining options will be passed to the
                                     test.
    -h, --help                       Display this help.

Deprecated options:
        --console                    Console runner (use --runner).
        --gtk                        GTK runner (use --runner).
        --fox                        Fox runner (use --runner).

/home/mame/work/ruby19/local/lib/ruby/1.9.0/test/unit/autorunner.rb:91:in
`rescue in process_args': $! is a read-only variable (NameError)
        from /home/mame/work/ruby19/local/lib/ruby/1.9.0/test/unit/autorunner.rb:86:in
`process_args'
        from /home/mame/work/ruby19/local/lib/ruby/1.9.0/test/unit/autorunner.rb:11:in
`run'
        from /home/mame/work/ruby19/local/lib/ruby/1.9.0/test/unit.rb:278:in
`block in <top (required)>'

-- 
Yusuke ENDOH <mame / tsg.ne.jp>