Suggest different variables to use if we want to tunnel both v4 and v6
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / dirname_spec.rb
1 require 'spec_helper_acceptance'
2
3 describe 'dirname function' do
4   describe 'success' do
5     context 'with absolute path' do
6       pp1 = <<-DOC
7         $a = '/path/to/a/file.txt'
8         $b = '/path/to/a'
9         $o = dirname($a)
10         if $o == $b {
11           notify { 'output correct': }
12         }
13       DOC
14       it 'returns the dirname' do
15         apply_manifest(pp1, :catch_failures => true) do |r|
16           expect(r.stdout).to match(%r{Notice: output correct})
17         end
18       end
19     end
20     context 'with relative path' do
21       pp2 = <<-DOC
22         $a = 'path/to/a/file.txt'
23         $b = 'path/to/a'
24         $o = dirname($a)
25         if $o == $b {
26           notify { 'output correct': }
27         }
28       DOC
29       it 'returns the dirname' do
30         apply_manifest(pp2, :catch_failures => true) do |r|
31           expect(r.stdout).to match(%r{Notice: output correct})
32         end
33       end
34     end
35   end
36   describe 'failure' do
37     it 'handles improper argument counts'
38   end
39 end