diff --git a/README.md b/README.md index 24fc614..cb9f091 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# run-context InSpec Text Profile +# Audit Cookbook run-context InSpec Test Profile -This is a test inspec profile used to exercise the ability of InSpec to determine how it is being run -under Test Kitchen and Audit Cookbook. +This is a test inspec profile used to exercise the ability of InSpec to detect when it is being run +under Audit Cookbook. It is not a typical profile and is not intended for normal public consumption, nor is it a good example. diff --git a/controls/during-audit.rb b/controls/during-audit.rb new file mode 100644 index 0000000..a7cb03c --- /dev/null +++ b/controls/during-audit.rb @@ -0,0 +1,16 @@ + + +stack = caller_locations(4) +control "json-stack" do + describe stack.to_json do + it { should be_kind_of String } + end +end + +require "inspec/utils/telemetry/run_context" + +control "run-context" do + describe Inspec::Telemetry::RunContextProbe.guess_run_context do + it { should cmp "audit-cookbook" } + end +end diff --git a/controls/run-controls.rb b/controls/run-controls.rb deleted file mode 100644 index 842bee9..0000000 --- a/controls/run-controls.rb +++ /dev/null @@ -1,7 +0,0 @@ - -stack = caller_locations(4) -control "json-stack" do - describe JSON.dump(stack) do - its('length') { should be 0 } # intentionally fail, just dump - end -end diff --git a/inspec.yml b/inspec.yml index 3d76792..94b4664 100644 --- a/inspec.yml +++ b/inspec.yml @@ -1,10 +1,10 @@ -name: inspec-test-profile-run-context +name: inspec-test-profile-run-context-audit title: InSpec Profile maintainer: InSpec Engineering copyright: Chef Software, Inc. copyright_email: inspec@chef.io license: Apache-2.0 -summary: An InSpec Compliance Profile to test inspec run context detection under test-kitchen +summary: An InSpec Compliance Profile to test inspec run context detection under audit-cookbook version: 0.1.0 supports: platform: os