30 lines
735 B
Ruby
30 lines
735 B
Ruby
require 'rubygems'
|
|
require 'bundler'
|
|
begin
|
|
Bundler.setup(:development)
|
|
rescue Bundler::BundlerError => e
|
|
$stderr.puts e.message
|
|
$stderr.puts "Run `bundle install` to install missing gems"
|
|
exit e.status_code
|
|
end
|
|
require 'rake'
|
|
|
|
|
|
require 'rspec/core/rake_task'
|
|
|
|
desc 'Default: run specs.'
|
|
task :default => :spec
|
|
|
|
desc "Run specs"
|
|
RSpec::Core::RakeTask.new do |t|
|
|
t.pattern = "./spec/**/*_spec.rb" # don't need this, it's default.
|
|
# Put spec opts in a file named .rspec in root
|
|
t.rspec_opts = ["--color", "--format s"]
|
|
end
|
|
|
|
desc "Generate code coverage"
|
|
RSpec::Core::RakeTask.new(:coverage) do |t|
|
|
t.pattern = "./spec/**/*_spec.rb" # don't need this, it's default.
|
|
t.rcov = true
|
|
t.rcov_opts = ['--exclude', 'spec']
|
|
end |