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

ruby-changes:45150

From: usa <ko1@a...>
Date: Tue, 27 Dec 2016 20:43:11 +0900 (JST)
Subject: [ruby-changes:45150] usa:r57223 (ruby_2_2): merge revision(s) 56884, 56892: [Backport #12910]

usa	2016-12-27 20:43:07 +0900 (Tue, 27 Dec 2016)

  New Revision: 57223

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

  Log:
    merge revision(s) 56884,56892: [Backport #12910]
    
    test_fileutils.rb: Use primary group too
    
    * test/fileutils/test_fileutils.rb (TestFileUtils#setup): Use
      primary group as well as supplementary groups.  based on the
      patch by Vit Ondruch at [ruby-core:78053].  [Bug #12910]
    
    It might happen in certain environments (systemd-nspawn) that
    process has no supplementary groups, but primary groups should be
    enough to pass most of the tests.

  Modified directories:
    branches/ruby_2_2/
  Modified files:
    branches/ruby_2_2/test/fileutils/test_fileutils.rb
    branches/ruby_2_2/version.h
Index: ruby_2_2/version.h
===================================================================
--- ruby_2_2/version.h	(revision 57222)
+++ ruby_2_2/version.h	(revision 57223)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1
 #define RUBY_VERSION "2.2.7"
 #define RUBY_RELEASE_DATE "2016-12-27"
-#define RUBY_PATCHLEVEL 413
+#define RUBY_PATCHLEVEL 414
 
 #define RUBY_RELEASE_YEAR 2016
 #define RUBY_RELEASE_MONTH 12
Index: ruby_2_2/test/fileutils/test_fileutils.rb
===================================================================
--- ruby_2_2/test/fileutils/test_fileutils.rb	(revision 57222)
+++ ruby_2_2/test/fileutils/test_fileutils.rb	(revision 57223)
@@ -17,8 +17,11 @@ class TestFileUtils < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/fileutils/test_fileutils.rb#L17
       fu.instance_variable_set(:@fileutils_output, write)
       th = Thread.new { read.read }
       th2 = Thread.new {
-        yield
-        write.close
+        begin
+          yield
+        ensure
+          write.close
+        end
       }
       th_value, _ = assert_join_threads([th, th2])
       lines = th_value.lines.map {|l| l.chomp }
@@ -136,7 +139,7 @@ class TestFileUtils < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/fileutils/test_fileutils.rb#L139
 
   def setup
     @prevdir = Dir.pwd
-    @groups = Process.groups if have_file_perm?
+    @groups = [Process.gid] | Process.groups if have_file_perm?
     tmproot = TMPROOT
     mymkdir tmproot unless File.directory?(tmproot)
     Dir.chdir tmproot
@@ -208,6 +211,16 @@ class TestFileUtils < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/fileutils/test_fileutils.rb#L211
   # Test Cases
   #
 
+  def test_assert_output_lines
+    assert_raise(MiniTest::Assertion) {
+      Timeout.timeout(0.1) {
+        assert_output_lines([]) {
+          raise "ok"
+        }
+      }
+    }
+  end
+
   def test_pwd
     check_singleton :pwd
 

Property changes on: ruby_2_2
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r56884,56892


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

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