1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/aws/requests/simpledb/domain_tests.rb
geemus 9a52c94513 [aws|simpledb] fixes
more granular idempotency
convert specs to tests
2011-01-03 18:55:24 -08:00

51 lines
1.5 KiB
Ruby

Shindo.tests('AWS::SimpleDB | domain requests', ['aws']) do
@domain_metadata_format = AWS::SimpleDB::Formats::BASIC.merge({
'AttributeNameCount' => Integer,
'AttributeNamesSizeBytes' => Integer,
'AttributeValueCount' => Integer,
'AttributeValuesSizeBytes' => Integer,
'ItemCount' => Integer,
'ItemNamesSizeBytes' => Integer,
'Timestamp' => Time
})
@domain_name = "fog_domain_#{Time.now.to_f.to_s.gsub('.','')}"
tests('success') do
tests("#create_domain(#{@domain_name})").formats(AWS::SimpleDB::Formats::BASIC) do
AWS[:sdb].create_domain(@domain_name).body
end
tests("#create_domain(#{@domain_name})").succeeds do
AWS[:sdb].create_domain(@domain_name)
end
tests("#domain_metadata(#{@domain_name})").formats(@domain_metadata_format) do
AWS[:sdb].domain_metadata(@domain_name).body
end
tests("#list_domains").formats(AWS::SimpleDB::Formats::BASIC.merge('Domains' => [String])) do
AWS[:sdb].list_domains.body
end
tests("#delete_domain(#{@domain_name})").formats(AWS::SimpleDB::Formats::BASIC) do
AWS[:sdb].delete_domain(@domain_name).body
end
tests("#delete_domain(#{@domain_name})").succeeds do
AWS[:sdb].delete_domain(@domain_name)
end
end
tests('failure') do
tests("#domain_metadata('notadomain')").raises(Excon::Errors::BadRequest) do
AWS[:sdb].domain_metadata('notadomain')
end
end
end