Land #3566, ducktype better

bug/bundler_fix
James Lee 2014-07-24 11:19:40 -05:00
commit 5286b7cc22
No known key found for this signature in database
GPG Key ID: 2D6094C7CEA0A321
2 changed files with 9 additions and 2 deletions

View File

@ -78,7 +78,9 @@ module Metasploit
end
def ==(other)
other.public == self.public && other.private == self.private && other.realm == self.realm
other.respond_to?(:public) && other.public == self.public &&
other.respond_to?(:private) && other.private == self.private &&
other.respond_to?(:realm) && other.realm == self.realm
end
def to_credential

View File

@ -132,6 +132,11 @@ describe Metasploit::Framework::Credential do
expect(other).not_to eq(cred_detail)
end
end
context "when comparing to a different object" do
let(:other) {'a string'}
specify do
expect(other).not_to eq(cred_detail)
end
end
end
end