|
31 | 31 | stdout_str, status = Open3.capture2e("puppet resource #{common_args} composite_namevar php/gem")
|
32 | 32 | expect(stdout_str.strip).to match %r{^composite_namevar \{ \'php/gem\'}
|
33 | 33 | expect(stdout_str.strip).to match %r{ensure\s*=> \'present\'}
|
34 |
| - expect(stdout_str.strip).to match %r{Looking for \["php/gem"\]} |
| 34 | + expect(stdout_str.strip).to match %r{Looking for \[\{:package=>"php", :manager=>"gem"\}\]} |
35 | 35 | expect(status.exitstatus).to eq 0
|
36 | 36 | end
|
37 | 37 | it 'properly identifies an absent resource if only the title is provided' do
|
38 | 38 | stdout_str, status = Open3.capture2e("puppet resource #{common_args} composite_namevar php-wibble")
|
39 | 39 | expect(stdout_str.strip).to match %r{^composite_namevar \{ \'php-wibble\'}
|
40 | 40 | expect(stdout_str.strip).to match %r{ensure\s*=> \'absent\'}
|
41 |
| - expect(stdout_str.strip).to match %r{Looking for \["php-wibble"\]} |
| 41 | + expect(stdout_str.strip).to match %r{Looking for \[\{:package=>"php", :manager=>"wibble"\}\]} |
42 | 42 | expect(status.exitstatus).to eq 0
|
43 | 43 | end
|
44 | 44 | it 'creates a previously absent resource' do
|
|
47 | 47 | expect(stdout_str.strip).to match %r{ensure\s*=> \'present\'}
|
48 | 48 | expect(stdout_str.strip).to match %r{package\s*=> \'php\'}
|
49 | 49 | expect(stdout_str.strip).to match %r{manager\s*=> \'wibble\'}
|
50 |
| - expect(stdout_str.strip).to match %r{Looking for \["php-wibble"\]} |
| 50 | + expect(stdout_str.strip).to match %r{Looking for \[\{:package=>"php", :manager=>"wibble"\}\]} |
51 | 51 | expect(status.exitstatus).to eq 0
|
52 | 52 | end
|
53 | 53 | it 'will remove an existing resource' do
|
|
56 | 56 | expect(stdout_str.strip).to match %r{package\s*=> \'php\'}
|
57 | 57 | expect(stdout_str.strip).to match %r{manager\s*=> \'gem\'}
|
58 | 58 | expect(stdout_str.strip).to match %r{ensure\s*=> \'absent\'}
|
59 |
| - expect(stdout_str.strip).to match %r{Looking for \["php-gem"\]} |
| 59 | + expect(stdout_str.strip).to match %r{Looking for \[\{:package=>"php", :manager=>"gem"\}\]} |
60 | 60 | expect(status.exitstatus).to eq 0
|
61 | 61 | end
|
62 | 62 | end
|
|
79 | 79 | let(:manifest) { 'composite_namevar { php-gem: }' }
|
80 | 80 |
|
81 | 81 | it { expect(@stdout_str).to match %r{Current State: \{:title=>"php-gem", :package=>"php", :manager=>"gem", :ensure=>"present", :value=>"b"\}} }
|
82 |
| - it { expect(@stdout_str).to match %r{Looking for \["php-gem"\]} } |
| 82 | + it { expect(@stdout_str).to match %r{Looking for \[\{:package=>"php", :manager=>"gem"\}\]} } |
83 | 83 | it { expect(@status.exitstatus).to eq 0 }
|
84 | 84 | end
|
85 | 85 |
|
86 | 86 | context 'when managing an absent instance' do
|
87 | 87 | let(:manifest) { 'composite_namevar { php-wibble: ensure=>\'absent\' }' }
|
88 | 88 |
|
89 | 89 | it { expect(@stdout_str).to match %r{Composite_namevar\[php-wibble\]: Nothing to manage: no ensure and the resource doesn't exist} }
|
90 |
| - it { expect(@stdout_str).to match %r{Looking for \["php-wibble"\]} } |
| 90 | + it { expect(@stdout_str).to match %r{Looking for \[\{:package=>"php", :manager=>"wibble"\}\]} } |
91 | 91 | it { expect(@status.exitstatus).to eq 0 }
|
92 | 92 | end
|
93 | 93 |
|
94 | 94 | context 'when creating a previously absent instance' do
|
95 | 95 | let(:manifest) { 'composite_namevar { php-wibble: ensure=>\'present\' }' }
|
96 | 96 |
|
97 | 97 | it { expect(@stdout_str).to match %r{Composite_namevar\[php-wibble\]/ensure: defined 'ensure' as 'present'} }
|
98 |
| - it { expect(@stdout_str).to match %r{Looking for \["php-wibble"\]} } |
| 98 | + it { expect(@stdout_str).to match %r{Looking for \[\{:package=>"php", :manager=>"wibble"\}\]} } |
99 | 99 | it { expect(@status.exitstatus).to eq 2 }
|
100 | 100 | end
|
101 | 101 |
|
102 | 102 | context 'when removing a previously present instance' do
|
103 | 103 | let(:manifest) { 'composite_namevar { php-yum: ensure=>\'absent\' }' }
|
104 | 104 |
|
105 | 105 | it { expect(@stdout_str).to match %r{Composite_namevar\[php-yum\]/ensure: undefined 'ensure' from 'present'} }
|
106 |
| - it { expect(@stdout_str).to match %r{Looking for \["php-yum"\]} } |
| 106 | + it { expect(@stdout_str).to match %r{Looking for \[\{:package=>"php", :manager=>"yum"\}\]} } |
107 | 107 | it { expect(@status.exitstatus).to eq 2 }
|
108 | 108 | end
|
109 | 109 |
|
|
112 | 112 |
|
113 | 113 | it { expect(@stdout_str).to match %r{Current State: \{:title=>"php-gem", :package=>"php", :manager=>"gem", :ensure=>"present", :value=>"b"\}} }
|
114 | 114 | it { expect(@stdout_str).to match %r{Target State: \{:package=>"php", :manager=>"gem", :value=>"c", :ensure=>"present"\}} }
|
115 |
| - it { expect(@stdout_str).to match %r{Looking for \["php/gem"\]} } |
| 115 | + it { expect(@stdout_str).to match %r{Looking for \[\{:package=>"php", :manager=>"gem"\}\]} } |
116 | 116 | it { expect(@status.exitstatus).to eq 2 }
|
117 | 117 | end
|
118 | 118 | end
|
|
122 | 122 | let(:manifest) { 'composite_namevar { "sometitle": package => "php", manager => "gem" }' }
|
123 | 123 |
|
124 | 124 | it { expect(@stdout_str).to match %r{Current State: \{:title=>"php-gem", :package=>"php", :manager=>"gem", :ensure=>"present", :value=>"b"\}} }
|
125 |
| - it { expect(@stdout_str).to match %r{Looking for \["sometitle"\]} } |
| 125 | + it { expect(@stdout_str).to match %r{Looking for \[\{:package=>"php", :manager=>"gem"\}\]} } |
126 | 126 | it { expect(@status.exitstatus).to eq 0 }
|
127 | 127 | end
|
128 | 128 |
|
129 | 129 | context 'when managing an absent instance' do
|
130 | 130 | let(:manifest) { 'composite_namevar { "sometitle": ensure => "absent", package => "php", manager => "wibble" }' }
|
131 | 131 |
|
132 | 132 | it { expect(@stdout_str).to match %r{Composite_namevar\[sometitle\]: Nothing to manage: no ensure and the resource doesn't exist} }
|
133 |
| - it { expect(@stdout_str).to match %r{Looking for \["sometitle"\]} } |
| 133 | + it { expect(@stdout_str).to match %r{Looking for \[\{:package=>"php", :manager=>"wibble"\}\]} } |
134 | 134 | it { expect(@status.exitstatus).to eq 0 }
|
135 | 135 | end
|
136 | 136 |
|
137 | 137 | context 'when creating a previously absent instance' do
|
138 | 138 | let(:manifest) { 'composite_namevar { "sometitle": ensure => "present", package => "php", manager => "wibble" }' }
|
139 | 139 |
|
140 | 140 | it { expect(@stdout_str).to match %r{Composite_namevar\[sometitle\]/ensure: defined 'ensure' as 'present'} }
|
141 |
| - it { expect(@stdout_str).to match %r{Looking for \["sometitle"\]} } |
| 141 | + it { expect(@stdout_str).to match %r{Looking for \[\{:package=>"php", :manager=>"wibble"\}\]} } |
142 | 142 | it { expect(@status.exitstatus).to eq 2 }
|
143 | 143 | end
|
144 | 144 |
|
145 | 145 | context 'when removing a previously present instance' do
|
146 | 146 | let(:manifest) { 'composite_namevar { "sometitle": ensure => "absent", package => "php", manager => "yum" }' }
|
147 | 147 |
|
148 | 148 | it { expect(@stdout_str).to match %r{Composite_namevar\[sometitle\]/ensure: undefined 'ensure' from 'present'} }
|
149 |
| - it { expect(@stdout_str).to match %r{Looking for \["sometitle"\]} } |
| 149 | + it { expect(@stdout_str).to match %r{Looking for \[\{:package=>"php", :manager=>"yum"\}\]} } |
150 | 150 | it { expect(@status.exitstatus).to eq 2 }
|
151 | 151 | end
|
152 | 152 | end
|
|
0 commit comments