comparison modules/common/spec/defines/mkdir_p_spec.rb @ 388:750d36241580

Add missing dependency modules Probably required by SSH, but not obviously listed
author IBBoard <dev@ibboard.co.uk>
date Mon, 03 Jan 2022 17:15:14 +0000
parents
children
comparison
equal deleted inserted replaced
387:66c075c5f54a 388:750d36241580
1 require 'spec_helper'
2
3 describe 'common::mkdir_p' do
4 context 'should create new directory' do
5 let(:title) { '/some/dir/structure' }
6
7 it {
8 should contain_exec('mkdir_p-/some/dir/structure').with({
9 'command' => 'mkdir -p /some/dir/structure',
10 'unless' => 'test -d /some/dir/structure',
11 })
12 }
13 end
14
15 context 'should fail with a path that is not absolute' do
16 let(:title) { 'not/a/valid/absolute/path' }
17
18 it do
19 expect {
20 should contain_exec('mkdir_p-not/a/valid/absolute/path').with({
21 'command' => 'mkdir -p not/a/valid/absolute/path',
22 'unless' => 'test -d not/a/valid/absolute/path',
23 })
24 }.to raise_error(Puppet::Error)
25 end
26 end
27 end