spec/signet/oauth_1/credential_spec.rb in signet-0.1.2 vs spec/signet/oauth_1/credential_spec.rb in signet-0.1.3
- old
+ new
@@ -64,11 +64,11 @@
end
it 'should allow parameters to be specified as an implicit Hash' do
class ParameterHashSet
def initialize(parameters)
- @parameters = Hash[parameters]
+ @parameters = parameters.inject({}) { |h,(k,v)| h[k]=v; h }
end
def to_hash
return @parameters
end
@@ -154,10 +154,10 @@
it 'should convert to a Hash object' do
token = Signet::OAuth1::Credential.new(
"dpf43f3p2l4k3l03", "kd94hf93k423kf44"
)
- parameters = Hash[token]
+ parameters = token.to_h
parameters['oauth_token'].should == "dpf43f3p2l4k3l03"
parameters['oauth_token_secret'].should == "kd94hf93k423kf44"
end
end