diff --git a/lib/fakefs.rb b/lib/fakefs.rb index 54913b0..11f5e36 100644 --- a/lib/fakefs.rb +++ b/lib/fakefs.rb @@ -129,7 +129,7 @@ module FakeFS path.entry.is_a? MockFile else result = FileSystem.find(path) - result && result.entry.is_a?(MockFile) + result ? result.entry.is_a?(MockFile) : false end end diff --git a/test/fakefs_test.rb b/test/fakefs_test.rb index 36abfd7..058df0d 100644 --- a/test/fakefs_test.rb +++ b/test/fakefs_test.rb @@ -134,7 +134,7 @@ class FakeFSTest < Test::Unit::TestCase end def test_knows_non_existent_files_arent_files - assert ! File.file?('does/not/exist.txt') + assert_equal RealFile.file?('does/not/exist.txt'), File.file?('does/not/exist.txt') end def test_can_chown_files