On Sun, 15 Jul 2007 05:23:54 +0900, Ryan Davis <ryand-ruby / zenspider.com> said:
> On Jul 13, 2007, at 22:20 , David Carlton wrote:

>> The project lives in a directory 'dbcdb' of my $RUBYLIB; there's a
>> subdirectory 'test', with a file 'all.rb' containing lines like this:
>> 
>> require 'dbcdb/test/test_author_printer'
>> require 'dbcdb/test/test_author_writer'
>> require 'dbcdb/test/test_book_writer'

> 1) GENERALLY: work from the project directory and refer to everything  
> from there. Remove 'dbcdb/' from those requires.

Hmm, interesting.  Wouldn't that make my code dependent on the
directory that I'm running it from?  Which I don't care about for the
test code, but I do care about for the project code proper.  (As this
probably makes clear, I don't have a lot of Ruby experience...)

> 2) ruby -w test/all.rb should work fine.

And it does, thanks!

Which gets me really confused: why would

  ruby -e "require 'dbcdb/test/all'"

do something weird but

  ruby -w dbcdb/test/all.rb

do the right thing?  It's doing something with those files - it's not
like I can type in a bogus filename.  Of course, I should be doing
ruby -we instead of ruby -e: that way I get:

truffle:~/ruby/lib/ruby/site_ruby/1.8 carlton$ ruby -we "require
'dbcdb/test/all'" 2>&1 | more     
./dbcdb/test/test_author_printer.rb:8: warning: method redefined;
discarding old test_no_books
./dbcdb/test/test_author_writer.rb:8: warning: method redefined;
discarding old test_name

(a bunch of lines, one for each test suite, warning about the first
method from each suite).  So at least I have some place to start
digging...

Of course, now that I have a method that works, I'm a little less
actively concerned about that mystery - as long as I'll have a nice
vacation, the details don't matter too much right now!

> 3) find test -name \*.rb -- make sure cases are correct and you don't  
> have anything weird like overlapping names. OSX is by default case  
> insensitive. Linux is case sensitive. By getting differing numbers of  
> tests running it makes me think one of the files is being shadowed.

> 4) 1.8.2 on osx is slightly broken, but only for ruby extensions. If  
> this is all pure ruby, please ignore.

Thanks for the suggestions; all lowercase, pure ruby.

David Carlton
carlton / bactrian.org