Skip to content

Commit

Permalink
(CAT-2121) Update tests to account for validate changes
Browse files Browse the repository at this point in the history
  • Loading branch information
david22swan committed Oct 24, 2024
1 parent 2d2d7a1 commit 1d9b5b4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions spec/acceptance/report_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
before(:all) do
File.open(init_pp, 'w') do |f|
f.puts <<~EOS
class report {}
class report
EOS
end
end
Expand All @@ -25,8 +25,8 @@ class report {}

describe file('report.txt') do
it { is_expected.to exist }
# pdk (WARNING): puppet-lint: class not documented (manifests/init.pp:1:1)
its(:content) { is_expected.to match(/\(warning\):.*class not documented.*\(#{Regexp.escape(init_pp)}.*\)/i) }
# pdk (ERROR): puppet-syntax: Could not parse for environment production: Syntax error at end of input (manifests/init.pp)
its(:content) { is_expected.to match(/\(ERROR\):.*Could not parse for environment production.*\(#{Regexp.escape(init_pp)}.*\)/i) }
end
end

Expand All @@ -35,7 +35,7 @@ class report {}
its(:exit_status) { is_expected.to eq(0) }
its(:stderr) { is_expected.to match(/Checking Puppet manifest syntax/i) }
its(:stderr) { is_expected.to match(/Checking Puppet manifest style/i) }
its(:stdout) { is_expected.to match(/\(warning\):.*class not documented.*\(#{Regexp.escape(init_pp)}.*\)/i) }
its(:stdout) { is_expected.to match(//\(ERROR\):.*Could not parse for environment production.*\(#{Regexp.escape(init_pp)}.*\)/i) }

describe file('stdout') do
it { is_expected.not_to exist }
Expand All @@ -52,7 +52,7 @@ class report {}
its(:stderr) do
# Due to spinners writing at arbitrary cursor locations, we can't depend on the text
# being at a the beginning of a line.
is_expected.to match(/\(warning\):.*class not documented.*\(#{Regexp.escape(init_pp)}.*\)/i)
is_expected.to match(//\(ERROR\):.*Could not parse for environment production.*\(#{Regexp.escape(init_pp)}.*\)/i)
end

describe file('stderr') do
Expand All @@ -66,7 +66,7 @@ class report {}
its(:exit_status) { is_expected.to eq(0) }
its(:stderr) { is_expected.to match(/using ruby \d+\.\d+\.\d+/i) }
its(:stderr) { is_expected.to match(/using puppet \d+\.\d+\.\d+/i) }
its(:stdout) { is_expected.to match(/\(warning\):.*class not documented.*\(#{Regexp.escape(init_pp)}.*\)/i) }
its(:stdout) { is_expected.to match(//\(ERROR\):.*Could not parse for environment production.*\(#{Regexp.escape(init_pp)}.*\)/i) }
end
end
end
Expand Down

0 comments on commit 1d9b5b4

Please sign in to comment.