Sha256: 797edb4c5afdcf70b77e1c5b626a076004aa867dc32b349033243ae5b316a6c5

Contents?: true

Size: 955 Bytes

Versions: 60

Compression:

Stored size: 955 Bytes

Contents

require "spec_helper"
require "opsicle"

module Opsicle
  describe List do
    subject { List.new('derp') }

    context "#execute" do
      let(:client) { double }
      let(:stack_ids) { [1,2,3] }
      let(:apps) { [{ name: 'test', stack_id: 1, app_id: 1}, { name: 'test2', stack_id: 2, app_id: 2}, { name: 'test3', stack_id: 3, app_id: 3 }] }
      before do
        allow(Client).to receive(:new).with('derp').and_return(client)
      end

      it "shows a table with all of the apps/stacks from OpsWorks" do
        expect(subject).to receive(:get_stacks).and_return(stack_ids)
        expect(subject).to receive(:get_apps).with(stack_ids).and_return(apps)
        expect(subject).to receive(:print).with(apps)
        subject.execute
      end
    end

    context "#client" do
      it "generates a new aws client from the given configs" do
        expect(Client).to receive(:new).with('derp')
        subject.client
      end
    end

  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
opsicle-2.15.0 spec/opsicle/commands/list_spec.rb
opsicle-2.14.2 spec/opsicle/commands/list_spec.rb
opsicle-2.14.1 spec/opsicle/commands/list_spec.rb
opsicle-2.14.0 spec/opsicle/commands/list_spec.rb
opsicle-2.13.1 spec/opsicle/commands/list_spec.rb
opsicle-2.13.0 spec/opsicle/commands/list_spec.rb
opsicle-2.12.5 spec/opsicle/commands/list_spec.rb
opsicle-2.12.3 spec/opsicle/commands/list_spec.rb
opsicle-2.12.2 spec/opsicle/commands/list_spec.rb
opsicle-2.12.1 spec/opsicle/commands/list_spec.rb
opsicle-2.12.0 spec/opsicle/commands/list_spec.rb
opsicle-2.11.3 spec/opsicle/commands/list_spec.rb
opsicle-2.11.1 spec/opsicle/commands/list_spec.rb
opsicle-2.11.0 spec/opsicle/commands/list_spec.rb
opsicle-2.10.1 spec/opsicle/commands/list_spec.rb
opsicle-2.10.0 spec/opsicle/commands/list_spec.rb
opsicle-2.9.6 spec/opsicle/commands/list_spec.rb
opsicle-2.9.4 spec/opsicle/commands/list_spec.rb
opsicle-2.9.3 spec/opsicle/commands/list_spec.rb
opsicle-2.9.2 spec/opsicle/commands/list_spec.rb