diff options
author | Yves Senn <yves.senn@gmail.com> | 2015-01-30 12:04:57 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2015-01-30 12:04:57 +0100 |
commit | 1fa7861bc9d3ecbdc53eaa1e71b8851b19e38bab (patch) | |
tree | 1c98eff651d6f47b5c072a9690f1e005da3efd30 /railties/test/application | |
parent | 4a0046164de1ee7422911ba9ec0ed4c13cfe7e69 (diff) | |
download | rails-1fa7861bc9d3ecbdc53eaa1e71b8851b19e38bab.tar.gz rails-1fa7861bc9d3ecbdc53eaa1e71b8851b19e38bab.tar.bz2 rails-1fa7861bc9d3ecbdc53eaa1e71b8851b19e38bab.zip |
tests, use `capture` instead of custom `redirect_stderr` helper.
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/test_runner_test.rb | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/railties/test/application/test_runner_test.rb b/railties/test/application/test_runner_test.rb index 032b11a95f..a12f3cfc24 100644 --- a/railties/test/application/test_runner_test.rb +++ b/railties/test/application/test_runner_test.rb @@ -47,9 +47,8 @@ module ApplicationTests def; end RUBY - error_stream = Tempfile.new('error') - redirect_stderr(error_stream) { run_test_command('test/models/error_test.rb') } - assert_match "syntax error", error_stream.read + error = capture(:stderr) { run_test_command('test/models/error_test.rb') } + assert_match "syntax error", error end def test_run_models @@ -296,15 +295,6 @@ module ApplicationTests app_file 'db/schema.rb', '' end - def redirect_stderr(target_stream) - previous_stderr = STDERR.dup - $stderr.reopen(target_stream) - yield - target_stream.rewind - ensure - $stderr = previous_stderr - end - def create_test_file(path = :unit, name = 'test') app_file "test/#{path}/#{name}_test.rb", <<-RUBY require 'test_helper' |