test/gettext-test-utils.rb in gettext-3.2.9 vs test/gettext-test-utils.rb in gettext-3.3.0

- old
+ new

@@ -1,9 +1,7 @@ -# -*- coding: utf-8 -*- +# Copyright (C) 2012-2018 Kouhei Sutou <kou@clear-code.com> # -# Copyright (C) 2012-2013 Kouhei Sutou <kou@clear-code.com> -# # License: Ruby's or LGPL # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or @@ -38,7 +36,16 @@ @tmpdir = Dir.mktmpdir end def teardown_tmpdir FileUtils.rm_rf(@tmpdir, :secure => true) if @tmpdir + end + + def suppress_warning + stderr, $stderr = $stderr, StringIO.new + begin + yield + ensure + $stderr = stderr + end end end