aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/library/delegate/delegate_class/private_instance_methods_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/delegate/delegate_class/private_instance_methods_spec.rb')
-rw-r--r--spec/ruby/library/delegate/delegate_class/private_instance_methods_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/ruby/library/delegate/delegate_class/private_instance_methods_spec.rb b/spec/ruby/library/delegate/delegate_class/private_instance_methods_spec.rb
new file mode 100644
index 0000000000..d93b6d0e3d
--- /dev/null
+++ b/spec/ruby/library/delegate/delegate_class/private_instance_methods_spec.rb
@@ -0,0 +1,23 @@
+require File.expand_path('../../../../spec_helper', __FILE__)
+require File.expand_path('../../fixtures/classes', __FILE__)
+
+describe "DelegateClass.private_instance_methods" do
+ before :all do
+ @methods = DelegateSpecs::DelegateClass.private_instance_methods
+ end
+
+ it "does not include any instance methods of the delegated class" do
+ @methods.should_not include :pub
+ @methods.should_not include :prot
+ @methods.should_not include :priv # since these are not forwarded...
+ end
+
+ it "includes private instance methods of the DelegateClass class" do
+ @methods.should include :extra_private
+ end
+
+ it "does not include public or protected instance methods of the DelegateClass class" do
+ @methods.should_not include :extra
+ @methods.should_not include :extra_protected
+ end
+end