[Rubygems-developers] Failing to test gem on install

Gavin Sinclair gsinclair at soyabean.com.au
Sun Jul 18 09:50:50 EDT 2004

On Sunday, July 18, 2004, 10:24:38 PM, Chad wrote:

>> With the RubyGems 'test_suite_file', however, it's not so clear.
>> Would it be worthwhile taking a leaf out of Rake's book here?
>>   spec = Gem::Specification.new do |s|
>>     ...
>>     s.test_files = Dir['test/**/tc_*.rb']
>>     ...
>>   end
>> A specific reason I'm suggesting this is that a "test suite file"
>> doesn't seem reusable, in that it doesn't (easily) integrate with
>> other testing approaches.  It seems clumsy to have to create a test
>> suite file just to appease RubyGems, so why not fold that information
>> directly into the gemspec?

> The test_suite_file thing is something that most unit testers do.  
> Nathaniel himself does it.  It's idiomatic.  In fact, the reason you
> see "tc_*rb" files is that there are usually also "ts_*rb" files to go
> with them. :)  Nothing RubyGems-specific here.

I've never seen a "ts_*.rb" file, and am digging through various
projects' code now to try and get an idea for unit testing practice.
Do you know of any good examples?

The fact remains that it's quite reasonable to manage unit tests
_without_ such suite files.  I prefer to do so.[1]  So why should
RubyGems target just one idiom?


[1] I go for a test/TEST.rb file that can be run from anywhere, and
allows you to restrict the test suite on the command line.

More information about the Rubygems-developers mailing list