diff options
author | Thom May <thom@chef.io> | 2016-05-10 17:09:57 +0100 |
---|---|---|
committer | Thom May <thom@chef.io> | 2016-05-16 13:38:12 +0100 |
commit | 09ae18ee32b61e1b3c607dcc84c9d59d2c300428 (patch) | |
tree | 0add1084ac4642c5119dff102000075bf6d58321 /spec | |
parent | 9bd561b2fafe03444d690bef0b882a446b327cd6 (diff) | |
download | chef-09ae18ee32b61e1b3c607dcc84c9d59d2c300428.tar.gz |
Ensure that solo specific code is run at the proper time
ie, only when we're in OG mode and not in local mode.
Signed-off-by: Thom May <thom@chef.io>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/integration/solo/solo_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/application/apply_spec.rb | 4 | ||||
-rw-r--r-- | spec/unit/client_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/cookbook/synchronizer_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/data_bag_item_spec.rb | 4 | ||||
-rw-r--r-- | spec/unit/data_bag_spec.rb | 4 | ||||
-rw-r--r-- | spec/unit/environment_spec.rb | 8 | ||||
-rw-r--r-- | spec/unit/policy_builder/dynamic_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/policy_builder/policyfile_spec.rb | 2 |
9 files changed, 15 insertions, 15 deletions
diff --git a/spec/integration/solo/solo_spec.rb b/spec/integration/solo/solo_spec.rb index 5add4849e9..f142798546 100644 --- a/spec/integration/solo/solo_spec.rb +++ b/spec/integration/solo/solo_spec.rb @@ -15,7 +15,7 @@ describe "chef-solo" do let(:cookbook_ancient_100_metadata_rb) { cb_metadata("ancient", "1.0.0") } - let(:chef_solo) { "ruby bin/chef-solo --minimal-ohai" } + let(:chef_solo) { "ruby bin/chef-solo --legacy-mode --minimal-ohai" } when_the_repository "has a cookbook with a basic recipe" do before do diff --git a/spec/unit/application/apply_spec.rb b/spec/unit/application/apply_spec.rb index d223d55d2b..6473666fbf 100644 --- a/spec/unit/application/apply_spec.rb +++ b/spec/unit/application/apply_spec.rb @@ -24,13 +24,13 @@ describe Chef::Application::Apply do allow(@app).to receive(:configure_logging).and_return(true) allow(Chef::Log).to receive(:debug).with("FIPS mode is enabled.") @recipe_text = "package 'nyancat'" - Chef::Config[:solo] = true + Chef::Config[:solo_legacy_mode] = true end describe "configuring the application" do it "should set solo mode to true" do @app.reconfigure - expect(Chef::Config[:solo]).to be_truthy + expect(Chef::Config[:solo_legacy_mode]).to be_truthy end end describe "read_recipe_file" do diff --git a/spec/unit/client_spec.rb b/spec/unit/client_spec.rb index fe9b1afe01..ec3f70b9b0 100644 --- a/spec/unit/client_spec.rb +++ b/spec/unit/client_spec.rb @@ -462,7 +462,7 @@ describe Chef::Client do describe "assert_cookbook_path_not_empty" do before do - Chef::Config[:solo] = true + Chef::Config[:solo_legacy_mode] = true Chef::Config[:cookbook_path] = ["/path/to/invalid/cookbook_path"] end diff --git a/spec/unit/cookbook/synchronizer_spec.rb b/spec/unit/cookbook/synchronizer_spec.rb index 97e7569cf4..3f5624f3b0 100644 --- a/spec/unit/cookbook/synchronizer_spec.rb +++ b/spec/unit/cookbook/synchronizer_spec.rb @@ -50,7 +50,7 @@ describe Chef::CookbookCacheCleaner do end it "does not remove anything on chef-solo" do - Chef::Config[:solo] = true + 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) cleaner.cleanup_file_cache diff --git a/spec/unit/data_bag_item_spec.rb b/spec/unit/data_bag_item_spec.rb index 99bf89e583..2711fcae03 100644 --- a/spec/unit/data_bag_item_spec.rb +++ b/spec/unit/data_bag_item_spec.rb @@ -365,11 +365,11 @@ describe Chef::DataBagItem do describe "in solo mode" do before do - Chef::Config[:solo] = true + Chef::Config[:solo_legacy_mode] = true end after do - Chef::Config[:solo] = false + Chef::Config[:solo_legacy_mode] = false end it "converts the raw data to a data bag item" do diff --git a/spec/unit/data_bag_spec.rb b/spec/unit/data_bag_spec.rb index 92da4cade1..84aa724927 100644 --- a/spec/unit/data_bag_spec.rb +++ b/spec/unit/data_bag_spec.rb @@ -143,13 +143,13 @@ describe Chef::DataBag do shared_examples_for "data bag in solo mode" do |data_bag_path| before do - Chef::Config[:solo] = true + Chef::Config[:solo_legacy_mode] = true Chef::Config[:data_bag_path] = data_bag_path @paths = Array(data_bag_path) end after do - Chef::Config[:solo] = false + Chef::Config[:solo_legacy_mode] = false end it "should get the data bag from the data_bag_path" do diff --git a/spec/unit/environment_spec.rb b/spec/unit/environment_spec.rb index 4689c60b39..5557b5dc11 100644 --- a/spec/unit/environment_spec.rb +++ b/spec/unit/environment_spec.rb @@ -288,11 +288,11 @@ describe Chef::Environment do describe "in solo mode" do before do - Chef::Config[:solo] = true + Chef::Config[:solo_legacy_mode] = true end after do - Chef::Config[:solo] = false + Chef::Config[:solo_legacy_mode] = false end it "should raise and exception" do @@ -392,12 +392,12 @@ describe Chef::Environment do describe "when loading" do describe "in solo mode" do before do - Chef::Config[:solo] = true + Chef::Config[:solo_legacy_mode] = true Chef::Config[:environment_path] = "/var/chef/environments" end after do - Chef::Config[:solo] = false + Chef::Config[:solo_legacy_mode] = false end it "should get the environment from the environment_path" do diff --git a/spec/unit/policy_builder/dynamic_spec.rb b/spec/unit/policy_builder/dynamic_spec.rb index f91b0ba7d2..d94b2a69a2 100644 --- a/spec/unit/policy_builder/dynamic_spec.rb +++ b/spec/unit/policy_builder/dynamic_spec.rb @@ -254,7 +254,7 @@ describe Chef::PolicyBuilder::Dynamic do context "when running chef solo" do before do - Chef::Config[:solo] = true + Chef::Config[:solo_legacy_mode] = true expect(Chef::Node).to receive(:build).with(node_name).and_return(node) expect(policy_builder).to receive(:select_implementation).with(node) expect(implementation).to receive(:finish_load_node).with(node) diff --git a/spec/unit/policy_builder/policyfile_spec.rb b/spec/unit/policy_builder/policyfile_spec.rb index 0f345ee344..307bd45c18 100644 --- a/spec/unit/policy_builder/policyfile_spec.rb +++ b/spec/unit/policy_builder/policyfile_spec.rb @@ -115,7 +115,7 @@ describe Chef::PolicyBuilder::Policyfile do end context "chef-solo" do - before { Chef::Config[:solo] = true } + before { Chef::Config[:solo_legacy_mode] = true } it "errors on create" do expect { initialize_pb }.to raise_error(err_namespace::UnsupportedFeature) |