mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test for File#lstat.
* test/ruby/test_file_exhaustive.rb (test_lstat): Add lacking test for File#lstat. [Fix GH-1231] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9286266137
commit
8b9cd1dbb2
2 changed files with 15 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
Sun Jan 31 12:19:15 2016 Kuniaki IGARASHI <igaiga@gmail.com>
|
||||
|
||||
* test/ruby/test_file_exhaustive.rb (test_lstat): Add lacking test
|
||||
for File#lstat. [Fix GH-1231]
|
||||
|
||||
Sun Jan 31 12:15:33 2016 Prayag Verma <prayag.verma@gmail.com>
|
||||
|
||||
* doc/standard_library.rdoc: fix typo [Fix GH-1230]
|
||||
|
|
|
@ -255,6 +255,16 @@ class TestFileExhaustive < Test::Unit::TestCase
|
|||
end
|
||||
end if NTFS
|
||||
|
||||
def test_lstat
|
||||
return unless symlinkfile
|
||||
assert_equal(false, File.stat(symlinkfile).symlink?)
|
||||
assert_equal(true, File.lstat(symlinkfile).symlink?)
|
||||
f = File.new(symlinkfile)
|
||||
assert_equal(false, f.stat.symlink?)
|
||||
assert_equal(true, f.lstat.symlink?)
|
||||
f.close
|
||||
end
|
||||
|
||||
def test_directory_p
|
||||
assert_file.directory?(@dir)
|
||||
assert_file.not_directory?(@dir+"/...")
|
||||
|
|
Loading…
Reference in a new issue