Sha256: 579701a982f8d995cb11b123bae8d1b35e2b68da4c30a5975a6ef0f29dff1a67
Contents?: true
Size: 1.4 KB
Versions: 18
Compression:
Stored size: 1.4 KB
Contents
require 'spec_helper' require 'simple_deploy/cli' describe SimpleDeploy::CLI::Attributes do include_context 'cli config' include_context 'double stubbed logger' include_context 'double stubbed stack', :name => 'my_stack', :environment => 'my_env' describe 'show' do before do @options = { :environment => 'my_env', :log_level => 'debug', :name => 'my_stack' } @stack_stub.stub(:attributes).and_return({ 'foo' => 'bar', 'baz' => 'blah' }) end it 'should output the attributes' do subject.should_receive(:valid_options?). with(:provided => @options, :required => [:environment, :name]) Trollop.stub(:options).and_return(@options) subject.should_receive(:puts).with('foo: bar') subject.should_receive(:puts).with('baz: blah') subject.show end context 'with --as-command-args' do before do @options[:as_command_args] = true Trollop.stub(:options).and_return(@options) subject.should_receive(:valid_options?). with(:provided => @options, :required => [:environment, :name]) end it 'should output the attributes as command arguments' do subject.should_receive(:puts).with("-a baz=blah -a foo=bar") subject.show end end end end
Version data entries
18 entries across 18 versions & 1 rubygems