Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Untitled #35

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
49 changes: 27 additions & 22 deletions Rakefile
Expand Up @@ -5,15 +5,6 @@ Bundler::GemHelper.install_tasks
require 'rake' require 'rake'
require 'rspec/core/rake_task' require 'rspec/core/rake_task'
require 'rspec/mocks/version' require 'rspec/mocks/version'
require 'cucumber/rake/task'

class Cucumber::Rake::Task::ForkedCucumberRunner
# When cucumber shells out, we still need it to run in the context of our
# bundle.
def run
sh "bundle exec #{RUBY} " + args.join(" ")
end
end


task :cleanup_rcov_files do task :cleanup_rcov_files do
rm_rf 'coverage.data' rm_rf 'coverage.data'
Expand All @@ -24,8 +15,6 @@ RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts = %w[--color] t.rspec_opts = %w[--color]
end end


Cucumber::Rake::Task.new(:cucumber)

namespace :spec do namespace :spec do
desc "Run all examples using rcov" desc "Run all examples using rcov"
RSpec::Core::RakeTask.new :rcov => :cleanup_rcov_files do |t| RSpec::Core::RakeTask.new :rcov => :cleanup_rcov_files do |t|
Expand All @@ -35,17 +24,35 @@ namespace :spec do
end end
end end


namespace :cucumber do task :default => :spec
desc "Run cucumber features using rcov"
Cucumber::Rake::Task.new :rcov => :cleanup_rcov_files do |t| begin
t.cucumber_opts = %w{--format progress} require 'cucumber/rake/task'
t.rcov = true
t.rcov_opts = %[-Ilib -Ispec --exclude "gems/*,features"] class Cucumber::Rake::Task::ForkedCucumberRunner
t.rcov_opts << %[--text-report --sort coverage --aggregate coverage.data] # When cucumber shells out, we still need it to run in the context of our
# bundle.
def run
sh "bundle exec #{RUBY} " + args.join(" ")
end
end end
end


task :default => [:spec, :cucumber] Cucumber::Rake::Task.new(:cucumber)

namespace :cucumber do
desc "Run cucumber features using rcov"
Cucumber::Rake::Task.new :rcov => :cleanup_rcov_files do |t|
t.cucumber_opts = %w{--format progress}
t.rcov = true
t.rcov_opts = %[-Ilib -Ispec --exclude "gems/*,features"]
t.rcov_opts << %[--text-report --sort coverage --aggregate coverage.data]
end
end

task :default => :cucumber
rescue LoadError
$stderr.puts "unable to load cucumber, some tasks unavailable"
end


task :clobber do task :clobber do
rm_rf 'pkg' rm_rf 'pkg'
Expand All @@ -66,5 +73,3 @@ task :relish, :version do |t, args|
raise "rake relish[VERSION]" unless args[:version] raise "rake relish[VERSION]" unless args[:version]
sh "relish push rspec/rspec-mocks:#{args[:version]}" sh "relish push rspec/rspec-mocks:#{args[:version]}"
end end

task :default => [:spec, :cucumber]