aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/module_test.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-08-25 18:51:17 +0100
committerJon Leighton <j@jonathanleighton.com>2011-08-25 22:30:42 +0100
commit8ba491acc31bf08cf63a83ea0a3c314c52cd020f (patch)
tree617a8a8133b700811cca12942f802bb4c0167904 /activesupport/test/core_ext/module_test.rb
parentbad6803570f5f3b09d277b15c9f272bfae7408da (diff)
downloadrails-8ba491acc31bf08cf63a83ea0a3c314c52cd020f.tar.gz
rails-8ba491acc31bf08cf63a83ea0a3c314c52cd020f.tar.bz2
rails-8ba491acc31bf08cf63a83ea0a3c314c52cd020f.zip
Revert all the stuff to do with disallowing non-public methods for Module#delegate
Diffstat (limited to 'activesupport/test/core_ext/module_test.rb')
-rw-r--r--activesupport/test/core_ext/module_test.rb20
1 files changed, 1 insertions, 19 deletions
diff --git a/activesupport/test/core_ext/module_test.rb b/activesupport/test/core_ext/module_test.rb
index d4ce81fdfa..449d3810e2 100644
--- a/activesupport/test/core_ext/module_test.rb
+++ b/activesupport/test/core_ext/module_test.rb
@@ -28,20 +28,10 @@ end
Somewhere = Struct.new(:street, :city) do
attr_accessor :name
-
- protected
-
- def protected_method
- end
-
- private
-
- def private_method
- end
end
class Someone < Struct.new(:name, :place)
- delegate :street, :city, :to_f, :protected_method, :private_method, :to => :place
+ delegate :street, :city, :to_f, :to => :place
delegate :name=, :to => :place, :prefix => true
delegate :upcase, :to => "place.city"
@@ -93,14 +83,6 @@ class ModuleTest < Test::Unit::TestCase
assert_equal "Fred", @david.place.name
end
- def test_delegation_to_protected_method
- assert_raise(NoMethodError) { @david.protected_method }
- end
-
- def test_delegation_to_private_method
- assert_raise(NoMethodError) { @david.private_method }
- end
-
def test_delegation_down_hierarchy
assert_equal "CHICAGO", @david.upcase
end