Sha256: cd6d6b24fa0519c2cc8d702533a380b9f0f4d7cf5a9efb04f87b00eb2e73d508
Contents?: true
Size: 1.03 KB
Versions: 83
Compression:
Stored size: 1.03 KB
Contents
require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/../../spec_helper' require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/fixtures/classes' describe "Method#==" do before(:each) do @m = MethodSpecs::Methods.new @m2 = MethodSpecs::Methods.new @a = MethodSpecs::A.new end it "returns true if methods are the same" do m1 = @m.method(:foo) m2 = @m.method(:foo) (m1 == m1).should == true (m1 == m2).should == true end it "returns true on aliased methods" do m1 = @m.method(:foo) m2 = @m.method(:bar) (m1 == m2).should == true end it "returns false on a method which is neither aliases nor the same method" do m1 = @m.method(:foo) m2 = @m.method(:zero) (m1 == m2).should == false end it "returns false for a method which is not bound to the same object" do m1 = @m.method(:foo) m2 = @m2.method(:foo) a = @a.method(:baz) (m1 == m2).should == false (m1 == a).should == false (m2 == a).should == false end end
Version data entries
83 entries across 83 versions & 1 rubygems