diff --git a/lib/fakefs/file.rb b/lib/fakefs/file.rb index 64c5afe..e7ce422 100644 --- a/lib/fakefs/file.rb +++ b/lib/fakefs/file.rb @@ -41,6 +41,9 @@ module FakeFS class << self alias_method :exists?, :exist? + + # Assuming that everyone can read files + alias_method :readable?, :exist? end def self.size(path) diff --git a/test/fakefs_test.rb b/test/fakefs_test.rb index 0d06956..c537cc1 100644 --- a/test/fakefs_test.rb +++ b/test/fakefs_test.rb @@ -94,6 +94,7 @@ class FakeFSTest < Test::Unit::TestCase end assert File.exists?(path) + assert File.readable?(path) end def test_file_opens_in_read_only_mode