use to_h instead of to_hash

apparently ruby 2 adds this as a standard method so
we should stay compliant
This commit is contained in:
David Maloney 2014-08-01 09:45:51 -05:00
parent 0e65792f43
commit dbde046f44
No known key found for this signature in database
GPG Key ID: DEDBA9DC3A913DB2
2 changed files with 7 additions and 3 deletions

View File

@ -90,7 +90,11 @@ module Metasploit
self
end
def to_hash
# This method takes all of the attributes of the {Credential} and spits
# them out in a hash compatible with the create_credential calls.
#
# @return [Hash] a hash compatible with #create_credential
def to_h
{
private_data: private,
private_type: private_type,

View File

@ -143,7 +143,7 @@ describe Metasploit::Framework::Credential do
end
end
describe '#to_hash' do
describe '#to_h' do
subject(:cred_detail) do
described_class.new(public: public, private: private, realm: realm, realm_key: realm_type, private_type: private_type)
end
@ -155,7 +155,7 @@ describe Metasploit::Framework::Credential do
realm_key: realm_type,
realm_value: realm
}
expect(cred_detail.to_hash).to eq cred_hash
expect(cred_detail.to_h).to eq cred_hash
end
end
end