From ae3ee6f657eedcb8c616a6bd2499fb8a8e156115 Mon Sep 17 00:00:00 2001 From: Miah Johnson Date: Thu, 10 Oct 2019 22:47:02 -0700 Subject: [PATCH] Finish rename of example -> example-tmp.rb Signed-off-by: Miah Johnson --- test/functional/helper.rb | 2 +- test/functional/inspec_exec_json_test.rb | 6 +++--- test/functional/inspec_json_profile_test.rb | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/functional/helper.rb b/test/functional/helper.rb index 629d6eba5..a22af612e 100644 --- a/test/functional/helper.rb +++ b/test/functional/helper.rb @@ -84,7 +84,7 @@ module FunctionalHelper let(:example_profile) { File.join(examples_path, "profile") } let(:meta_profile) { File.join(examples_path, "meta-profile") } - let(:example_control) { File.join(example_profile, "controls", "example.rb") } + let(:example_control) { File.join(example_profile, "controls", "example-tmp.rb") } let(:inheritance_profile) { File.join(examples_path, "inheritance") } let(:failure_control) { File.join(profile_path, "failures", "controls", "failures.rb") } let(:simple_inheritance) { File.join(profile_path, "simple-inheritance") } diff --git a/test/functional/inspec_exec_json_test.rb b/test/functional/inspec_exec_json_test.rb index a6a349a2e..6aae5cfe7 100644 --- a/test/functional/inspec_exec_json_test.rb +++ b/test/functional/inspec_exec_json_test.rb @@ -137,7 +137,7 @@ describe "inspec exec with json formatter" do it "has all the metadata" do actual = profile.dup key = actual.delete("controls") - .find { |x| x["id"] =~ /generated from example.rb/ }["id"] + .find { |x| p x; x["id"] =~ /generated from example/ }["id"] groups = actual.delete("groups") _(actual).must_equal({ "name" => "profile", @@ -156,7 +156,7 @@ describe "inspec exec with json formatter" do }) _(groups.sort_by { |x| x["id"] }).must_equal([ - { "id" => "controls/example.rb", "title" => "/tmp profile", "controls" => ["tmp-1.0", key] }, + { "id" => "controls/example-tmp.rb", "title" => "/tmp profile", "controls" => ["tmp-1.0", key] }, { "id" => "controls/example.rb", "title" => "Example Config Checks", "controls" => ["example-1.0"] }, { "id" => "controls/meta.rb", "title" => "SSH Server Configuration", "controls" => ["ssh-1"] }, ]) @@ -180,7 +180,7 @@ describe "inspec exec with json formatter" do actual = ex1.dup src = actual.delete("source_location") - _(src["ref"]).must_match %r{test/unit/mock/profiles/old-examples/profile/controls/example.rb$} + _(src["ref"]).must_match %r{test/unit/mock/profiles/old-examples/profile/controls/example-tmp.rb$} _(src["line"]).must_equal 6 result = actual.delete("results")[0] diff --git a/test/functional/inspec_json_profile_test.rb b/test/functional/inspec_json_profile_test.rb index 01050f72c..7b74d56dc 100644 --- a/test/functional/inspec_json_profile_test.rb +++ b/test/functional/inspec_json_profile_test.rb @@ -73,7 +73,7 @@ describe "inspec json" do end it "has a source location" do - loc = File.join(example_profile, "/controls/example.rb") + loc = File.join(example_profile, "/controls/example-tmp.rb") _(control["source_location"]["ref"]).must_equal loc _(control["source_location"]["line"]).must_equal 6 end @@ -98,7 +98,7 @@ describe "inspec json" do _(json["controls"].length).must_equal 1 _(json["controls"][0]["id"]).must_equal "tmp-1.0" _(json["groups"].length).must_equal 1 - _(json["groups"][0]["id"]).must_equal "controls/example.rb" + _(json["groups"][0]["id"]).must_equal "controls/example-tmp.rb" end end