Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/theozaurus/draper
- Loading branch information
Showing
5 changed files
with
57 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,47 @@ | ||
require 'bundler/gem_tasks' | ||
require 'rake' | ||
require 'rspec/core/rake_task' | ||
|
||
namespace :cover_me do | ||
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 | ||
|
||
desc "Generates and opens code coverage report." | ||
task :report do | ||
require 'cover_me' | ||
CoverMe.complete! | ||
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 | ||
|
||
end | ||
|
||
task :test do | ||
Rake::Task['cover_me:report'].invoke | ||
end | ||
desc "RSpec tests" | ||
task "spec" => "spec:normal" | ||
|
||
task :spec do | ||
Rake::Task['cover_me:report'].invoke | ||
end | ||
task "default" => "spec" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters