Sha256: 0ab39d4e1f9d3a73ba9f15cc2760151c32cd75aecdacade18796aa7be383ca53

Contents?: true

Size: 1.49 KB

Versions: 24

Compression:

Stored size: 1.49 KB

Contents

require 'spec_helper'
require 'simple_deploy/cli'

describe SimpleDeploy::CLI::Outputs do
  include_context 'cli config'
  include_context 'double stubbed logger'
  include_context 'stubbed stack', :name        => 'mytest',
                                   :environment => 'test'

  before do
    @config_env    = mock 'environment config'
    @options       = { :environment => 'test',
                       :log_level   => 'info',
                       :name        => 'mytest' }
    @data          = [{ 'OutputKey' => 'key1', 'OutputValue' => 'value1' },
                      { 'OutputKey' => 'key2', 'OutputValue' => 'value2' }]
    Trollop.stub :options => @options
    @config_mock.stub(:environments => { 'test' => 'data' })
    SimpleDeploy.stub(:environments).and_return(@config_env)
    @config_env.should_receive(:keys).and_return(['test'])
    @stack_mock.stub(:outputs).and_return(@data)
    @outputs = SimpleDeploy::CLI::Outputs.new
  end

  after do
    SimpleDeploy.release_config
  end

  it "should successfully return the show command with default values" do
    @outputs.should_receive(:puts).with('key1: value1')
    @outputs.should_receive(:puts).with('key2: value2')
    @outputs.show
  end

  it "should successfully return the show command with as_command_args" do
    @options[:as_command_args] = true
    @outputs.should_receive(:print).with('-a key1=value1 ')
    @outputs.should_receive(:print).with('-a key2=value2 ')
    @outputs.should_receive(:puts).with('')
    @outputs.show
  end

end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
simple_deploy-0.7.6.beta.1 spec/cli/outputs_spec.rb
simple_deploy-0.7.5 spec/cli/outputs_spec.rb
simple_deploy-0.7.4 spec/cli/outputs_spec.rb
simple_deploy-0.7.3 spec/cli/outputs_spec.rb