2011-07-01 02:48:18 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
require 'guard/puppet/runner'
|
|
|
|
|
|
|
|
describe Guard::Puppet::Runner do
|
|
|
|
let(:options) { {} }
|
|
|
|
let(:runner) { described_class.new(options) }
|
|
|
|
|
|
|
|
describe '#command_line_params' do
|
|
|
|
subject { runner.command_line_params }
|
|
|
|
|
|
|
|
context 'default' do
|
2011-07-01 03:16:16 +00:00
|
|
|
it { should == [ 'apply', %{--confdir="#{Dir.pwd}"}, '-v', 'manifests/site.pp' ] }
|
2011-07-01 02:48:18 +00:00
|
|
|
end
|
|
|
|
|
2011-07-01 03:16:16 +00:00
|
|
|
context 'not verbose' do
|
|
|
|
let(:options) { { :verbose => false } }
|
2011-07-01 02:48:18 +00:00
|
|
|
|
2011-07-01 03:16:16 +00:00
|
|
|
it { should == [ 'apply', %{--confdir="#{Dir.pwd}"}, 'manifests/site.pp' ] }
|
2011-07-01 02:48:18 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
context 'manifest' do
|
|
|
|
let(:options) { { :manifest => '123' } }
|
|
|
|
|
2011-07-01 03:16:16 +00:00
|
|
|
it { should == [ 'apply', %{--confdir="#{Dir.pwd}"}, '-v', '123' ] }
|
2011-07-01 02:48:18 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe '#run' do
|
|
|
|
it 'should return the result of an exit call' do
|
|
|
|
::Puppet::Util::CommandLine.expects(:new).raises(SystemExit.new(10))
|
|
|
|
|
|
|
|
runner.run.should == 10
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|