1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Rewrite tests to use 1.8 compatible Hash syntax

This commit is contained in:
Paul Thornthwaite 2012-08-14 10:45:16 +01:00
parent dfe13342a9
commit 7c7c392a84
2 changed files with 8 additions and 8 deletions

View file

@ -14,7 +14,7 @@ Shindo.tests("Fog::Compute[:iam] | policies", ['aws','iam']) do
tests('#create') do tests('#create') do
tests('a valid policy').succeeds do tests('a valid policy').succeeds do
policy = @user.policies.create(id: @policy_name, document: @policy_document) policy = @user.policies.create(:id => @policy_name, :document => @policy_document)
policy.id == @policy_name policy.id == @policy_name
policy.username == @username policy.username == @username
policy.document == @policy_document policy.document == @policy_document
@ -26,7 +26,7 @@ Shindo.tests("Fog::Compute[:iam] | policies", ['aws','iam']) do
#end #end
end end
@user.policies.create(id: 'another-policy', document: {}) @user.policies.create(:id => 'another-policy', :document => {})
tests('#all','there are two policies').succeeds do tests('#all','there are two policies').succeeds do
@user.policies.size == 2 @user.policies.size == 2

View file

@ -5,13 +5,13 @@ Shindo.tests('AWS | url') do
@expires = DateTime.parse('2013-01-01T00:00:00Z').to_time.utc.to_i @expires = DateTime.parse('2013-01-01T00:00:00Z').to_time.utc.to_i
@storage = Fog::Storage.new( @storage = Fog::Storage.new(
provider: 'AWS', :provider => 'AWS',
aws_access_key_id: '123', :aws_access_key_id => '123',
aws_secret_access_key: 'abc', :aws_secret_access_key => 'abc',
region: 'us-east-1' :region => 'us-east-1'
) )
@file = @storage.directories.new(key: 'fognonbucket').files.new(key: 'test.txt') @file = @storage.directories.new(:key => 'fognonbucket').files.new(:key => 'test.txt')
if Fog.mock? if Fog.mock?
signature = Fog::Storage::AWS.new.signature(nil) signature = Fog::Storage::AWS.new.signature(nil)
@ -22,7 +22,7 @@ Shindo.tests('AWS | url') do
tests('#url w/ response-cache-control').returns( tests('#url w/ response-cache-control').returns(
"https://fognonbucket.s3.amazonaws.com/test.txt?response-cache-control=No-cache&AWSAccessKeyId=123&Signature=#{signature}&Expires=1356998400" "https://fognonbucket.s3.amazonaws.com/test.txt?response-cache-control=No-cache&AWSAccessKeyId=123&Signature=#{signature}&Expires=1356998400"
) do ) do
@file.url(@expires, query: { 'response-cache-control' => 'No-cache' }) @file.url(@expires, :query => { 'response-cache-control' => 'No-cache' })
end end
end end