Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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`.
  • Loading branch information...
commit 5c3fb37a142b6591c69cf8d4ef5c000581f319fe 1 parent 561ac3e
@mcmire mcmire authored
Showing with 8 additions and 5 deletions.
  1. +1 −1  CONTRIBUTING.md
  2. +2 −0  NEWS.md
  3. +5 −4 Rakefile
View
2  CONTRIBUTING.md
@@ -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
View
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
View
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
Please sign in to comment.
Something went wrong with that request. Please try again.