source: other-projects/hathitrust/vagrant-hadoop-cluster/trunk/modules/stdlib/spec/aliases/absolutepath_spec.rb@ 30903

Last change on this file since 30903 was 30903, checked in by davidb, 8 years ago

Vagrant provisioning files for a 4-node Hadoop cluster. See README.txt for more details

File size: 1.1 KB
Line 
1require 'spec_helper'
2
3if Puppet.version.to_f >= 4.5
4 describe 'test::absolutepath', type: :class do
5 describe 'valid handling' do
6 %w{
7 /usr2/username/bin:/usr/local/bin:/usr/bin:.
8 C:/
9 C:\\
10 C:\\WINDOWS\\System32
11 C:/windows/system32
12 X:/foo/bar
13 X:\\foo\\bar
14 \\\\host\\windows
15 //host/windows
16 /var/tmp
17 /var/opt/../lib/puppet
18 }.each do |value|
19 describe value.inspect do
20 let(:params) {{ value: value }}
21 it { is_expected.to compile }
22 end
23 end
24 end
25
26 describe 'invalid path handling' do
27 context 'garbage inputs' do
28 [
29 nil,
30 [ nil ],
31 [ nil, nil ],
32 { 'foo' => 'bar' },
33 { },
34 '',
35 "*/Users//nope",
36 "\\Users/hc/wksp/stdlib",
37 "C:noslashes",
38 "\\var\\tmp"
39 ].each do |value|
40 describe value.inspect do
41 let(:params) {{ value: value }}
42 it { is_expected.to compile.and_raise_error(/parameter 'value' expects a match for Variant/) }
43 end
44 end
45 end
46
47 end
48 end
49end
Note: See TracBrowser for help on using the repository browser.