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

35 lines
1.4 KiB
Ruby
Raw Normal View History

2009-05-19 02:06:49 -04:00
require File.dirname(__FILE__) + '/../../spec_helper'
describe 'SimpleDB.batch_put_attributes' do
before(:all) do
sdb.create_domain('batch_put_attributes')
end
after(:all) do
sdb.delete_domain('batch_put_attributes')
end
it 'should have no attributes for y before batch_put_attributes' do
lambda { sdb.get_attributes('batch_put_attributes', 'a') }.should eventually { |expected| expected.body[:attributes].should be_empty }
2009-05-19 02:06:49 -04:00
end
it 'should have no attributes for x before batch_put_attributes' do
lambda { sdb.get_attributes('batch_put_attributes', 'x') }.should eventually { |expected| expected.body[:attributes].should be_empty }
2009-05-19 02:06:49 -04:00
end
it 'should return proper attributes from batch_put_attributes' do
actual = sdb.batch_put_attributes('batch_put_attributes', { 'a' => { 'b' => 'c' }, 'x' => { 'y' => 'z' } })
actual.body[:request_id].should be_a(String)
actual.body[:box_usage].should be_a(Float)
2009-05-19 02:06:49 -04:00
end
it 'should have correct attributes for a after batch_put_attributes' do
lambda { sdb.get_attributes('batch_put_attributes', 'a') }.should eventually { |expected| expected.body[:attributes].should == { 'b' => ['c'] } }
2009-05-19 02:06:49 -04:00
end
it 'should have correct attributes for x after batch_put_attributes' do
lambda { sdb.get_attributes('batch_put_attributes', 'x') }.should eventually { |expected| expected.body[:attributes].should == { 'y' => ['z'] } }
2009-05-19 02:06:49 -04:00
end
end