From a8039d28481e3ee08cfe87c49f705238157429e9 Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Fri, 19 Oct 2012 09:19:43 -0300 Subject: [PATCH] Cleaned up Rakefile. We can't even use RCov because we don't support 1.8. --- Rakefile | 63 ++++++++++---------------------------------------------- 1 file changed, 11 insertions(+), 52 deletions(-) diff --git a/Rakefile b/Rakefile index c728d85..1f9f46e 100644 --- a/Rakefile +++ b/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"