diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-02-17 14:21:57 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-02-17 14:21:57 +0000 |
commit | 6202b67dd21ce1c73398b500aaacd415a6dd6e75 (patch) | |
tree | 0ffe9e0ff6203ff742539ab73f020f6271a58878 | |
parent | 0201900d76c9b05000924dd74b98892db7be3d6e (diff) | |
download | ruby-6202b67dd21ce1c73398b500aaacd415a6dd6e75.tar.gz |
* test/ruby/test_dir.rb (TestDir#test_empty?): fix a platform dependent test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/ruby/test_dir.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/ruby/test_dir.rb b/test/ruby/test_dir.rb index 88033158b7..e3429a2be5 100644 --- a/test/ruby/test_dir.rb +++ b/test/ruby/test_dir.rb @@ -335,8 +335,15 @@ class TestDir < Test::Unit::TestCase 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 |