Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1604 from tf/fix-ci
Fix CI and abort when dummy app generation fails
- Loading branch information
Showing
4 changed files
with
31 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
require 'rails/generators' | ||
|
||
# Thor exits with 0, when an error occurs. This behavior is deprecated | ||
# in 1.0 [1], but has not yet changed. As a result the dummy app | ||
# generation is not aborted and tests fail due to confusing follow up | ||
# errors. Rails provides an `abort_on_failure` option for `rake` and | ||
# `generate` actions [2], but it needs to be added to each such | ||
# action. In particular, generating the dummy app invokes other | ||
# generators, which we do not have control over. | ||
# | ||
# To work around this problem, we override the default behavior for | ||
# all generators and make them fail loudly. | ||
# | ||
# [1] https://github.com/erikhuda/thor/blob/master/CHANGELOG.md#100 | ||
# [2] https://github.com/rails/rails/pull/34420/ | ||
|
||
module Rails | ||
module Generators | ||
class Base | ||
def self.exit_on_failure? | ||
true | ||
end | ||
end | ||
end | ||
end |