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:
parent
28ea364a2f
commit
a8039d2848
1 changed files with 11 additions and 52 deletions
63
Rakefile
63
Rakefile
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue