Sha256: 798464114ec96283c8bfb91bea1e474e1a5edbd19ebb6f9413d0fd8c2b59fe81
Contents?: true
Size: 969 Bytes
Versions: 2
Compression:
Stored size: 969 Bytes
Contents
require "spec_helper" require "opsicle/commands/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 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
opsicle-0.2.1 | spec/opsicle/commands/list_spec.rb |
opsicle-0.2.0 | spec/opsicle/commands/list_spec.rb |