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

48 lines
940 B
Text
Raw Normal View History

require 'bundler/gem_tasks'
2011-08-10 09:01:22 -04:00
require 'rake'
require 'rspec/core/rake_task'
2011-07-28 00:44:10 -04:00
2011-08-10 09:01:22 -04:00
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
2011-07-28 00:44:10 -04:00
2011-08-10 09:01:22 -04:00
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
2011-07-28 00:44:10 -04:00
end
end
2011-08-10 09:01:22 -04:00
desc "RSpec tests"
task "spec" => "spec:normal"
2011-07-28 00:44:10 -04:00
2011-08-10 09:01:22 -04:00
task "default" => "spec"