draper/Rakefile

61 lines
1.2 KiB
Ruby
Raw Normal View History

require 'bundler/gem_tasks'
2011-08-10 13:01:22 +00:00
require 'rake'
require 'rspec/core/rake_task'
require 'cucumber/rake/task'
2011-07-28 04:44:10 +00:00
2012-03-03 14:01:19 +00:00
RCOV = RUBY_VERSION.to_f == 1.8
2011-08-10 13:01:22 +00:00
namespace :spec do
2012-03-03 14:01:19 +00:00
2011-08-10 13:01:22 +00:00
RSpec::Core::RakeTask.new(:coverage) do |t|
t.pattern = 'spec/**/*_spec.rb'
2012-03-03 14:01:19 +00:00
if RCOV
2011-08-10 13:01:22 +00:00
t.rcov = true
t.rcov_opts = '--exclude osx\/objc,spec,gems\/'
end
end
2012-03-03 14:01:19 +00:00
2011-08-10 13:01:22 +00:00
RSpec::Core::RakeTask.new(:normal) do |t|
t.pattern ='spec/**/*_spec.rb'
t.rcov = false
end
2012-03-03 14:01:19 +00:00
2011-08-10 13:01:22 +00:00
namespace :coverage do
desc "Cleanup coverage data"
task :cleanup do
rm_rf 'coverage.data'
rm_rf 'coverage'
end
2012-03-03 14:01:19 +00:00
2011-08-10 13:01:22 +00:00
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
2011-07-28 04:44:10 +00:00
end
2012-03-03 14:01:19 +00:00
2011-07-28 04:44:10 +00:00
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"
2011-08-10 13:01:22 +00:00
desc "RSpec tests"
task "spec" => "spec:normal"
2011-07-28 04:44:10 +00:00
desc "Run all tests for CI"
task "ci" => ["spec:normal", "cucumber:ci"]
task "default" => "ci"