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

ruby-changes:41783

From: usa <ko1@a...>
Date: Wed, 17 Feb 2016 23:21:32 +0900 (JST)
Subject: [ruby-changes:41783] usa:r53857 (trunk): * test/ruby/test_dir.rb (TestDir#test_empty?): fix a platform dependent test.

usa	2016-02-17 23:21:57 +0900 (Wed, 17 Feb 2016)

  New Revision: 53857

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

  Log:
    * test/ruby/test_dir.rb (TestDir#test_empty?): fix a platform dependent test.

  Modified files:
    trunk/test/ruby/test_dir.rb
Index: test/ruby/test_dir.rb
===================================================================
--- test/ruby/test_dir.rb	(revision 53856)
+++ test/ruby/test_dir.rb	(revision 53857)
@@ -335,8 +335,15 @@ class TestDir < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_dir.rb#L335
   def test_empty?
     assert_not_send([Dir, :empty?, @root])
     assert_send([Dir, :empty?, File.join(@root, "a")])
-    open(File.join(@root, "a", "..."), "w") {}
+    tmp = File.join(@root, "a", "A")
+    open(tmp, "w") {}
     assert_not_send([Dir, :empty?, File.join(@root, "a")])
+    File.delete(tmp)
+    assert_send([Dir, :empty?, File.join(@root, "a")])
+    unless /mswin|mingw|cygwin/ =~ RUBY_PLATFORM
+      open(File.join(@root, "a", "..."), "w") {}
+      assert_not_send([Dir, :empty?, File.join(@root, "a")])
+    end
     assert_raise(Errno::ENOENT) {Dir.empty?(@nodir)}
     assert_not_send([Dir, :empty?, File.join(@root, "b")])
   end

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

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