diff options
author | David Schmitt <david.schmitt@puppet.com> | 2016-10-07 14:43:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-07 14:43:05 +0100 |
commit | 527a4f1ebc21276458427fc5787a621fa8d5cb67 (patch) | |
tree | 3460fdc969438937c1e1c9cd173fb5e1193b54dd /spec/aliases/unixpath_spec.rb | |
parent | db8edf5cb36e038c747d177914aaa747c770477d (diff) | |
parent | 83539371e5b1e6ff412eda48c3a725653c506ece (diff) |
Merge pull request #664 from HelenCampbell/typeupdates
Type updates
Diffstat (limited to 'spec/aliases/unixpath_spec.rb')
-rw-r--r-- | spec/aliases/unixpath_spec.rb | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/spec/aliases/unixpath_spec.rb b/spec/aliases/unixpath_spec.rb new file mode 100644 index 0000000..aee161d --- /dev/null +++ b/spec/aliases/unixpath_spec.rb @@ -0,0 +1,41 @@ +require 'spec_helper' + +if Puppet.version.to_f >= 4.5 + describe 'test::unixpath', type: :class do + describe 'valid handling' do + %w{ + /usr2/username/bin:/usr/local/bin:/usr/bin:. + /var/tmp + /Users/helencampbell/workspace/puppetlabs-stdlib + }.each do |value| + describe value.inspect do + let(:params) {{ value: value }} + it { is_expected.to compile } + end + end + end + + describe 'invalid path handling' do + context 'garbage inputs' do + [ + nil, + [ nil ], + [ nil, nil ], + { 'foo' => 'bar' }, + { }, + '', + "C:/whatever", + "\\var\\tmp", + "\\Users/hc/wksp/stdlib", + "*/Users//nope" + ].each do |value| + describe value.inspect do + let(:params) {{ value: value }} + it { is_expected.to compile.and_raise_error(/parameter 'value' expects a match for Stdlib::Unixpath/) } + end + end + end + + end + end +end |