From 481e49c64f790e46f4aff3ed539ed227d2eb46cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Fri, 2 Jan 2015 22:08:41 -0300 Subject: Remove deprecated methods at `Kernel`. `silence_stderr`, `silence_stream`, `capture` and `quietly`. --- railties/test/isolation/abstract_unit.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'railties/test/isolation') diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb index 9ad0ec0d34..39e8a5f756 100644 --- a/railties/test/isolation/abstract_unit.rb +++ b/railties/test/isolation/abstract_unit.rb @@ -338,6 +338,16 @@ class ActiveSupport::TestCase end end end + + def silence_stream(stream) + old_stream = stream.dup + stream.reopen(RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ ? 'NUL:' : '/dev/null') + stream.sync = true + yield + ensure + stream.reopen(old_stream) + old_stream.close + end end # Create a scope and build a fixture rails app -- cgit v1.2.3 From 69e365d2f420572d186cb3e0373e067c1343d09f Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 7 Jan 2015 15:29:45 +0900 Subject: Use IO::NULL always --- railties/test/isolation/abstract_unit.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/test/isolation') diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb index 39e8a5f756..17c3f979c0 100644 --- a/railties/test/isolation/abstract_unit.rb +++ b/railties/test/isolation/abstract_unit.rb @@ -341,7 +341,7 @@ class ActiveSupport::TestCase def silence_stream(stream) old_stream = stream.dup - stream.reopen(RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ ? 'NUL:' : '/dev/null') + stream.reopen(IO::NULL) stream.sync = true yield ensure -- cgit v1.2.3 From 88ff9fd2a36bdf9bce62d2d0c701ffce65616509 Mon Sep 17 00:00:00 2001 From: Prathamesh Sonpatki Date: Sat, 17 Jan 2015 22:15:15 +0530 Subject: Fixed test for assert_welcome - Test was wrongly using assert with assignment statement. --- railties/test/isolation/abstract_unit.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'railties/test/isolation') diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb index 17c3f979c0..2c4d9c5995 100644 --- a/railties/test/isolation/abstract_unit.rb +++ b/railties/test/isolation/abstract_unit.rb @@ -69,7 +69,8 @@ module TestHelpers def assert_welcome(resp) assert_equal 200, resp[0] - assert resp[1]["Content-Type"] = "text/html" + assert_match 'text/html', resp[1]["Content-Type"] + assert_match 'charset=utf-8', resp[1]["Content-Type"] assert extract_body(resp).match(/Welcome aboard/) end -- cgit v1.2.3