Sha256: 7240d95f937c9a4df2a20bc348b01978474acfc00533ef58f3a636d560221724
Contents?: true
Size: 650 Bytes
Versions: 33
Compression:
Stored size: 650 Bytes
Contents
module PublicMethodsSpecs class Parent def parent_method end end class Child < Parent def child_method end end end describe "Kernel#public_methods" do it "lists methods available on an object" do child = PublicMethodsSpecs::Child.new child.public_methods.include?("parent_method").should == true child.public_methods.include?("child_method").should == true end it "lists only those methods in the receiver if false is passed" do child = PublicMethodsSpecs::Child.new def child.singular_method; 1123; end child.public_methods(false).sort.should == ["child_method", "singular_method"] end end
Version data entries
33 entries across 33 versions & 1 rubygems