Merge pull request #1043 from internetee/deprecate-custom-test-case-for-rake-tasks

Deprecate custom test case for rake tasks
This commit is contained in:
Timo Võhmar 2018-12-03 12:39:47 +02:00 committed by GitHub
commit 0dfe827b09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -4,9 +4,11 @@ class TaskTestCase < ActiveSupport::TestCase
# This suppresses default stdout and makes Rails.env.test? checks unnecessary.
@original_stdout = $stdout
$stdout = File.open(File::NULL, 'w')
ActiveSupport::Deprecation.warn('`TaskTestCase` class will be removed soon.' \
' Use `capture_io` and `assert_output` instead')
end
teardown do
$stdout = @original_stdout
end
end
end