Finish rename of example -> example-tmp.rb

Signed-off-by: Miah Johnson <miah@chia-pet.org>
This commit is contained in:
Miah Johnson 2019-10-10 22:47:02 -07:00
parent 9e1a380f0a
commit ae3ee6f657
3 changed files with 6 additions and 6 deletions

View file

@ -84,7 +84,7 @@ module FunctionalHelper
let(:example_profile) { File.join(examples_path, "profile") } let(:example_profile) { File.join(examples_path, "profile") }
let(:meta_profile) { File.join(examples_path, "meta-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(:inheritance_profile) { File.join(examples_path, "inheritance") }
let(:failure_control) { File.join(profile_path, "failures", "controls", "failures.rb") } let(:failure_control) { File.join(profile_path, "failures", "controls", "failures.rb") }
let(:simple_inheritance) { File.join(profile_path, "simple-inheritance") } let(:simple_inheritance) { File.join(profile_path, "simple-inheritance") }

View file

@ -137,7 +137,7 @@ describe "inspec exec with json formatter" do
it "has all the metadata" do it "has all the metadata" do
actual = profile.dup actual = profile.dup
key = actual.delete("controls") 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") groups = actual.delete("groups")
_(actual).must_equal({ _(actual).must_equal({
"name" => "profile", "name" => "profile",
@ -156,7 +156,7 @@ describe "inspec exec with json formatter" do
}) })
_(groups.sort_by { |x| x["id"] }).must_equal([ _(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/example.rb", "title" => "Example Config Checks", "controls" => ["example-1.0"] },
{ "id" => "controls/meta.rb", "title" => "SSH Server Configuration", "controls" => ["ssh-1"] }, { "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 actual = ex1.dup
src = actual.delete("source_location") 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 _(src["line"]).must_equal 6
result = actual.delete("results")[0] result = actual.delete("results")[0]

View file

@ -73,7 +73,7 @@ describe "inspec json" do
end end
it "has a source location" do 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"]["ref"]).must_equal loc
_(control["source_location"]["line"]).must_equal 6 _(control["source_location"]["line"]).must_equal 6
end end
@ -98,7 +98,7 @@ describe "inspec json" do
_(json["controls"].length).must_equal 1 _(json["controls"].length).must_equal 1
_(json["controls"][0]["id"]).must_equal "tmp-1.0" _(json["controls"][0]["id"]).must_equal "tmp-1.0"
_(json["groups"].length).must_equal 1 _(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
end end