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 | f4c54f8bd7d40804900ad1e143ea672e2eb5cea6 (patch) | |
tree | 0ffe9e0ff6203ff742539ab73f020f6271a58878 /test | |
parent | c0a601a55ef2ab3904556a76a80b640b290210b7 (diff) | |
download | ruby-f4c54f8bd7d40804900ad1e143ea672e2eb5cea6.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
Diffstat (limited to 'test')
-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 |