Skip to content

Commit b5c7ee9

Browse files
committed
Stubs Puppet execution
/usr/bin/test can have multiple paths. For example, the specs will always fail on OSX in their current state. This means we can actually chose the return value and test accordingly.
1 parent 28b735f commit b5c7ee9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

spec/unit/defines/concat_spec.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,12 @@
386386
end # ensure_newline =>
387387

388388
context 'validate_cmd =>' do
389-
context '/usr/bin/test -e %' do
390-
it_behaves_like 'concat', '/etc/foo.bar', { :validate_cmd => '/usr/bin/test -e %' }
389+
before(:each) do
390+
Puppet::Util::Execution.stubs(:execute)
391+
end
392+
393+
context '/usr/bin/test -e' do
394+
it_behaves_like 'concat', '/etc/foo.bar', { :validate_cmd => '/usr/bin/test % -e' }
391395
end
392396

393397
[ 1234, true ].each do |cmd|

0 commit comments

Comments
 (0)