From cb9de5938fcdcf61a3e2113899c6bcd2372ceba4 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Tue, 29 Sep 2009 22:57:14 -0400 Subject: [PATCH] method_missing should always be private --- lib/fakefs/fake/symlink.rb | 10 ++++++---- test/fake/symlink_test.rb | 11 +++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 test/fake/symlink_test.rb diff --git a/lib/fakefs/fake/symlink.rb b/lib/fakefs/fake/symlink.rb index aef056e..f4a81e9 100644 --- a/lib/fakefs/fake/symlink.rb +++ b/lib/fakefs/fake/symlink.rb @@ -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 diff --git a/test/fake/symlink_test.rb b/test/fake/symlink_test.rb new file mode 100644 index 0000000..2c59c69 --- /dev/null +++ b/test/fake/symlink_test.rb @@ -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 \ No newline at end of file