diff --git a/test/fixtures/profiles/filter_table/controls/filter-table-exception-catcher.rb b/test/fixtures/profiles/filter_table/controls/filter-table-exception-catcher.rb index 2ddc4c32f..cf84e3159 100644 --- a/test/fixtures/profiles/filter_table/controls/filter-table-exception-catcher.rb +++ b/test/fixtures/profiles/filter_table/controls/filter-table-exception-catcher.rb @@ -1,5 +1,5 @@ control 'exception_catcher_test' do - describe shadow.users('root') do + describe shadow('/tmp/no-file').users('root') do its(:passwords) { should_not include('*') } end end \ No newline at end of file diff --git a/test/functional/filter_table_test.rb b/test/functional/filter_table_test.rb index 619be68e7..1a38d4e40 100644 --- a/test/functional/filter_table_test.rb +++ b/test/functional/filter_table_test.rb @@ -10,11 +10,6 @@ describe "filtertable functional tests" do run_inspec_process(cmd, run_opts) end - def run_result_for_controls_without_sudo(controls) - cmd = "exec " + ft_profile_path + " --controls " + controls.join(" ") + " --no-sudo" - run_inspec_process(cmd, run_opts) - end - def failed_control_test_outcomes(run_result) failed_controls = @json["profiles"][0]["controls"].select { |ctl| ctl["results"][0]["status"] == "failed" } @@ -144,9 +139,9 @@ describe "filtertable functional tests" do describe "if control fails" do it "should show the exact error message" do controls = ["exception_catcher_test"] - run_result = run_result_for_controls_without_sudo(controls) + run_result = run_result_for_controls(controls) outcome_hash = skipped_control_test_outcomes(run_result) - _(outcome_hash["exception_catcher_test"]).must_include "Can't read file: \/etc\/shadow" + _(outcome_hash["exception_catcher_test"]).must_include "Can't find file: \/tmp\/no-file" assert_exit_code 101, run_result end end