Sha256: a5c98815474875052ad86fcca67b39c1de10a1cf08193a2c13487303dd8fe389

Contents?: true

Size: 1.8 KB

Versions: 68

Compression:

Stored size: 1.8 KB

Contents

describe 'Kumogata::Client#list' do
  it 'list stacks' do
    json = run_client(:list) do |client, cf|
      stack1 = make_double('stack1') do |obj|
        obj.should_receive(:name) { 'stack1' }
        obj.should_receive(:creation_time) { '2014-03-02 16:17:18 UTC' }
        obj.should_receive(:status) { 'CREATE_COMPLETE' }
        obj.should_receive(:description) { nil }
      end

      stack2 = make_double('stack2') do |obj|
        obj.should_receive(:name) { 'stack2' }
        obj.should_receive(:creation_time) { '2014-03-02 16:17:19 UTC' }
        obj.should_receive(:status) { 'CREATE_COMPLETE' }
        obj.should_receive(:description) { nil }
      end

      cf.should_receive(:stacks) { [stack1, stack2] }
    end

    expect(json).to eq((<<-EOS).chomp)
[
  {
    "StackName": "stack1",
    "CreationTime": "2014-03-02 16:17:18 UTC",
    "StackStatus": "CREATE_COMPLETE",
    "Description": null
  },
  {
    "StackName": "stack2",
    "CreationTime": "2014-03-02 16:17:19 UTC",
    "StackStatus": "CREATE_COMPLETE",
    "Description": null
  }
]
    EOS
  end

  it 'list a specified stack' do
    json = run_client(:list, :arguments => ['stack1']) do |client, cf|
      stack1 = make_double('stack1') do |obj|
        obj.should_receive(:name).twice { 'stack1' }
        obj.should_receive(:creation_time) { '2014-03-02 16:17:18 UTC' }
        obj.should_receive(:status) { 'CREATE_COMPLETE' }
        obj.should_receive(:description) { nil }
      end

      stack2 = make_double('stack2') do |obj|
        obj.should_receive(:name) { 'stack2' }
      end

      cf.should_receive(:stacks) { [stack1, stack2] }
    end

    expect(json).to eq((<<-EOS).chomp)
[
  {
    "StackName": "stack1",
    "CreationTime": "2014-03-02 16:17:18 UTC",
    "StackStatus": "CREATE_COMPLETE",
    "Description": null
  }
]
    EOS
  end

end

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
kumogata-0.5.2 spec/kumogata_list_spec.rb
kumogata-0.5.2.beta2 spec/kumogata_list_spec.rb
kumogata-0.5.2.beta spec/kumogata_list_spec.rb
kumogata-0.5.1 spec/kumogata_list_spec.rb
kumogata-0.5.0 spec/kumogata_list_spec.rb
kumogata-0.4.19 spec/kumogata_list_spec.rb
kumogata-0.4.18 spec/kumogata_list_spec.rb
kumogata-0.4.17 spec/kumogata_list_spec.rb
kumogata-0.4.16 spec/kumogata_list_spec.rb
kumogata-0.4.15 spec/kumogata_list_spec.rb
kumogata-0.4.14 spec/kumogata_list_spec.rb
kumogata-0.4.13 spec/kumogata_list_spec.rb
kumogata-0.4.12 spec/kumogata_list_spec.rb
kumogata-0.4.11 spec/kumogata_list_spec.rb
kumogata-0.4.10 spec/kumogata_list_spec.rb
kumogata-0.4.9 spec/kumogata_list_spec.rb
kumogata-0.4.8 spec/kumogata_list_spec.rb
kumogata-0.4.7 spec/kumogata_list_spec.rb
kumogata-0.4.6 spec/kumogata_list_spec.rb
kumogata-0.4.5 spec/kumogata_list_spec.rb