1
0
Fork 0
mirror of https://github.com/drapergem/draper synced 2023-03-27 23:21:17 -04:00

Cleaned up Rakefile.

We can't even use RCov because we don't support 1.8.
This commit is contained in:
Steve Klabnik 2012-10-19 09:19:43 -03:00
parent 28ea364a2f
commit a8039d2848

View file

@ -1,60 +1,19 @@
require 'bundler/gem_tasks'
require 'rake'
# These tasks help build and release the gem
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new do |t|
t.pattern ='spec/**/*_spec.rb'
end
require 'cucumber/rake/task'
RCOV = RUBY_VERSION.to_f == 1.8
namespace :spec do
RSpec::Core::RakeTask.new(:coverage) do |t|
t.pattern = 'spec/**/*_spec.rb'
if RCOV
t.rcov = true
t.rcov_opts = '--exclude osx\/objc,spec,gems\/'
end
end
RSpec::Core::RakeTask.new(:normal) do |t|
t.pattern ='spec/**/*_spec.rb'
t.rcov = false
end
namespace :coverage do
desc "Cleanup coverage data"
task :cleanup do
rm_rf 'coverage.data'
rm_rf 'coverage'
end
desc "Browse the code coverage report."
task :report => ["spec:coverage:cleanup", "spec:coverage"] do
if RCOV
require "launchy"
Launchy.open("coverage/index.html")
else
require 'cover_me'
CoverMe.complete!
end
end
end
Cucumber::Rake::Task.new do |t|
t.cucumber_opts = %w{--format progress}
end
namespace :cucumber do
Cucumber::Rake::Task.new(:ci) do |t|
t.cucumber_opts = %w{--format progress}
end
end
desc "Run Cucumber features"
task "cucumber" => "cucumber:ci"
desc "RSpec tests"
task "spec" => "spec:normal"
desc "Run all tests for CI"
task "ci" => ["spec:normal", "cucumber:ci"]
task "ci" => ["spec", "cucumber"]
task "default" => "ci"