[前][次][番号順一覧][スレッド一覧]

ruby-changes:34602

From: hsbt <ko1@a...>
Date: Fri, 4 Jul 2014 09:47:58 +0900 (JST)
Subject: [ruby-changes:34602] hsbt:r46683 (trunk): Revert "test/rdoc: avoid tempfile leaks"

hsbt	2014-07-04 09:47:44 +0900 (Fri, 04 Jul 2014)

  New Revision: 46683

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46683

  Log:
    Revert "test/rdoc: avoid tempfile leaks"
    
    This reverts commit r46145.
    
    Tempfile.create is only available Ruby 2.1 or higher.
    rubygems need to support Ruby 1.9 and 2.0 series.

  Modified files:
    trunk/test/rubygems/test_gem_package.rb
    trunk/test/rubygems/test_gem_request_set.rb
    trunk/test/rubygems/test_gem_request_set_gem_dependency_api.rb
Index: test/rubygems/test_gem_package.rb
===================================================================
--- test/rubygems/test_gem_package.rb	(revision 46682)
+++ test/rubygems/test_gem_package.rb	(revision 46683)
@@ -621,7 +621,7 @@ class TestGemPackage < Gem::Package::Tar https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_package.rb#L621
   end
 
   def test_verify_corrupt
-    Tempfile.create 'corrupt' do |io|
+    Tempfile.open 'corrupt' do |io|
       data = Gem.gzip 'a' * 10
       io.write \
         tar_file_header('metadata.gz', "\000x", 0644, data.length, Time.now)
Index: test/rubygems/test_gem_request_set.rb
===================================================================
--- test/rubygems/test_gem_request_set.rb	(revision 46682)
+++ test/rubygems/test_gem_request_set.rb	(revision 46683)
@@ -156,7 +156,7 @@ DEPENDENCIES https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_request_set.rb#L156
   def test_load_gemdeps
     rs = Gem::RequestSet.new
 
-    Tempfile.create 'gem.deps.rb' do |io|
+    Tempfile.open 'gem.deps.rb' do |io|
       io.puts 'gem "a"'
       io.flush
 
@@ -172,7 +172,7 @@ DEPENDENCIES https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_request_set.rb#L172
   def test_load_gemdeps_without_groups
     rs = Gem::RequestSet.new
 
-    Tempfile.create 'gem.deps.rb' do |io|
+    Tempfile.open 'gem.deps.rb' do |io|
       io.puts 'gem "a", :group => :test'
       io.flush
 
@@ -202,7 +202,7 @@ DEPENDENCIES https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_request_set.rb#L202
 
     rs = Gem::RequestSet.new
 
-    Tempfile.create 'gem.deps.rb' do |io|
+    Tempfile.open 'gem.deps.rb' do |io|
       io.puts <<-gems_deps_rb
         gem "#{name}", :git => "#{repository}"
       gems_deps_rb
@@ -263,7 +263,7 @@ DEPENDENCIES https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_request_set.rb#L263
 
     rs = Gem::RequestSet.new
 
-    Tempfile.create 'gem.deps.rb' do |io|
+    Tempfile.open 'gem.deps.rb' do |io|
       io.puts <<-gems_deps_rb
         gem "#{a_name}", :path => "#{a_directory}"
         gem "#{b_name}", :path => "#{b_directory}"
Index: test/rubygems/test_gem_request_set_gem_dependency_api.rb
===================================================================
--- test/rubygems/test_gem_request_set_gem_dependency_api.rb	(revision 46682)
+++ test/rubygems/test_gem_request_set_gem_dependency_api.rb	(revision 46683)
@@ -492,7 +492,7 @@ class TestGemRequestSetGemDependencyAPI https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_request_set_gem_dependency_api.rb#L492
   end
 
   def test_load
-    Tempfile.create 'gem.deps.rb' do |io|
+    Tempfile.open 'gem.deps.rb' do |io|
       io.write <<-GEM_DEPS
 gem 'a'
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]