Properly using Rake::TestTask


#1

I have a Rakefile that I am using to create and upload a gem.
However, I am having a problem with Rake::TestTask not aborting the
make when of the unit tests fails.

I’m basically doing:

spec = Gem::Specification.new do |spec|
#…etc…
end

Rake::GemPackageTask.new(spec)

Rake::TestTask.new do |t|
t.libs << ‘test’
t.test_files = FileList[‘test/*.rb’]
t.verbose = true
t.warning = true
end

task ‘upload-gem’ => [‘test’, ‘gem’] do
end

task :default => [‘upload-gem’]
end

How do I make my unit tests abort the gem creation?