From b7d970a1052750d92bc85f53dcf103474f455afd Mon Sep 17 00:00:00 2001 From: david22swan Date: Mon, 28 Oct 2024 10:58:57 +0000 Subject: [PATCH] (CAT2121) Update tests for windows --- spec/acceptance/report_spec.rb | 8 ++++---- spec/acceptance/validate_all_spec.rb | 2 +- spec/acceptance/validate_puppet_spec.rb | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/acceptance/report_spec.rb b/spec/acceptance/report_spec.rb index 33816885a..6b6d59031 100644 --- a/spec/acceptance/report_spec.rb +++ b/spec/acceptance/report_spec.rb @@ -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) } @@ -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) } @@ -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) } @@ -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) } diff --git a/spec/acceptance/validate_all_spec.rb b/spec/acceptance/validate_all_spec.rb index a7deac4e0..a6c87f54a 100644 --- a/spec/acceptance/validate_all_spec.rb +++ b/spec/acceptance/validate_all_spec.rb @@ -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) } diff --git a/spec/acceptance/validate_puppet_spec.rb b/spec/acceptance/validate_puppet_spec.rb index 2288eaf7b..85dbb5b51 100644 --- a/spec/acceptance/validate_puppet_spec.rb +++ b/spec/acceptance/validate_puppet_spec.rb @@ -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) } @@ -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) }