Sha256: 3f0a85a7620da2a23e22a63dc93cc9a30d975c8e539791b56178553d9791cdc4

Contents?: true

Size: 1.11 KB

Versions: 14

Compression:

Stored size: 1.11 KB

Contents

require 'spec_helper'

describe Heirloom::Catalog::Show do

  before do
    @config_stub = stub 'config'
    @sdb_mock = mock 'sdb'
    Heirloom::AWS::SimpleDB.should_receive(:new).
                            with(:config => @config_stub).
                            and_return @sdb_mock
    @show = Heirloom::Catalog::Show.new :config => @config_stub,
                                        :name   => 'a_archive'
  end

  it "should return the bucket_prefix" do
    result = { 'heirloom_a_archive' => 
               { 'bucket_prefix' => [ 'bp' ] } 
             }
    @sdb_mock.should_receive(:select).
              with("select bucket_prefix from heirloom where itemName() = 'heirloom_a_archive'").
              and_return result
    @show.bucket_prefix.should == 'bp'
  end

  it "should return the regions" do
    regions = ['us-west-1', 'us-west-2']
    result = { 'heirloom_a_archive' => { 'regions' => @regions } }
    @sdb_mock.should_receive(:select).
              with("select regions from heirloom where itemName() = 'heirloom_a_archive'").
              and_return result
    @show.regions.should == @regions
  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
heirloom-0.12.1 spec/catalog/show_spec.rb
heirloom-0.12.0 spec/catalog/show_spec.rb
heirloom-0.11.2 spec/catalog/show_spec.rb
heirloom-0.11.1 spec/catalog/show_spec.rb
heirloom-0.11.0 spec/catalog/show_spec.rb
heirloom-0.11.0.beta.2 spec/catalog/show_spec.rb
heirloom-0.11.0.beta.1 spec/catalog/show_spec.rb
heirloom-0.10.1 spec/catalog/show_spec.rb
heirloom-0.10.0 spec/catalog/show_spec.rb
heirloom-0.9.0 spec/catalog/show_spec.rb
heirloom-0.8.3 spec/catalog/show_spec.rb
heirloom-0.8.2 spec/catalog/show_spec.rb
heirloom-0.8.1 spec/catalog/show_spec.rb
heirloom-0.8.0 spec/catalog/show_spec.rb