Rakefile in safemode-1.0.2 vs Rakefile in safemode-1.1.0
- old
+ new
@@ -32,10 +32,11 @@
"Sven Fuchs",
"Peter Cooper",
"Matthias Viehweger",
"Kingsley Hendrickse",
"Ohad Levy",
+ "Dmitri Dolguikh",
]
# dependencies defined in Gemfile
end
Jeweler::RubygemsDotOrgTasks.new
@@ -44,15 +45,23 @@
test.libs << 'lib' << 'test'
test.pattern = 'test/**/test_*.rb'
test.verbose = true
end
-require 'rcov/rcovtask'
-Rcov::RcovTask.new do |test|
- test.libs << 'test'
- test.pattern = 'test/**/test_*.rb'
- test.verbose = true
- test.rcov_opts << '--exclude "gems/*"'
+if RUBY_VERSION >= "1.9"
+ desc "Generate coverage report for tests"
+ task :coverage do |cov|
+ ENV['COVERAGE'] = 'true'
+ Rake::Task[:test].execute
+ end
+else
+ require 'rcov/rcovtask'
+ Rcov::RcovTask.new do |test|
+ test.libs << 'test'
+ test.pattern = 'test/**/test_*.rb'
+ test.verbose = true
+ test.rcov_opts << '--exclude "gems/*"'
+ end
end
task :default => :test
require 'rdoc/task'