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
|
2009-05-24 12:11:32 -04:00
|
|
|
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
|
2009-05-24 12:11:32 -04:00
|
|
|
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' } })
|
2009-05-24 12:11:32 -04:00
|
|
|
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
|
2009-05-24 12:11:32 -04:00
|
|
|
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
|
2009-05-24 12:11:32 -04:00
|
|
|
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
|