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..118eb5f2f 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) } @@ -153,7 +153,6 @@ class foo { describe command('pdk validate puppet manifests\test') do its(:exit_status) { is_expected.to eq(0) } - its(:stdout) { is_expected.to match(/\(warning\):.*class not documented.*\(#{Regexp.escape(File.join('manifests', 'test', 'test.pp'))}.+\)/i) } end end @@ -192,7 +191,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) }