aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2015-12-07 23:36:20 +0100
committerKasper Timm Hansen <kaspth@gmail.com>2015-12-07 23:36:20 +0100
commita61e4ae58d65d43a97e90bdb02b6c407791e3c53 (patch)
tree734540abf2288a40fd62e785bbd420548937f806 /railties
parent2af9c080799c25a0bb4f6f6b8d2685b6c0e47299 (diff)
parentec2aefdbfa605208f356b70553ec091d6b1a68d2 (diff)
downloadrails-a61e4ae58d65d43a97e90bdb02b6c407791e3c53.tar.gz
rails-a61e4ae58d65d43a97e90bdb02b6c407791e3c53.tar.bz2
rails-a61e4ae58d65d43a97e90bdb02b6c407791e3c53.zip
Merge pull request #22248 from arekf/issue-22232
Fix #22232: rake test tasks exit status code
Diffstat (limited to 'railties')
-rw-r--r--railties/CHANGELOG.md7
-rw-r--r--railties/lib/rails/test_unit/minitest_plugin.rb4
2 files changed, 10 insertions, 1 deletions
diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md
index 709e473b58..e6bee302a3 100644
--- a/railties/CHANGELOG.md
+++ b/railties/CHANGELOG.md
@@ -1,3 +1,10 @@
+* Fix setting exit status code for rake test tasks. The exit status code
+ was not set when tests were fired with `rake`. Now, it is being set and it matches
+ behavior of running tests via `rails` command (`rails test`), so no matter if
+ `rake test` or `rails test` command is used the exit code will be set.
+
+ *Arkadiusz Fal*
+
* Add Command infrastructure to replace rake.
Also move `rake dev:cache` to new infrastructure. You'll need to use
diff --git a/railties/lib/rails/test_unit/minitest_plugin.rb b/railties/lib/rails/test_unit/minitest_plugin.rb
index 4e1fb13009..d39d2f32bf 100644
--- a/railties/lib/rails/test_unit/minitest_plugin.rb
+++ b/railties/lib/rails/test_unit/minitest_plugin.rb
@@ -57,7 +57,9 @@ module Minitest
# as the patterns would also contain the other Rake tasks.
def self.rake_run(patterns) # :nodoc:
@rake_patterns = patterns
- run
+ passed = run
+ exit passed unless passed
+ passed
end
def self.plugin_rails_init(options)