|
1 | 1 | require 'spec_helper_acceptance' |
2 | 2 |
|
3 | 3 | case fact('osfamily') |
4 | | -when 'AIX' |
5 | | - username = 'root' |
6 | | - groupname = 'system' |
7 | | - scriptname = 'concatfragments.sh' |
8 | | - vardir = default['puppetvardir'] |
9 | | -when 'Darwin' |
10 | | - username = 'root' |
11 | | - groupname = 'wheel' |
12 | | - scriptname = 'concatfragments.sh' |
13 | | - vardir = default['puppetvardir'] |
14 | | -when 'windows' |
15 | | - username = 'Administrator' |
16 | | - groupname = 'Administrators' |
17 | | - scriptname = 'concatfragments.rb' |
18 | | - result = on default, "echo #{default['puppetvardir']}" |
19 | | - vardir = result.raw_output.chomp |
20 | | -when 'Solaris' |
21 | | - username = 'root' |
22 | | - groupname = 'root' |
23 | | - scriptname = 'concatfragments.rb' |
24 | | - vardir = default['puppetvardir'] |
25 | | -else |
26 | | - username = 'root' |
27 | | - groupname = 'root' |
28 | | - scriptname = 'concatfragments.sh' |
29 | | - vardir = default['puppetvardir'] |
| 4 | + when 'AIX' |
| 5 | + username = 'root' |
| 6 | + groupname = 'system' |
| 7 | + scriptname = 'concatfragments.sh' |
| 8 | + vardir = default['puppetvardir'] |
| 9 | + when 'Darwin' |
| 10 | + username = 'root' |
| 11 | + groupname = 'wheel' |
| 12 | + scriptname = 'concatfragments.sh' |
| 13 | + vardir = default['puppetvardir'] |
| 14 | + when 'windows' |
| 15 | + username = 'Administrator' |
| 16 | + groupname = 'Administrators' |
| 17 | + scriptname = 'concatfragments.rb' |
| 18 | + result = on default, "echo #{default['puppetvardir']}" |
| 19 | + vardir = result.raw_output.chomp |
| 20 | + when 'Solaris' |
| 21 | + username = 'root' |
| 22 | + groupname = 'root' |
| 23 | + scriptname = 'concatfragments.rb' |
| 24 | + vardir = default['puppetvardir'] |
| 25 | + else |
| 26 | + username = 'root' |
| 27 | + groupname = 'root' |
| 28 | + scriptname = 'concatfragments.sh' |
| 29 | + vardir = default['puppetvardir'] |
30 | 30 | end |
31 | 31 |
|
32 | 32 | describe 'basic concat test' do |
33 | 33 | basedir = default.tmpdir('concat') |
34 | | - safe_basedir = basedir.gsub(/[\/:]/,'_') |
| 34 | + safe_basedir = basedir.gsub(/[\/:]/, '_') |
35 | 35 |
|
36 | 36 | shared_examples 'successfully_applied' do |pp| |
37 | 37 | it 'applies the manifest twice with no stderr' do |
|
46 | 46 | should be_mode 755 |
47 | 47 | } |
48 | 48 | end |
49 | | - describe file("#{vardir}/concat/bin") do |
| 49 | + describe file("#{vardir}/concat/bin") do |
50 | 50 | it { should be_directory } |
51 | 51 | it { should be_owned_by username } |
52 | 52 | it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) { |
|
128 | 128 | it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) { |
129 | 129 | should be_mode 644 |
130 | 130 | } |
131 | | - it { should contain '1' } |
132 | | - it { should contain '2' } |
| 131 | + its(:content) { |
| 132 | + should match '1' |
| 133 | + should match '2' |
| 134 | + } |
133 | 135 | end |
134 | 136 | describe file("#{vardir}/concat/#{safe_basedir}_file/fragments/01_1") do |
135 | 137 | it { should be_file } |
|
177 | 179 | it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) { |
178 | 180 | should be_mode 644 |
179 | 181 | } |
180 | | - it { should contain '1' } |
| 182 | + its(:content) { should match '1' } |
181 | 183 | end |
182 | 184 | end |
183 | 185 | context 'works when set to absent with path set' do |
|
0 commit comments