1
0
Fork 0
mirror of https://github.com/thoughtbot/shoulda-matchers.git synced 2022-11-09 12:01:38 -05:00
thoughtbot--shoulda-matchers/Rakefile
Elliot Winkler 5c3fb37a14 Install appraisals before running the test suite
Currently, `rake` does run the `appraise` task before running tests. If
you run `rake appraise` on its own, it runs `rake appraise:install`
beforehand. However, the way that `rake` runs `appraise` is by
executing, not invoking, it. Hence, `appraisal:install` will actually
not be run (as #execute does not run dependencies for the task being
executed).

This fix is mostly useful when running tests locally -- on Travis this
isn't a problem b/c we are running `rake spec cucumber` instead of just
`rake`.
2014-02-22 14:46:55 -07:00

29 lines
642 B
Ruby

require 'bundler/setup'
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'cucumber/rake/task'
require 'appraisal'
RSpec::Core::RakeTask.new do |t|
t.pattern = "spec/**/*_spec.rb"
t.rspec_opts = '--color --format progress'
t.verbose = false
end
Cucumber::Rake::Task.new do |t|
t.fork = false
t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'progress')]
end
task :default do
if ENV['BUNDLE_GEMFILE'] =~ /gemfiles/
Rake::Task['spec'].invoke
Rake::Task['cucumber'].invoke
else
Rake::Task['appraise'].invoke
end
end
task :appraise => ['appraisal:install'] do
exec 'rake appraisal'
end