spec/signet/oauth_1/client_spec.rb in signet-0.1.2 vs spec/signet/oauth_1/client_spec.rb in signet-0.1.3
- old
+ new
@@ -558,13 +558,13 @@
uri.should == 'http://example.com/temporary_credentials'
authorization_header = nil
headers.each do |(header, value)|
authorization_header = value if header == 'Authorization'
end
- parameters = Hash[::Signet::OAuth1.parse_authorization_header(
+ parameters = ::Signet::OAuth1.parse_authorization_header(
authorization_header
- )]
+ ).inject({}) { |h,(k,v)| h[k]=v; h }
parameters.should_not have_key('oauth_client_credential_key')
parameters.should_not have_key('oauth_temporary_credential_key')
parameters.should_not have_key('oauth_token')
parameters['oauth_nonce'].should =~ /^\w+$/
parameters['oauth_callback'].should == @client.callback
@@ -587,13 +587,13 @@
uri.should == 'http://example.com/token_credentials'
authorization_header = nil
headers.each do |(header, value)|
authorization_header = value if header == 'Authorization'
end
- parameters = Hash[::Signet::OAuth1.parse_authorization_header(
+ parameters = ::Signet::OAuth1.parse_authorization_header(
authorization_header
- )]
+ ).inject({}) { |h,(k,v)| h[k]=v; h }
parameters.should_not have_key('oauth_client_credential_key')
parameters.should_not have_key('oauth_temporary_credential_key')
parameters.should_not have_key('oauth_callback')
parameters['oauth_nonce'].should =~ /^\w+$/
parameters['oauth_timestamp'].should =~ /^\d+$/
@@ -625,13 +625,13 @@
authorization_header = nil
headers.each do |(header, value)|
authorization_header = value if header == 'Authorization'
end
merge_body(body).should == ''
- parameters = Hash[::Signet::OAuth1.parse_authorization_header(
+ parameters = ::Signet::OAuth1.parse_authorization_header(
authorization_header
- )]
+ ).inject({}) { |h,(k,v)| h[k]=v; h }
parameters.should_not have_key('oauth_client_credential_key')
parameters.should_not have_key('oauth_temporary_credential_key')
parameters.should_not have_key('oauth_token_credential_key')
parameters.should_not have_key('oauth_callback')
parameters['oauth_nonce'].should =~ /^\w+$/
@@ -667,12 +667,12 @@
authorization_header = nil
headers.each do |(header, value)|
authorization_header = value if header == 'Authorization'
end
merge_body(body).should == 'file=vacation.jpg&size=original'
- parameters = Hash[::Signet::OAuth1.parse_authorization_header(
+ parameters = ::Signet::OAuth1.parse_authorization_header(
authorization_header
- )]
+ ).inject({}) { |h,(k,v)| h[k]=v; h }
parameters.should_not have_key('oauth_client_credential_key')
parameters.should_not have_key('oauth_temporary_credential_key')
parameters.should_not have_key('oauth_token_credential_key')
parameters.should_not have_key('oauth_callback')
parameters['oauth_nonce'].should =~ /^\w+$/