diff --git a/Gemfile b/Gemfile index 0632b97a7..8d2543933 100644 --- a/Gemfile +++ b/Gemfile @@ -31,7 +31,7 @@ group :test do gem "m" gem "pry", "~> 0.10" gem "pry-byebug" - gem "html-proofer" + gem "html-proofer", platforms: :ruby # do not attempt to run proofer on windows end group :integration do diff --git a/lib/plugins/inspec-reporter-html2/test/functional/inspec_reporter_html2_test.rb b/lib/plugins/inspec-reporter-html2/test/functional/inspec_reporter_html2_test.rb index c56a2c38c..41a09cfa9 100644 --- a/lib/plugins/inspec-reporter-html2/test/functional/inspec_reporter_html2_test.rb +++ b/lib/plugins/inspec-reporter-html2/test/functional/inspec_reporter_html2_test.rb @@ -1,6 +1,5 @@ require_relative "../../../shared/core_plugin_test_helper.rb" require "tempfile" -require "html-proofer" describe "inspec-reporter-html2" do include CorePluginFunctionalHelper @@ -11,14 +10,21 @@ describe "inspec-reporter-html2" do end describe "when run on a basic profile" do - let(:run_result) { run_inspec_process("exec #{profile_path}/old-examples/profile --reporter html2:#{output_file}") } + # --no-distinct-exit is needed because this profile skips a control on windows + let(:run_result) { run_inspec_process("exec #{profile_path}/old-examples/profile --no-distinct-exit --reporter html2:#{output_file}") } it "it should not crash inspec" do - _(run_result.stderr).must_be_empty + _(run_result.stderr.gsub("#< CLIXML\r\n", "")).must_be_empty _(run_result.exit_status).must_equal 0 end it "should produce valid HTML" do + # Our windows CI images are not setup for the HTML proofer libcurl DLLs + # and we really only need to verify this on one platform + return if is_windows? + + require "html-proofer" + proofer_opts = { disable_external: true, # The old-example has 3 Ref links that are all 404s check_html: true,