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.9.0 spec/opsicle/commands/list_instances_spec.rb
opsicle-2.8.0 spec/opsicle/commands/list_instances_spec.rb
opsicle-2.6.0 spec/opsicle/commands/list_instances_spec.rb
opsicle-2.5.0 spec/opsicle/commands/list_instances_spec.rb
opsicle-2.4.1 spec/opsicle/commands/list_instances_spec.rb
opsicle-2.4.0 spec/opsicle/commands/list_instances_spec.rb
opsicle-2.3.1 spec/opsicle/commands/list_instances_spec.rb
opsicle-2.3.0 spec/opsicle/commands/list_instances_spec.rb
opsicle-2.2.1 spec/opsicle/commands/list_instances_spec.rb
opsicle-2.2.0 spec/opsicle/commands/list_instances_spec.rb
opsicle-2.1.0 spec/opsicle/commands/list_instances_spec.rb
opsicle-2.0.2 spec/opsicle/commands/list_instances_spec.rb
opsicle-2.0.1 spec/opsicle/commands/list_instances_spec.rb
opsicle-2.0.0 spec/opsicle/commands/list_instances_spec.rb
opsicle-1.1.1 spec/opsicle/commands/list_instances_spec.rb
opsicle-1.1.0 spec/opsicle/commands/list_instances_spec.rb
opsicle-1.0.1 spec/opsicle/commands/list_instances_spec.rb
opsicle-0.18.1 spec/opsicle/commands/list_instances_spec.rb
opsicle-0.18.0 spec/opsicle/commands/list_instances_spec.rb
opsicle-0.16.0 spec/opsicle/commands/list_instances_spec.rb