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.4.4 spec/kumogata_list_spec.rb
kumogata-0.4.3 spec/kumogata_list_spec.rb
kumogata-0.4.2 spec/kumogata_list_spec.rb
kumogata-0.4.1 spec/kumogata_list_spec.rb
kumogata-0.4.0 spec/kumogata_list_spec.rb
kumogata-0.3.14 spec/kumogata_list_spec.rb
kumogata-0.3.13 spec/kumogata_list_spec.rb
kumogata-0.3.12 spec/kumogata_list_spec.rb
kumogata-0.3.11 spec/kumogata_list_spec.rb
kumogata-0.3.10 spec/kumogata_list_spec.rb
kumogata-0.3.9 spec/kumogata_list_spec.rb
kumogata-0.3.8 spec/kumogata_list_spec.rb
kumogata-0.3.7 spec/kumogata_list_spec.rb
kumogata-0.3.6 spec/kumogata_list_spec.rb
kumogata-0.3.5 spec/kumogata_list_spec.rb
kumogata-0.3.4 spec/kumogata_list_spec.rb
kumogata-0.3.3 spec/kumogata_list_spec.rb
kumogata-0.3.2 spec/kumogata_list_spec.rb
kumogata-0.3.1 spec/kumogata_list_spec.rb
kumogata-0.3.0 spec/kumogata_list_spec.rb