2009-05-18 23:06:49 -07:00
|
|
|
require File.dirname(__FILE__) + '/../../spec_helper'
|
|
|
|
|
|
|
|
describe 'SimpleDB.domain_metadata' do
|
|
|
|
|
|
|
|
before(:all) do
|
|
|
|
sdb.create_domain('domain_metadata')
|
|
|
|
end
|
|
|
|
|
|
|
|
after(:all) do
|
|
|
|
sdb.delete_domain('domain_metadata')
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'should return proper attributes when there are no items' do
|
|
|
|
results = sdb.domain_metadata('domain_metadata')
|
2009-05-24 09:11:32 -07:00
|
|
|
results.body[:attribute_name_count].should == 0
|
|
|
|
results.body[:attribute_names_size_bytes].should == 0
|
|
|
|
results.body[:attribute_value_count].should == 0
|
|
|
|
results.body[:attribute_values_size_bytes].should == 0
|
|
|
|
results.body[:box_usage].should be_a(Float)
|
|
|
|
results.body[:item_count].should == 0
|
|
|
|
results.body[:item_names_size_bytes].should == 0
|
|
|
|
results.body[:request_id].should be_a(String)
|
2009-06-29 01:02:55 -07:00
|
|
|
results.body[:timestamp].should be_a(Time)
|
2009-05-18 23:06:49 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'should return proper attributes with items' do
|
|
|
|
sdb.put_attributes('domain_metadata', 'foo', { :bar => :baz })
|
|
|
|
results = sdb.domain_metadata('domain_metadata')
|
2009-05-24 09:11:32 -07:00
|
|
|
results.body[:attribute_name_count].should == 1
|
|
|
|
results.body[:attribute_names_size_bytes].should == 3
|
|
|
|
results.body[:attribute_value_count].should == 1
|
|
|
|
results.body[:attribute_values_size_bytes].should == 3
|
|
|
|
results.body[:box_usage].should be_a(Float)
|
|
|
|
results.body[:item_count].should == 1
|
|
|
|
results.body[:item_names_size_bytes].should == 3
|
|
|
|
results.body[:request_id].should be_a(String)
|
2009-06-29 01:02:55 -07:00
|
|
|
results.body[:timestamp].should be_a(Time)
|
2009-05-18 23:06:49 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|