Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

Commit

Permalink
Oops, fix some test failures
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Cowie <jonlives@gmail.com>
  • Loading branch information
jonlives committed Jun 5, 2018
1 parent 5c3465b commit 6366708
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions spec/unit/command/generator_commands/repo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,9 @@ def generator_context
expect(File).to_not exist(File.join(repo_path, "environments"))
end

describe "policies" do
describe "policyfiles" do
describe "README.md" do
let(:file) { "policies/README.md" }
let(:file) { "policyfiles/README.md" }

let(:expected_content) do
<<-README
Expand All @@ -315,8 +315,8 @@ def generator_context

let(:argv) { %w{new_repo --roles} }

it "does not create a policies directory" do
expect(File).to_not exist(File.join(repo_path, "policies"))
it "does not create a policyfiles directory" do
expect(File).to_not exist(File.join(repo_path, "policyfiles"))
end

describe "roles" do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ def build_lockdata(cookbooks)
end
end

let(:policies) { [] }
let(:policyfiles) { [] }

let(:cookbook_source) { ChefDK::Policyfile::IncludedPoliciesCookbookSource.new(policies) }
let(:cookbook_source) { ChefDK::Policyfile::IncludedPoliciesCookbookSource.new(policyfiles) }

context "when no policies are included" do
it "returns false for preferred_source_for" do
Expand All @@ -152,7 +152,7 @@ def build_lockdata(cookbooks)
end

context "when a single policy is to be included" do
let(:policies) { [policy1_location_spec] }
let(:policyfiles) { [policy1_location_spec] }

it "does not have a preferred source for unlocked cookbooks" do
expect(cookbook_source.preferred_source_for?("cookbookC")).to eq(false)
Expand Down Expand Up @@ -185,7 +185,7 @@ def build_lockdata(cookbooks)
end

context "when multiple policies are to be included" do
let(:policies) { [policy1_location_spec, policy2_location_spec] }
let(:policyfiles) { [policy1_location_spec, policy2_location_spec] }

context "when the policies use the same cookbooks with the same versions and sources" do
let(:policy2_cookbooks) { policy1_cookbooks + [{ name: "cookbookC", version: "2.0.0" }] }
Expand Down

0 comments on commit 6366708

Please sign in to comment.