spec/archive/reader_spec.rb in heirloom-0.6.1 vs spec/archive/reader_spec.rb in heirloom-0.7.0rc1
- old
+ new
@@ -18,40 +18,40 @@
@sdb_mock.stub :domain_exists? => true
end
it "should show the item record" do
@sdb_mock.should_receive(:select).
- with("select * from heirloom_tim where itemName() = '123'").
+ with("select * from `heirloom_tim` where itemName() = '123'").
and_return( { '123' => { 'value' => [ 'details' ] } } )
@reader.show.should == { 'value' => 'details' }
end
it "should return an empty hash if item does not exist" do
@sdb_mock.should_receive(:select).
- with("select * from heirloom_tim where itemName() = '123'").
+ with("select * from `heirloom_tim` where itemName() = '123'").
and_return({})
@reader.show.should == {}
end
it "should return true if the record exists" do
@sdb_mock.should_receive(:select).
- with("select * from heirloom_tim where itemName() = '123'").
+ with("select * from `heirloom_tim` where itemName() = '123'").
and_return( { '123' => { 'value' => [ 'details' ] } } )
@reader.exists?.should == true
end
it "should return false if the record does not exist" do
@sdb_mock.should_receive(:select).
- with("select * from heirloom_tim where itemName() = '123'").
+ with("select * from `heirloom_tim` where itemName() = '123'").
and_return({})
@reader.exists?.should == false
end
it "should return the bucket if it exists" do
@sdb_mock.should_receive(:select).
exactly(3).times.
- with("select * from heirloom_tim where itemName() = '123'").
+ with("select * from `heirloom_tim` where itemName() = '123'").
and_return( { '123' =>
{ 'us-west-1-s3-url' =>
[ 's3://the-bucket/the-buck/the-key' ]
}
} )
@@ -59,27 +59,27 @@
end
it "should return nil if the key does not exist" do
@sdb_mock.should_receive(:select).
exactly(1).times.
- with("select * from heirloom_tim where itemName() = '123'").
+ with("select * from `heirloom_tim` where itemName() = '123'").
and_return( { } )
@reader.get_key(:region => 'us-west-1').should == nil
end
it "should return nil if the bucket does not exist" do
@sdb_mock.should_receive(:select).
exactly(1).times.
- with("select * from heirloom_tim where itemName() = '123'").
+ with("select * from `heirloom_tim` where itemName() = '123'").
and_return( { } )
@reader.get_bucket(:region => 'us-west-1').should == nil
end
it "should return the key if it exists" do
@sdb_mock.should_receive(:select).
exactly(6).times.
- with("select * from heirloom_tim where itemName() = '123'").
+ with("select * from `heirloom_tim` where itemName() = '123'").
and_return( { '123' =>
{ 'us-west-1-s3-url' =>
['s3://the-url/the-bucket/the-key']
}
} )
@@ -87,10 +87,10 @@
end
it "should return the regions the archive has been uploaded to" do
@sdb_mock.should_receive(:select).
exactly(1).times.
- with("select * from heirloom_tim where itemName() = '123'").
+ with("select * from `heirloom_tim` where itemName() = '123'").
and_return( { '123' =>
{ 'us-west-1-s3-url' =>
['s3://the-url-us-west-1/the-bucket/the-key'],
'build_by' =>
['user'],