From 166ff444d9c4f781c02c30b21b9e0c658b2ed715 Mon Sep 17 00:00:00 2001 From: Nick Quaranto Date: Tue, 29 Sep 2009 11:00:36 -0400 Subject: [PATCH] Aliasing File.readable? to File.exist? so Rack::File can work --- lib/fakefs/file.rb | 3 +++ test/fakefs_test.rb | 1 + 2 files changed, 4 insertions(+) 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