method_missing should always be private

This commit is contained in:
Scott Taylor 2009-09-29 22:57:14 -04:00
parent a9877659d1
commit cb9de5938f
2 changed files with 17 additions and 4 deletions

View File

@ -15,12 +15,14 @@ module FakeFS
FileSystem.find(target)
end
def method_missing(*args, &block)
entry.send(*args, &block)
end
def respond_to?(method)
entry.respond_to?(method)
end
private
def method_missing(*args, &block)
entry.send(*args, &block)
end
end
end

11
test/fake/symlink_test.rb Normal file
View File

@ -0,0 +1,11 @@
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', '..', 'lib')
require 'fakefs/safe'
require 'test/unit'
class FakeSymlinkTest < Test::Unit::TestCase
include FakeFS
def test_symlink_has_method_missing_as_private
assert FakeSymlink.private_instance_methods.include?("method_missing")
end
end