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`.
This commit is contained in:
parent
561ac3e2f0
commit
5c3fb37a14
|
@ -3,7 +3,7 @@ We love pull requests. Here's a quick guide:
|
|||
1. Fork the repo.
|
||||
|
||||
2. Run the tests. We only take pull requests with passing tests, and it's great
|
||||
to know that you have a clean slate: `bundle && rake`
|
||||
to know that you have a clean slate: `bundle && bundle exec rake`
|
||||
|
||||
3. Add a test for your change. Only refactoring and documentation changes
|
||||
require no new tests. If you are adding functionality or fixing a bug, we need
|
||||
|
|
2
NEWS.md
2
NEWS.md
|
@ -25,6 +25,8 @@
|
|||
* Change `validate_uniqueness_of(...)` so that it provides default values for
|
||||
non-nullable attributes.
|
||||
|
||||
* Running `rake` now installs Appraisals before running the test suite.
|
||||
|
||||
# v 2.5.0
|
||||
|
||||
* Fix Rails/Test::Unit integration to ensure that the test case classes we are
|
||||
|
|
9
Rakefile
9
Rakefile
|
@ -15,14 +15,15 @@ Cucumber::Rake::Task.new do |t|
|
|||
t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'progress')]
|
||||
end
|
||||
|
||||
task :default do |t|
|
||||
task :default do
|
||||
if ENV['BUNDLE_GEMFILE'] =~ /gemfiles/
|
||||
exec 'rake spec cucumber'
|
||||
Rake::Task['spec'].invoke
|
||||
Rake::Task['cucumber'].invoke
|
||||
else
|
||||
Rake::Task['appraise'].execute
|
||||
Rake::Task['appraise'].invoke
|
||||
end
|
||||
end
|
||||
|
||||
task :appraise => ['appraisal:install'] do |t|
|
||||
task :appraise => ['appraisal:install'] do
|
||||
exec 'rake appraisal'
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue