3 describe 'validate_absolute_path' do
5 ENV.delete('STDLIB_LOG_DEPRECATIONS')
8 # Checking for deprecation warning
9 it 'should display a single deprecation' do
10 ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
11 scope.expects(:warning).with(includes('This method is deprecated'))
12 is_expected.to run.with_params('c:/')
15 describe 'signature validation' do
16 it { is_expected.not_to eq(nil) }
17 it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
20 describe "valid paths handling" do
32 /var/opt/../lib/puppet
34 it { is_expected.to run.with_params(path) }
35 it { is_expected.to run.with_params(['/tmp', path]) }
39 describe 'invalid path handling' do
40 context 'garbage inputs' do
49 it { is_expected.to run.with_params(path).and_raise_error(Puppet::ParseError, /is not an absolute path/) }
50 it { is_expected.to run.with_params([path]).and_raise_error(Puppet::ParseError, /is not an absolute path/) }
51 it { is_expected.to run.with_params(['/tmp', path]).and_raise_error(Puppet::ParseError, /is not an absolute path/) }
55 context 'relative paths' do
66 it { is_expected.to run.with_params(path).and_raise_error(Puppet::ParseError, /is not an absolute path/) }
67 it { is_expected.to run.with_params([path]).and_raise_error(Puppet::ParseError, /is not an absolute path/) }
68 it { is_expected.to run.with_params(['/tmp', path]).and_raise_error(Puppet::ParseError, /is not an absolute path/) }