Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 88da453c0f
Fetching contributors…

Cannot retrieve contributors at this time

47 lines (40 sloc) 1.103 kb
# encoding: utf-8
begin
require 'spec/rake/spectask'
desc 'Run all specs'
task :spec => %w[ spec:unit spec:integration ]
namespace :spec do
Spec::Rake::SpecTask.new(:integration) do |t|
t.pattern = 'spec/integration/**/*_spec.rb'
end
Spec::Rake::SpecTask.new(:unit) do |t|
t.pattern = 'spec/unit/**/*_spec.rb'
end
end
rescue LoadError
task :spec do
abort 'rspec is not available. In order to run spec, you must: gem install rspec'
end
end
begin
if RUBY_VERSION < '1.9'
desc 'Generate code coverage'
Spec::Rake::SpecTask.new(:coverage) do |t|
t.rcov = true
t.pattern = 'spec/unit/**/*_spec.rb'
t.rcov_opts = File.read('spec/rcov.opts').split(/\s+/)
end
else
desc 'Generate code coverage'
task :coverage do
ENV['COVERAGE'] = 'true'
Rake::Task['spec:unit'].execute
end
end
rescue LoadError
task :coverage do
lib = RUBY_VERSION < '1.9' ? 'rcov' : 'simplecov'
abort "coverage is not available. In order to run #{lib}, you must: gem install #{lib}"
end
end
task :test => 'spec'
Jump to Line
Something went wrong with that request. Please try again.