Last change
on this file since 30960 was 30960, checked in by davidb, 8 years ago |
Switch to using Puppet to provision machine. Strongly based on files developed for spark-hdfs cluster
|
File size:
1.0 KB
|
Line | |
---|
1 | require 'spec_helper'
|
---|
2 |
|
---|
3 | if Puppet.version.to_f >= 4.5
|
---|
4 | describe 'test::unixpath', type: :class do
|
---|
5 | describe 'valid handling' do
|
---|
6 | %w{
|
---|
7 | /usr2/username/bin:/usr/local/bin:/usr/bin:.
|
---|
8 | /var/tmp
|
---|
9 | /Users/helencampbell/workspace/puppetlabs-stdlib
|
---|
10 | }.each do |value|
|
---|
11 | describe value.inspect do
|
---|
12 | let(:params) {{ value: value }}
|
---|
13 | it { is_expected.to compile }
|
---|
14 | end
|
---|
15 | end
|
---|
16 | end
|
---|
17 |
|
---|
18 | describe 'invalid path handling' do
|
---|
19 | context 'garbage inputs' do
|
---|
20 | [
|
---|
21 | nil,
|
---|
22 | [ nil ],
|
---|
23 | [ nil, nil ],
|
---|
24 | { 'foo' => 'bar' },
|
---|
25 | { },
|
---|
26 | '',
|
---|
27 | "C:/whatever",
|
---|
28 | "\\var\\tmp",
|
---|
29 | "\\Users/hc/wksp/stdlib",
|
---|
30 | "*/Users//nope"
|
---|
31 | ].each do |value|
|
---|
32 | describe value.inspect do
|
---|
33 | let(:params) {{ value: value }}
|
---|
34 | it { is_expected.to compile.and_raise_error(/parameter 'value' expects a match for Stdlib::Unixpath/) }
|
---|
35 | end
|
---|
36 | end
|
---|
37 | end
|
---|
38 |
|
---|
39 | end
|
---|
40 | end
|
---|
41 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.