Fixed File.file? for non-existent files
This commit is contained in:
parent
bf6f121601
commit
94afbcabc1
@ -128,7 +128,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)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -133,6 +133,10 @@ class FakeFSTest < Test::Unit::TestCase
|
||||
assert File.file?(sympath)
|
||||
end
|
||||
|
||||
def test_knows_non_existent_files_arent_files
|
||||
assert ! 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