Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit a2f3f48f96d57f4a1e52fe0a9872e0f618834cf5 1 parent 0756fb4
Diego Elio Pettenò authored

Showing 1 changed file with 10 additions and 10 deletions. Show diff stats Hide diff stats

  1. 20  Rakefile
20  Rakefile
... ...
@@ -1,6 +1,14 @@
1 1
 require 'rubygems'
2 2
 require 'rake'
3 3
 
  4
+require 'rake/testtask'
  5
+Rake::TestTask.new(:test) do |test|
  6
+  test.libs << 'lib' << 'test'
  7
+  test.pattern = 'test/**/*_test.rb'
  8
+  test.verbose = false
  9
+  test.warning = true
  10
+end
  11
+
4 12
 begin
5 13
   require 'jeweler'
6 14
   Jeweler::Tasks.new do |gem|
@@ -17,18 +25,12 @@ begin
17 25
     gem.add_development_dependency "httpclient"
18 26
     gem.add_development_dependency "fakeweb"
19 27
   end
  28
+
  29
+  task :test => :check_dependencies
20 30
 rescue LoadError
21 31
   puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
22 32
 end
23 33
 
24  
-require 'rake/testtask'
25  
-Rake::TestTask.new(:test) do |test|
26  
-  test.libs << 'lib' << 'test'
27  
-  test.pattern = 'test/**/*_test.rb'
28  
-  test.verbose = false
29  
-  test.warning = true
30  
-end
31  
-
32 34
 begin
33 35
   require 'rcov/rcovtask'
34 36
   Rcov::RcovTask.new do |test|
@@ -45,8 +47,6 @@ rescue LoadError
45 47
   end
46 48
 end
47 49
 
48  
-task :test => :check_dependencies
49  
-
50 50
 task :default => :test
51 51
 
52 52
 begin

0 notes on commit a2f3f48

Please sign in to comment.
Something went wrong with that request. Please try again.