diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2016-02-24 20:53:21 -0800 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2016-02-24 21:27:19 -0800 |
commit | 8741f64af2120c9bde40e98464e9724130dd9b80 (patch) | |
tree | f09edf491d228778534927d1be7d13ab183c3981 /spec/unit/application | |
parent | df7683d77a25b8a64c683cf14a686d6c41134432 (diff) | |
download | chef-8741f64af2120c9bde40e98464e9724130dd9b80.tar.gz |
Refactor application/client.rb to use DotD mixin for loading client.d
Diffstat (limited to 'spec/unit/application')
-rw-r--r-- | spec/unit/application/client_spec.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/unit/application/client_spec.rb b/spec/unit/application/client_spec.rb index 834c7777f0..f742d24e24 100644 --- a/spec/unit/application/client_spec.rb +++ b/spec/unit/application/client_spec.rb @@ -278,11 +278,11 @@ Enable chef-client interval runs by setting `:client_fork = true` in your config File.join(File.dirname(__FILE__), "../../data/client.d_00")) } it "loads the configuration in order" do - - expect(::File).to receive(:read).with(Pathname.new("#{client_d_dir}/00-foo.rb").cleanpath.to_s).and_return("") - expect(::File).to receive(:read).with(Pathname.new("#{client_d_dir}/01-bar.rb").cleanpath.to_s).and_return("") - expect(app).to receive(:load_config_d_file).with(Pathname.new("#{client_d_dir}/00-foo.rb").cleanpath.to_s).and_call_original.ordered - expect(app).to receive(:load_config_d_file).with(Pathname.new("#{client_d_dir}/01-bar.rb").cleanpath.to_s).and_call_original.ordered + expect(IO).to receive(:read).with(Pathname.new("#{client_d_dir}/00-foo.rb").cleanpath.to_s).and_return("foo 0") + expect(IO).to receive(:read).with(Pathname.new("#{client_d_dir}/01-bar.rb").cleanpath.to_s).and_return("bar 0") + allow(app).to receive(:apply_config).with(anything(), Chef::Config.platform_specific_path("/etc/chef/client.rb")).and_call_original.ordered + expect(app).to receive(:apply_config).with("foo 0", Pathname.new("#{client_d_dir}/00-foo.rb").cleanpath.to_s).and_call_original.ordered + expect(app).to receive(:apply_config).with("bar 0", Pathname.new("#{client_d_dir}/01-bar.rb").cleanpath.to_s).and_call_original.ordered app.reconfigure end end |