ruby-changes:27847
From: akr <ko1@a...>
Date: Sun, 24 Mar 2013 11:06:43 +0900 (JST)
Subject: [ruby-changes:27847] akr:r39899 (trunk): * test/ruby/test_require.rb: Remove temporally files in the tests.
akr 2013-03-24 11:06:32 +0900 (Sun, 24 Mar 2013) New Revision: 39899 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39899 Log: * test/ruby/test_require.rb: Remove temporally files in the tests. * test/ruby/test_rubyoptions.rb: Ditto. * test/logger/test_logger.rb: Ditto. * test/psych/test_psych.rb: Ditto. * test/readline/test_readline.rb: Ditto. * test/syslog/test_syslog_logger.rb: Ditto. * test/webrick/test_httpauth.rb: Ditto. * test/zlib/test_zlib.rb: Ditto. Modified files: trunk/ChangeLog trunk/test/logger/test_logger.rb trunk/test/psych/test_psych.rb trunk/test/readline/test_readline.rb trunk/test/ruby/test_require.rb trunk/test/ruby/test_rubyoptions.rb trunk/test/syslog/test_syslog_logger.rb trunk/test/webrick/test_httpauth.rb trunk/test/zlib/test_zlib.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 39898) +++ ChangeLog (revision 39899) @@ -1,3 +1,21 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sun Mar 24 11:03:31 2013 Tanaka Akira <akr@f...> + + * test/ruby/test_require.rb: Remove temporally files in the tests. + + * test/ruby/test_rubyoptions.rb: Ditto. + + * test/logger/test_logger.rb: Ditto. + + * test/psych/test_psych.rb: Ditto. + + * test/readline/test_readline.rb: Ditto. + + * test/syslog/test_syslog_logger.rb: Ditto. + + * test/webrick/test_httpauth.rb: Ditto. + + * test/zlib/test_zlib.rb: Ditto. + Sun Mar 24 05:36:29 2013 Eric Hodel <drbrain@s...> * lib/rinda/ring.rb: Added documentation for multicast support. Index: test/logger/test_logger.rb =================================================================== --- test/logger/test_logger.rb (revision 39898) +++ test/logger/test_logger.rb (revision 39899) @@ -46,7 +46,7 @@ class TestLogger < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/logger/test_logger.rb#L46 logger.__send__(msg_id, *arg, &block) logdev.open msg = logdev.read - logdev.close + logdev.close(true) msg end Index: test/syslog/test_syslog_logger.rb =================================================================== --- test/syslog/test_syslog_logger.rb (revision 39898) +++ test/syslog/test_syslog_logger.rb (revision 39899) @@ -85,7 +85,7 @@ class TestSyslogRootLogger < Test::Unit: https://github.com/ruby/ruby/blob/trunk/test/syslog/test_syslog_logger.rb#L85 assert_equal true, @logger.__send__(msg_id, *arg, &block) logdev.open msg = logdev.read - logdev.close + logdev.close(true) msg end Index: test/ruby/test_require.rb =================================================================== --- test/ruby/test_require.rb (revision 39898) +++ test/ruby/test_require.rb (revision 39899) @@ -26,6 +26,7 @@ class TestRequire < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_require.rb#L26 p :ok end INPUT + t.close(true) end def test_require_too_long_filename @@ -101,6 +102,7 @@ class TestRequire < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_require.rb#L102 ensure env_rubypath ? ENV["RUBYPATH"] = env_rubypath : ENV.delete("RUBYPATH") env_home ? ENV["HOME"] = env_home : ENV.delete("HOME") + t.close(true) end def test_require_with_unc @@ -258,6 +260,7 @@ class TestRequire < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_require.rb#L260 INPUT assert_raise(ArgumentError) { at_exit } + t.close(true) end def test_load2 # [ruby-core:25039] @@ -271,6 +274,7 @@ class TestRequire < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_require.rb#L274 assert_in_out_err([], <<-INPUT, %w("hello"), []) load(#{ t.path.dump }, true) INPUT + t.close(true) end def test_tainted_loadpath @@ -320,6 +324,8 @@ class TestRequire < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_require.rb#L324 require "#{ file }" p :ok INPUT + + t.close(true) end def test_relative Index: test/ruby/test_rubyoptions.rb =================================================================== --- test/ruby/test_rubyoptions.rb (revision 39898) +++ test/ruby/test_rubyoptions.rb (revision 39899) @@ -528,7 +528,7 @@ class TestRubyOptions < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rubyoptions.rb#L528 t.flush assert_in_out_err(["-e", "$0=ARGV[0]; Process.kill :SEGV, $$", t.path], "", [], expected_stderr, bug7597, opts) - t.close + t.close(true) end def test_DATA Index: test/zlib/test_zlib.rb =================================================================== --- test/zlib/test_zlib.rb (revision 39898) +++ test/zlib/test_zlib.rb (revision 39899) @@ -439,6 +439,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L439 Zlib::GzipReader.open(t.path) do |f| assert_kind_of(IO, f.to_io) end + t.close(true) end def test_crc @@ -450,6 +451,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L451 f.read assert_equal(0x8c736521, f.crc) end + t.close(true) end def test_mtime @@ -468,6 +470,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L470 Zlib::GzipReader.open(t.path) do |f| assert_equal(tim.to_i, f.mtime.to_i) end + t.close(true) end def test_level @@ -478,6 +481,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L481 Zlib::GzipReader.open(t.path) do |f| assert_equal(Zlib::DEFAULT_COMPRESSION, f.level) end + t.close(true) end def test_os_code @@ -488,6 +492,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L492 Zlib::GzipReader.open(t.path) do |f| assert_equal(Zlib::OS_CODE, f.os_code) end + t.close(true) end def test_orig_name @@ -503,6 +508,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L508 Zlib::GzipReader.open(t.path) do |f| assert_equal("foobarbazqux", f.orig_name) end + t.close(true) end def test_comment @@ -518,6 +524,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L524 Zlib::GzipReader.open(t.path) do |f| assert_equal("foobarbazqux", f.comment) end + t.close(true) end def test_lineno @@ -532,6 +539,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L539 assert_equal([1000, "baz\n"], [f.lineno, f.gets]) assert_equal([1001, "qux\n"], [f.lineno, f.gets]) end + t.close(true) end def test_closed_p @@ -546,6 +554,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L554 f.close assert_equal(true, f.closed?) end + t.close(true) end def test_sync @@ -560,6 +569,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L569 f.sync = false assert_equal(false, f.sync) end + t.close(true) end def test_pos @@ -570,6 +580,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L580 gz.flush assert_equal(3, gz.tell) end + t.close(true) end def test_path @@ -599,6 +610,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L610 Zlib::GzipReader.new(sio) do |f| assert_raise(NoMethodError) { f.path } end + t.close(true) end end @@ -670,6 +682,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L682 ensure f.close end + t.close(true) end def test_rewind @@ -682,6 +695,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L695 f.rewind assert_equal("foo", f.read) end + t.close(true) end def test_unused @@ -696,6 +710,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L710 assert_equal("bar", f.read) assert_equal(nil, f.unused) end + t.close(true) end def test_unused2 @@ -735,6 +750,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L750 assert_raise(ArgumentError) { f.read(-1) } assert_equal(str, f.read) end + t.close(true) end def test_readpartial @@ -753,6 +769,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L769 assert_raise(ArgumentError) { f.readpartial(-1) } end + t.close(true) end def test_getc @@ -764,6 +781,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L781 "foobar".each_char {|c| assert_equal(c, f.getc) } assert_nil(f.getc) end + t.close(true) end def test_getbyte @@ -775,6 +793,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L793 "foobar".each_byte {|c| assert_equal(c, f.getbyte) } assert_nil(f.getbyte) end + t.close(true) end def test_readchar @@ -786,6 +805,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L805 "foobar".each_byte {|c| assert_equal(c, f.readchar.ord) } assert_raise(EOFError) { f.readchar } end + t.close(true) end def test_each_byte @@ -798,6 +818,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L818 f.each_byte {|c| a << c } assert_equal("foobar".each_byte.to_a, a) end + t.close(true) end def test_gets @@ -823,6 +844,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L844 assert_equal("az\n", f.gets(nil, 10)) assert_nil(f.gets) end + t.close(true) end def test_gets2 @@ -849,6 +871,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L871 assert_equal(ustrs[2][1..-1], f.gets(nil, 20)) assert_nil(f.gets) end + t.close(true) end def test_readline @@ -862,6 +885,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L885 assert_equal("baz\n", f.readline) assert_raise(EOFError) { f.readline } end + t.close(true) end def test_each @@ -873,6 +897,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L897 a = ["foo\n", "bar\n", "baz\n"] f.each {|l| assert_equal(a.shift, l) } end + t.close(true) end def test_readlines @@ -883,6 +908,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L908 Zlib::GzipReader.open(t.path) do |f| assert_equal(["foo\n", "bar\n", "baz\n"], f.readlines) end + t.close(true) end def test_reader_wrap @@ -893,6 +919,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L919 f.binmode assert_equal("foo", Zlib::GzipReader.wrap(f) {|gz| gz.read }) assert_raise(IOError) { f.close } + t.close(true) end def test_corrupted_header @@ -923,6 +950,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L950 read_size = Zlib::GzipReader.open(t.path) {|gz| gz.read(1024) } assert_equal(Encoding::ASCII_8BIT, read_size.encoding) assert_equal(content, read_size) + t.close(true) end end @@ -951,6 +979,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L979 assert_equal("bar", Zlib::GzipReader.open(t.path) {|gz| gz.read }) assert_raise(Zlib::StreamError) { Zlib::GzipWriter.open(t.path, 10000) } + t.close(true) end def test_write @@ -963,6 +992,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L992 def o.to_s; "bar"; end Zlib::GzipWriter.open(t.path) {|gz| gz.print(o) } assert_equal("bar", Zlib::GzipReader.open(t.path) {|gz| gz.read }) + t.close(true) end def test_putc @@ -972,6 +1002,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L1002 assert_equal("x", Zlib::GzipReader.open(t.path) {|gz| gz.read }) # todo: multibyte char + t.close(true) end def test_writer_wrap @@ -980,6 +1011,7 @@ if defined? Zlib https://github.com/ruby/ruby/blob/trunk/test/zlib/test_zlib.rb#L1011 Zlib::GzipWriter.wrap(t) {|gz| gz.print("foo") } t.close assert_equal("foo", Zlib::GzipReader.open(t.path) {|gz| gz.read }) + t.close(true) end end Index: test/webrick/test_httpauth.rb =================================================================== --- test/webrick/test_httpauth.rb (revision 39898) +++ test/webrick/test_httpauth.rb (revision 39899) @@ -59,6 +59,7 @@ class TestWEBrickHTTPAuth < Test::Unit:: https://github.com/ruby/ruby/blob/trunk/test/webrick/test_httpauth.rb#L59 http.request(g){|res| assert_equal("hoge", res.body, log.call)} g.basic_auth("webrick", "not super") http.request(g){|res| assert_not_equal("hoge", res.body, log.call)} + tmpfile.close(true) } end @@ -140,6 +141,7 @@ class TestWEBrickHTTPAuth < Test::Unit:: https://github.com/ruby/ruby/blob/trunk/test/webrick/test_httpauth.rb#L141 g['Authorization'] = credentials_for_request('webrick', "not super", params) http.request(g){|res| assert_not_equal("hoge", res.body, log.call)} end + tmpfile.close(true) } end Index: test/readline/test_readline.rb =================================================================== --- test/readline/test_readline.rb (revision 39898) +++ test/readline/test_readline.rb (revision 39899) @@ -396,6 +396,8 @@ class TestReadline < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/readline/test_readline.rb#L396 Readline.pre_input_hook = nil rescue NotImplementedError end + stdin.close(true) + stdout.close(true) end end if !/EditLine|\A4\.3\z/n.match(Readline::VERSION) Index: test/psych/test_psych.rb =================================================================== --- test/psych/test_psych.rb (revision 39898) +++ test/psych/test_psych.rb (revision 39899) @@ -68,6 +68,7 @@ class TestPsych < Psych::TestCase https://github.com/ruby/ruby/blob/trunk/test/psych/test_psych.rb#L68 assert_equal io, Psych.dump(hash, io) io.rewind assert_equal Psych.dump(hash), io.read + io.close(true) end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/