Sha256: e1121c27eba3fc40b691b001af6e94027807c9ff24c08c42fa89ce71b959d2fc

Contents?: true

Size: 1.16 KB

Versions: 24

Compression:

Stored size: 1.16 KB

Contents

require 'spec_helper'

describe SimpleDeploy::EntryLister do
  include_context 'stubbed config'

  it "should create a list of entries" do
    @simple_db_mock = mock 'simple db'
    SimpleDeploy::AWS::SimpleDB.should_receive(:new).and_return @simple_db_mock
    @simple_db_mock.should_receive(:domain_exists?).
                    with("stacks").
                    and_return true
    @simple_db_mock.should_receive(:select).
                    with("select * from stacks").
                    and_return('stack-to-find-us-west-1' => { 'attr1' => 'value1' })
    entry_lister = SimpleDeploy::EntryLister.new
    entry_lister.all.should == ['stack-to-find']
  end

  it "should return a blank array if the domain does not exist" do
    @simple_db_mock = mock 'simple db'
    SimpleDeploy::AWS::SimpleDB.should_receive(:new).and_return @simple_db_mock
    @simple_db_mock.should_receive(:domain_exists?).
                    with("stacks").
                    and_return false
    @simple_db_mock.should_receive(:select).
                    with("select * from stacks").exactly(0).times
    entry_lister = SimpleDeploy::EntryLister.new
    entry_lister.all.should == []
  end

end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
simple_deploy-0.10.2 spec/entry_lister_spec.rb
simple_deploy-0.10.1 spec/entry_lister_spec.rb
simple_deploy-0.10.0 spec/entry_lister_spec.rb
simple_deploy-0.10.0.beta.3 spec/entry_lister_spec.rb
simple_deploy-0.10.0.beta.2 spec/entry_lister_spec.rb
simple_deploy-0.10.0.beta.1 spec/entry_lister_spec.rb
simple_deploy-0.9.2 spec/entry_lister_spec.rb
simple_deploy-0.9.1 spec/entry_lister_spec.rb
simple_deploy-0.9.0 spec/entry_lister_spec.rb
simple_deploy-0.8.2 spec/entry_lister_spec.rb
simple_deploy-0.8.2.beta1 spec/entry_lister_spec.rb
simple_deploy-0.8.1.beta1 spec/entry_lister_spec.rb
simple_deploy-0.8.0 spec/entry_lister_spec.rb
simple_deploy-0.7.8 spec/entry_lister_spec.rb
simple_deploy-0.7.7 spec/entry_lister_spec.rb
simple_deploy-0.7.7.beta.1 spec/entry_lister_spec.rb
simple_deploy-0.7.6 spec/entry_lister_spec.rb
simple_deploy-0.7.6.beta.6 spec/entry_lister_spec.rb
simple_deploy-0.7.6.beta.5 spec/entry_lister_spec.rb
simple_deploy-0.7.6.beta.3 spec/entry_lister_spec.rb