From 44aae2c29d0c4ba28b4dbfc8c638036d8a2663ec Mon Sep 17 00:00:00 2001 From: Marc Chamberland Date: Sun, 5 May 2019 18:55:51 -0400 Subject: distro constants for solo, zero and automate Signed-off-by: Marc Chamberland --- spec/unit/cookbook/synchronizer_spec.rb | 3 ++- spec/unit/environment_spec.rb | 2 +- spec/unit/policy_builder/policyfile_spec.rb | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'spec/unit') diff --git a/spec/unit/cookbook/synchronizer_spec.rb b/spec/unit/cookbook/synchronizer_spec.rb index 1291b230c1..dc68bf1824 100644 --- a/spec/unit/cookbook/synchronizer_spec.rb +++ b/spec/unit/cookbook/synchronizer_spec.rb @@ -1,6 +1,7 @@ require "spec_helper" require "chef/cookbook/synchronizer" require "chef/cookbook_version" +require "chef/dist" describe Chef::CookbookCacheCleaner do describe "when cleaning up unused cookbook components" do @@ -49,7 +50,7 @@ describe Chef::CookbookCacheCleaner do cleaner.cleanup_file_cache end - it "does not remove anything on chef-solo" do + it "does not remove anything on #{Chef::Dist::SOLOEXEC}" do Chef::Config[:solo_legacy_mode] = true allow(cleaner.cache).to receive(:find).and_return(%w{cookbooks/valid1/recipes/default.rb cookbooks/valid2/recipes/default.rb}) expect(cleaner.cache).not_to receive(:delete) diff --git a/spec/unit/environment_spec.rb b/spec/unit/environment_spec.rb index 1841707c2d..07d8f5f552 100644 --- a/spec/unit/environment_spec.rb +++ b/spec/unit/environment_spec.rb @@ -299,7 +299,7 @@ describe Chef::Environment do expect do Chef::Environment.validate_cookbook_version("= 1.2.3.4") end.to raise_error Chef::Exceptions::IllegalVersionConstraint, - "Environment cookbook version constraints not allowed in chef-solo" + "Environment cookbook version constraints not allowed in .*" end end diff --git a/spec/unit/policy_builder/policyfile_spec.rb b/spec/unit/policy_builder/policyfile_spec.rb index f22e2a74b3..1293d6ebc6 100644 --- a/spec/unit/policy_builder/policyfile_spec.rb +++ b/spec/unit/policy_builder/policyfile_spec.rb @@ -150,7 +150,7 @@ describe Chef::PolicyBuilder::Policyfile do expect(initialize_pb.temporary_policy?).to be_falsey end - context "chef-solo" do + context "#{Chef::Dist::SOLOEXEC}" do before { Chef::Config[:solo_legacy_mode] = true } it "errors on create" do -- cgit v1.2.1