Skip to content

Commit

Permalink
(CAT2121) Update tests for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
david22swan committed Oct 28, 2024
1 parent c3b82b5 commit b7d970a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions spec/acceptance/report_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class report
include_context 'with a fake TTY'
# Tests writing reports to a file
describe command('pdk validate puppet manifests/init.pp --format=text:report.txt') do
its(:exit_status) { is_expected.to eq(1) }
its(:exit_status) { is_expected.to eq(1) | eq(256) }
its(:stdout) { is_expected.to have_no_output }
its(:stderr) { is_expected.to match(/Checking Puppet manifest syntax/i) }
its(:stderr) { is_expected.to match(/Checking Puppet manifest style/i) }
Expand All @@ -32,7 +32,7 @@ class report

# Tests writing reports to stdout doesn't actually write a file named stdout
describe command('pdk validate puppet manifests/init.pp --format=text:stdout') do
its(:exit_status) { is_expected.to eq(1) }
its(:exit_status) { is_expected.to eq(1) | eq(256) }
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(/\(ERROR\):.*Could not parse for environment production.*\(#{Regexp.escape(init_pp)}.*\)/i) }
Expand All @@ -44,7 +44,7 @@ class report

# Tests writing reports to stderr doesn't actually write a file named stderr
describe command('pdk validate puppet manifests/init.pp --format=text:stderr') do
its(:exit_status) { is_expected.to eq(1) }
its(:exit_status) { is_expected.to eq(1) | eq(256) }
its(:stdout) { is_expected.to have_no_output }
its(:stderr) { is_expected.to match(/Checking Puppet manifest syntax/i) }
its(:stderr) { is_expected.to match(/Checking Puppet manifest style/i) }
Expand All @@ -63,7 +63,7 @@ class report

context 'when not run interactively' do
describe command('pdk validate puppet manifests/init.pp') do
its(:exit_status) { is_expected.to eq(1) }
its(:exit_status) { is_expected.to eq(1) | eq(256) }
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(/\(ERROR\):.*Could not parse for environment production.*\(#{Regexp.escape(init_pp)}.*\)/i) }
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/validate_all_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class pdk_in_gemfile {}
end

describe command('pdk validate') do
its(:exit_status) { is_expected.to eq(1) }
its(:exit_status) { is_expected.to eq(1) | eq(256) }
its(:stderr) { is_expected.to match(/Running all available validators/i) }
its(:stderr) { is_expected.to match(/Checking metadata syntax/i) }
its(:stderr) { is_expected.to match(/Checking module metadata style/i) }
Expand Down
4 changes: 2 additions & 2 deletions spec/acceptance/validate_puppet_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class foo {
end

describe command('pdk validate puppet --format text:stdout --format junit:report.xml') do
its(:exit_status) { is_expected.to eq(1) }
its(:exit_status) { is_expected.to eq(1) | eq(256) }
its(:stderr) { is_expected.not_to match(epp_spinner_text) }
its(:stderr) { is_expected.to match(syntax_spinner_text) }
its(:stderr) { is_expected.to match(lint_spinner_text) }
Expand Down Expand Up @@ -192,7 +192,7 @@ class pdk_in_gemfile {}
end

describe command('pdk validate puppet --format text:stdout --format junit:report.xml') do
its(:exit_status) { is_expected.to eq(1) }
its(:exit_status) { is_expected.to eq(1) | eq(256) }
its(:stdout) { is_expected.to match(/\(warning\):.*indent should be 0 chars and is 2.*\(#{Regexp.escape(init_pp)}.+\)/i) }
its(:stderr) { is_expected.not_to match(epp_spinner_text) }
its(:stderr) { is_expected.to match(syntax_spinner_text) }
Expand Down

0 comments on commit b7d970a

Please sign in to comment.