Permalink
Browse files

Only add check_dependencies to the test task if Jeweler is present.

Tests can be properly executed even when Jeweler is not available, but the
check_dependencies task will not be present in that case.
  • Loading branch information...
1 parent 0756fb4 commit a2f3f48f96d57f4a1e52fe0a9872e0f618834cf5 @Flameeyes Flameeyes committed Jan 12, 2010
Showing with 10 additions and 10 deletions.
  1. +10 −10 Rakefile
View
20 Rakefile
@@ -1,6 +1,14 @@
require 'rubygems'
require 'rake'
+require 'rake/testtask'
+Rake::TestTask.new(:test) do |test|
+ test.libs << 'lib' << 'test'
+ test.pattern = 'test/**/*_test.rb'
+ test.verbose = false
+ test.warning = true
+end
+
begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
@@ -17,18 +25,12 @@ begin
gem.add_development_dependency "httpclient"
gem.add_development_dependency "fakeweb"
end
+
+ task :test => :check_dependencies
rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
end
-require 'rake/testtask'
-Rake::TestTask.new(:test) do |test|
- test.libs << 'lib' << 'test'
- test.pattern = 'test/**/*_test.rb'
- test.verbose = false
- test.warning = true
-end
-
begin
require 'rcov/rcovtask'
Rcov::RcovTask.new do |test|
@@ -45,8 +47,6 @@ rescue LoadError
end
end
-task :test => :check_dependencies
-
task :default => :test
begin

0 comments on commit a2f3f48

Please sign in to comment.