|
15 | 15 | it 'puts a bad syntax yaml file in the error files hash' do |
16 | 16 | DataParser.yaml(["#{fixtures_dir}hieradata/syntax.yaml"]) |
17 | 17 | expect(PuppetCheck.files[:errors].keys).to eql(["#{fixtures_dir}hieradata/syntax.yaml"]) |
18 | | - expect(PuppetCheck.files[:errors]["#{fixtures_dir}hieradata/syntax.yaml"].join("\n")).to match(%r{^block sequence entries are not allowed}) |
| 18 | + expect(PuppetCheck.files[:errors]["#{fixtures_dir}hieradata/syntax.yaml"].join("\n")).to match(/^block sequence entries are not allowed/) |
19 | 19 | expect(PuppetCheck.files[:warnings]).to eql({}) |
20 | 20 | expect(PuppetCheck.files[:clean]).to eql([]) |
21 | 21 | end |
22 | 22 | it 'puts a good yaml file with potential hiera issues in the warning files array' do |
23 | 23 | DataParser.yaml(["#{fixtures_dir}hieradata/style.yaml"]) |
24 | 24 | expect(PuppetCheck.files[:errors]).to eql({}) |
25 | 25 | expect(PuppetCheck.files[:warnings].keys).to eql(["#{fixtures_dir}hieradata/style.yaml"]) |
26 | | - expect(PuppetCheck.files[:warnings]["#{fixtures_dir}hieradata/style.yaml"].join("\n")).to match(%r{^Value\(s\) missing in key.*\nValue\(s\) missing in key.*\nThe string --- appears more than once in this data and Hiera may fail to parse it correctly}) |
| 26 | + expect(PuppetCheck.files[:warnings]["#{fixtures_dir}hieradata/style.yaml"].join("\n")).to match(/^Value\(s\) missing in key.*\nValue\(s\) missing in key.*\nThe string --- appears more than once in this data and Hiera may fail to parse it correctly/) |
27 | 27 | expect(PuppetCheck.files[:clean]).to eql([]) |
28 | 28 | end |
29 | 29 | it 'puts a good yaml file in the clean files array' do |
|
47 | 47 | it 'puts a bad syntax eyaml file in the error files hash' do |
48 | 48 | DataParser.eyaml(["#{fixtures_dir}hieradata/syntax.eyaml"], "#{fixtures_dir}keys/public_key.pkcs7.pem", "#{fixtures_dir}keys/private_key.pkcs7.pem") |
49 | 49 | expect(PuppetCheck.files[:errors].keys).to eql(["#{fixtures_dir}hieradata/syntax.eyaml"]) |
50 | | - expect(PuppetCheck.files[:errors]["#{fixtures_dir}hieradata/syntax.eyaml"].join("\n")).to match(%r{^block sequence entries are not allowed}) |
| 50 | + expect(PuppetCheck.files[:errors]["#{fixtures_dir}hieradata/syntax.eyaml"].join("\n")).to match(/^block sequence entries are not allowed/) |
51 | 51 | expect(PuppetCheck.files[:warnings]).to eql({}) |
52 | 52 | expect(PuppetCheck.files[:clean]).to eql([]) |
53 | 53 | end |
54 | 54 | it 'puts a good eyaml file with potential hiera issues in the warning files array' do |
55 | 55 | DataParser.eyaml(["#{fixtures_dir}hieradata/style.eyaml"], "#{fixtures_dir}keys/public_key.pkcs7.pem", "#{fixtures_dir}keys/private_key.pkcs7.pem") |
56 | 56 | expect(PuppetCheck.files[:errors]).to eql({}) |
57 | 57 | expect(PuppetCheck.files[:warnings].keys).to eql(["#{fixtures_dir}hieradata/style.eyaml"]) |
58 | | - expect(PuppetCheck.files[:warnings]["#{fixtures_dir}hieradata/style.eyaml"].join("\n")).to match(%r{^Value\(s\) missing in key.*\nValue\(s\) missing in key.*\nThe string --- appears more than once in this data and Hiera may fail to parse it correctly}) |
| 58 | + expect(PuppetCheck.files[:warnings]["#{fixtures_dir}hieradata/style.eyaml"].join("\n")).to match(/^Value\(s\) missing in key.*\nValue\(s\) missing in key.*\nThe string --- appears more than once in this data and Hiera may fail to parse it correctly/) |
59 | 59 | expect(PuppetCheck.files[:clean]).to eql([]) |
60 | 60 | end |
61 | 61 | it 'puts a good eyaml file in the clean files array' do |
|
70 | 70 | it 'puts a bad syntax json file in the error files hash' do |
71 | 71 | DataParser.json(["#{fixtures_dir}hieradata/syntax.json"]) |
72 | 72 | expect(PuppetCheck.files[:errors].keys).to eql(["#{fixtures_dir}hieradata/syntax.json"]) |
73 | | - expect(PuppetCheck.files[:errors]["#{fixtures_dir}hieradata/syntax.json"].join("\n")).to match(%r{^.*unexpected token}) |
| 73 | + expect(PuppetCheck.files[:errors]["#{fixtures_dir}hieradata/syntax.json"].join("\n")).to match(/^.*unexpected token/) |
74 | 74 | expect(PuppetCheck.files[:warnings]).to eql({}) |
75 | 75 | expect(PuppetCheck.files[:clean]).to eql([]) |
76 | 76 | end |
77 | 77 | it 'puts a bad metadata json file in the error files hash' do |
78 | 78 | DataParser.json(["#{fixtures_dir}metadata_syntax/metadata.json"]) |
79 | 79 | expect(PuppetCheck.files[:errors].keys).to eql(["#{fixtures_dir}metadata_syntax/metadata.json"]) |
80 | | - expect(PuppetCheck.files[:errors]["#{fixtures_dir}metadata_syntax/metadata.json"].join("\n")).to match(%r{^Required field.*\nField 'requirements'.*\nDuplicate dependencies.*\nDeprecated field.*\nSummary exceeds}) |
| 80 | + expect(PuppetCheck.files[:errors]["#{fixtures_dir}metadata_syntax/metadata.json"].join("\n")).to match(/^Required field.*\nField 'requirements'.*\nDuplicate dependencies.*\nDeprecated field.*\nSummary exceeds/) |
81 | 81 | expect(PuppetCheck.files[:warnings]).to eql({}) |
82 | 82 | expect(PuppetCheck.files[:clean]).to eql([]) |
83 | 83 | end |
84 | 84 | it 'puts a bad style metadata json file in the warning files array' do |
85 | 85 | DataParser.json(["#{fixtures_dir}metadata_style/metadata.json"]) |
86 | 86 | expect(PuppetCheck.files[:errors]).to eql({}) |
87 | 87 | expect(PuppetCheck.files[:warnings].keys).to eql(["#{fixtures_dir}metadata_style/metadata.json"]) |
88 | | - expect(PuppetCheck.files[:warnings]["#{fixtures_dir}metadata_style/metadata.json"].join("\n")).to match(%r{^'pe' is missing an upper bound.\n.*operatingsystem_support.*\nLicense identifier}) |
| 88 | + expect(PuppetCheck.files[:warnings]["#{fixtures_dir}metadata_style/metadata.json"].join("\n")).to match(/^'pe' is missing an upper bound.\n.*operatingsystem_support.*\nLicense identifier/) |
89 | 89 | expect(PuppetCheck.files[:clean]).to eql([]) |
90 | 90 | end |
91 | 91 | it 'puts another bad style metadata json file in the warning files array' do |
|
99 | 99 | DataParser.json(["#{fixtures_dir}task_metadata/task_bad.json"]) |
100 | 100 | expect(PuppetCheck.files[:errors]).to eql({}) |
101 | 101 | expect(PuppetCheck.files[:warnings].keys).to eql(["#{fixtures_dir}task_metadata/task_bad.json"]) |
102 | | - expect(PuppetCheck.files[:warnings]["#{fixtures_dir}task_metadata/task_bad.json"].join("\n")).to match(%r{^description value is not a String\ninput_method value is not one of environment, stdin, or powershell\nparameters value is not a Hash\npuppet_task_version value is not an Integer\nsupports_noop value is not a Boolean}) |
| 102 | + expect(PuppetCheck.files[:warnings]["#{fixtures_dir}task_metadata/task_bad.json"].join("\n")).to match(/^description value is not a String\ninput_method value is not one of environment, stdin, or powershell\nparameters value is not a Hash\npuppet_task_version value is not an Integer\nsupports_noop value is not a Boolean/) |
103 | 103 | expect(PuppetCheck.files[:clean]).to eql([]) |
104 | 104 | end |
105 | 105 | it 'puts a good json file in the clean files array' do |
|
0 commit comments