summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2016-02-24 20:29:40 -0800
committerJay Mundrawala <jdmundrawala@gmail.com>2016-02-24 21:27:19 -0800
commitdf7683d77a25b8a64c683cf14a686d6c41134432 (patch)
tree0617377d762c4cd815940424f8b107f9f0576632
parent3077de7bd41ffd55895276f61fa968f0f0de8c70 (diff)
downloadchef-df7683d77a25b8a64c683cf14a686d6c41134432.tar.gz
Rename read_config to apply_config
This makes it the same as application/client.rb. This will let the mixin be used the same way in both places.
-rw-r--r--chef-config/lib/chef-config/mixin/dot_d.rb2
-rw-r--r--chef-config/lib/chef-config/workstation_config_loader.rb4
-rw-r--r--chef-config/spec/unit/workstation_config_loader_spec.rb8
3 files changed, 7 insertions, 7 deletions
diff --git a/chef-config/lib/chef-config/mixin/dot_d.rb b/chef-config/lib/chef-config/mixin/dot_d.rb
index dc751f8964..778c25d7f9 100644
--- a/chef-config/lib/chef-config/mixin/dot_d.rb
+++ b/chef-config/lib/chef-config/mixin/dot_d.rb
@@ -30,7 +30,7 @@ module ChefConfig
end
end
dot_d_files.sort.map do |conf|
- read_config(IO.read(conf), conf)
+ apply_config(IO.read(conf), conf)
end
end
end
diff --git a/chef-config/lib/chef-config/workstation_config_loader.rb b/chef-config/lib/chef-config/workstation_config_loader.rb
index 89e703ff8c..ba15a1eb5d 100644
--- a/chef-config/lib/chef-config/workstation_config_loader.rb
+++ b/chef-config/lib/chef-config/workstation_config_loader.rb
@@ -71,7 +71,7 @@ module ChefConfig
# Have to set Config.config_file b/c other config is derived from it.
Config.config_file = config_location
- read_config(IO.read(config_location), config_location)
+ apply_config(IO.read(config_location), config_location)
end
load_dot_d(Config[:conf_d_dir]) if Config[:conf_d_dir]
@@ -138,7 +138,7 @@ module ChefConfig
a
end
- def read_config(config_content, config_file_path)
+ def apply_config(config_content, config_file_path)
Config.from_string(config_content, config_file_path)
rescue SignalException
raise
diff --git a/chef-config/spec/unit/workstation_config_loader_spec.rb b/chef-config/spec/unit/workstation_config_loader_spec.rb
index cae9ce4304..f24265ddff 100644
--- a/chef-config/spec/unit/workstation_config_loader_spec.rb
+++ b/chef-config/spec/unit/workstation_config_loader_spec.rb
@@ -221,7 +221,7 @@ RSpec.describe ChefConfig::WorkstationConfigLoader do
it "skips loading" do
expect(config_loader.config_location).to be(nil)
- expect(config_loader).not_to receive(:read_config)
+ expect(config_loader).not_to receive(:apply_config)
config_loader.load
end
@@ -261,7 +261,7 @@ RSpec.describe ChefConfig::WorkstationConfigLoader do
let(:config_content) { "config_file_evaluated(true)" }
it "loads the config" do
- expect(config_loader).to receive(:read_config).and_call_original
+ expect(config_loader).to receive(:apply_config).and_call_original
config_loader.load
expect(ChefConfig::Config.config_file_evaluated).to be(true)
end
@@ -321,7 +321,7 @@ RSpec.describe ChefConfig::WorkstationConfigLoader do
let(:config_content) { "config_d_file_evaluated(true)" }
it "loads the config" do
- expect(config_loader).to receive(:read_config).and_call_original
+ expect(config_loader).to receive(:apply_config).and_call_original
config_loader.load
expect(ChefConfig::Config.config_d_file_evaluated).to be(true)
end
@@ -359,7 +359,7 @@ RSpec.describe ChefConfig::WorkstationConfigLoader do
end
it "does not load anything" do
- expect(config_loader).not_to receive(:read_config)
+ expect(config_loader).not_to receive(:apply_config)
end
end
end