Sha256: b30374a199996a6b607a73ba9a573258b42cdf71e1d0a063796c9481f494000d

Contents?: true

Size: 1.06 KB

Versions: 10

Compression:

Stored size: 1.06 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 base" do
    result = { 'heirloom_a_archive' => { 'base' => [ 'thebase' ] } }
    @sdb_mock.should_receive(:select).
              with("select base from heirloom where itemName() = 'heirloom_a_archive'").
              and_return result
    @show.base.should == 'thebase'
  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

10 entries across 10 versions & 1 rubygems

Version Path
heirloom-0.7.4 spec/catalog/show_spec.rb
heirloom-0.7.3 spec/catalog/show_spec.rb
heirloom-0.7.3rc2 spec/catalog/show_spec.rb
heirloom-0.7.3rc1 spec/catalog/show_spec.rb
heirloom-0.7.2 spec/catalog/show_spec.rb
heirloom-0.7.2rc2 spec/catalog/show_spec.rb
heirloom-0.7.2rc1 spec/catalog/show_spec.rb
heirloom-0.7.1 spec/catalog/show_spec.rb
heirloom-0.7.0 spec/catalog/show_spec.rb
heirloom-0.7.0rc1 spec/catalog/show_spec.rb