From 83539371e5b1e6ff412eda48c3a725653c506ece Mon Sep 17 00:00:00 2001 From: Helen Campbell Date: Thu, 6 Oct 2016 14:22:13 +0100 Subject: Addition of several new types --- spec/aliases/windowspath_spec.rb | 44 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 spec/aliases/windowspath_spec.rb (limited to 'spec/aliases/windowspath_spec.rb') diff --git a/spec/aliases/windowspath_spec.rb b/spec/aliases/windowspath_spec.rb new file mode 100644 index 0000000..c13794e --- /dev/null +++ b/spec/aliases/windowspath_spec.rb @@ -0,0 +1,44 @@ +require 'spec_helper' + +if Puppet.version.to_f >= 4.5 + describe 'test::windowspath', type: :class do + describe 'valid handling' do + %w{ + C:\\ + C:\\WINDOWS\\System32 + C:/windows/system32 + X:/foo/bar + X:\\foo\\bar + \\\\host\\windows + }.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' }, + { }, + '', + "httds://notquiteright.org", + "/usr2/username/bin:/usr/local/bin:/usr/bin:.", + "C;//notright/here", + "C:noslashes" + ].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::Windowspath/) } + end + end + end + + end + end +end -- cgit v1.2.3