diff options
author | Michael Grosser <michael@grosser.it> | 2016-09-16 09:31:39 -0700 |
---|---|---|
committer | Michael Grosser <michael@grosser.it> | 2016-09-16 09:36:29 -0700 |
commit | 45dce0c0030129b86413fbcbaa4f71f721847509 (patch) | |
tree | 53ce721846cfaa4a4507c7c7ea8caa6144b63168 /railties/test/application | |
parent | fe98d21289b7510182e338f352f5a416bd01f1ad (diff) | |
download | rails-45dce0c0030129b86413fbcbaa4f71f721847509.tar.gz rails-45dce0c0030129b86413fbcbaa4f71f721847509.tar.bz2 rails-45dce0c0030129b86413fbcbaa4f71f721847509.zip |
support minitest after_run for parity to regular minitest
see https://github.com/seattlerb/minitest/blob/f9605387e4af7d657921a83aaf0ae364f6d26a57/lib/minitest.rb#L51-L65
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/test_test.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/railties/test/application/test_test.rb b/railties/test/application/test_test.rb index 99d698114c..702a2be5eb 100644 --- a/railties/test/application/test_test.rb +++ b/railties/test/application/test_test.rb @@ -26,6 +26,24 @@ module ApplicationTests assert_successful_test_run "unit/foo_test.rb" end + test "after_run" do + app_file "test/unit/foo_test.rb", <<-RUBY + require 'test_helper' + + Minitest.after_run { puts "WORLD" } + Minitest.after_run { puts "HELLO" } + + class FooTest < ActiveSupport::TestCase + def test_truth + assert true + end + end + RUBY + + result = assert_successful_test_run "unit/foo_test.rb" + assert_equal ["HELLO", "WORLD"], result.scan(/HELLO|WORLD/) # only once and in correct order + end + test "simple failed test" do app_file "test/unit/foo_test.rb", <<-RUBY require 'test_helper' |