Sha256: 05a3b48228b5f6d1d3c3226a6f1e766b311c8d7a888d346ddc325801515d4a95

Contents?: true

Size: 1.04 KB

Versions: 45

Compression:

Stored size: 1.04 KB

Contents

require "spec_helper"
require "opsicle"

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

    context "#execute" do
      let(:client) { double }
      let(:layers) { [ { layer_id: 1, name: "Layer 1" }, { layer_id: 2, name: "Layer 2" }] }
      let(:instances) { [
          { hostname: 'test', layer_ids: [1], status: 'online', instance_id: 'opsworks-instance-id'},
          { hostname: 'test2', layer_ids: [2], status: 'online', instance_id: 'opsworks-instance-id2'},
        ] }
      before do
        allow(Client).to receive(:new).with('derp').and_return(client)
      end

      it "shows a table with all of the instances for the stack from OpsWorks" do
        expect(subject).to receive(:get_instances).and_return(instances)
        expect(subject).to receive(:print).with(instances)
        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

45 entries across 45 versions & 1 rubygems

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