Merge commit 'nakajima/master'
This commit is contained in:
commit
c6d4b3fe5b
@ -112,7 +112,8 @@ module FakeFS
|
||||
if path.respond_to? :entry
|
||||
path.entry.is_a? MockDir
|
||||
else
|
||||
FileSystem.find(path).entry.is_a? MockDir
|
||||
result = FileSystem.find(path)
|
||||
result ? result.entry.is_a?(MockDir) : false
|
||||
end
|
||||
end
|
||||
|
||||
@ -128,7 +129,8 @@ module FakeFS
|
||||
if path.respond_to? :entry
|
||||
path.entry.is_a? MockFile
|
||||
else
|
||||
FileSystem.find(path).entry.is_a? MockFile
|
||||
result = FileSystem.find(path)
|
||||
result ? result.entry.is_a?(MockFile) : false
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -42,6 +42,11 @@ class FakeFSTest < Test::Unit::TestCase
|
||||
assert File.directory?(sympath)
|
||||
end
|
||||
|
||||
def test_knows_non_existent_directories_arent_directories
|
||||
path = 'does/not/exist/'
|
||||
assert_equal RealFile.directory?(path), File.directory?(path)
|
||||
end
|
||||
|
||||
def test_doesnt_overwrite_existing_directories
|
||||
FileUtils.mkdir_p(path = "/path/to/dir")
|
||||
assert File.exists?(path)
|
||||
@ -133,6 +138,10 @@ class FakeFSTest < Test::Unit::TestCase
|
||||
assert File.file?(sympath)
|
||||
end
|
||||
|
||||
def test_knows_non_existent_files_arent_files
|
||||
assert_equal RealFile.file?('does/not/exist.txt'), File.file?('does/not/exist.txt')
|
||||
end
|
||||
|
||||
def test_can_chown_files
|
||||
good = 'file.txt'
|
||||
bad = 'nofile.txt'
|
||||
|
Loading…
Reference in New Issue
Block a user