Sha256: a5952f2a6c0d45a23c27ee803167450e6e96946e8c785cad44e7af801e7c965f

Contents?: true

Size: 850 Bytes

Versions: 4

Compression:

Stored size: 850 Bytes

Contents

require "spec_helper"
require "opsicle/list"

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
        Client.stub(:new).with('derp').and_return(client)
      end

      it "creates a new deployment" do
        subject.should_receive(:get_stacks).and_return(stack_ids)
        subject.should_receive(:get_apps).with(stack_ids).and_return(apps)
        subject.execute
      end
    end

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

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
opsicle-0.1.0 spec/opsicle/list_spec.rb
opsicle-0.0.4 spec/opsicle/list_spec.rb
opsicle-0.0.3 spec/opsicle/list_spec.rb
opsicle-0.0.2 spec/opsicle/list_spec.rb