diff options
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.rb | 23 |
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..18ca2a4c88 --- /dev/null +++ b/spec/ruby/library/delegate/delegate_class/private_instance_methods_spec.rb @@ -0,0 +1,23 @@ +require_relative '../../../spec_helper' +require_relative '../fixtures/classes' + +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 |
