Properly using Rake::TestTask


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 = do |spec|
end do |t|
t.libs << ‘test’
t.test_files = FileList[‘test/*.rb’]
t.verbose = true
t.warning = true

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

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

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