# Properly using Rake::TestTask

**URL:** <https://www.ruby-forum.com/t/properly-using-rake-testtask/89640>\
**Category:** Ruby\
**Created:** [March 21, 2007, 9:15pm UTC](https://www.ruby-forum.com/t/properly-using-rake-testtask/89640 "2007-03-21T21:15:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gga](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b487fb/32.png) [@gga](https://www.ruby-forum.com/u/gga)\
**Post date:** [March 21, 2007, 9:15pm UTC](https://www.ruby-forum.com/t/properly-using-rake-testtask/89640/1 "2007-03-21T21:15:34Z")

</div>

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?
