diff options
author | danielsdeleo <dan@getchef.com> | 2015-05-13 19:20:32 -0700 |
---|---|---|
committer | danielsdeleo <dan@getchef.com> | 2015-05-20 15:13:57 -0700 |
commit | 68d6b10124b96012594d0a4fbe099eda738111b3 (patch) | |
tree | 3530dc61c41fb3203de925bdbd7ca798cdd246c6 /spec/unit/mixin | |
parent | 1428270b0f2d0f2ae5d62ecb2aa512ffa7ac773e (diff) | |
download | chef-68d6b10124b96012594d0a4fbe099eda738111b3.tar.gz |
Stub `windows?` on ChefConfig so it applies to config
Diffstat (limited to 'spec/unit/mixin')
-rw-r--r-- | spec/unit/mixin/path_sanity_spec.rb | 4 | ||||
-rw-r--r-- | spec/unit/mixin/template_spec.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/spec/unit/mixin/path_sanity_spec.rb b/spec/unit/mixin/path_sanity_spec.rb index ec8e182e3d..3a924b9538 100644 --- a/spec/unit/mixin/path_sanity_spec.rb +++ b/spec/unit/mixin/path_sanity_spec.rb @@ -35,7 +35,7 @@ describe Chef::Mixin::PathSanity do @gem_bindir = '/some/gem/bin' allow(Gem).to receive(:bindir).and_return(@gem_bindir) allow(RbConfig::CONFIG).to receive(:[]).with('bindir').and_return(@ruby_bindir) - allow(Chef::Platform).to receive(:windows?).and_return(false) + allow(ChefConfig).to receive(:windows?).and_return(false) end it "adds all useful PATHs even if environment is an empty hash" do @@ -77,7 +77,7 @@ describe Chef::Mixin::PathSanity do gem_bindir = 'C:\gems\bin' allow(Gem).to receive(:bindir).and_return(gem_bindir) allow(RbConfig::CONFIG).to receive(:[]).with('bindir').and_return(ruby_bindir) - allow(Chef::Platform).to receive(:windows?).and_return(true) + allow(ChefConfig).to receive(:windows?).and_return(true) env = {"PATH" => 'C:\Windows\system32;C:\mr\softie'} @sanity.enforce_path_sanity(env) expect(env["PATH"]).to eq("C:\\Windows\\system32;C:\\mr\\softie;#{ruby_bindir};#{gem_bindir}") diff --git a/spec/unit/mixin/template_spec.rb b/spec/unit/mixin/template_spec.rb index f02bd34b8f..6a867b5f9a 100644 --- a/spec/unit/mixin/template_spec.rb +++ b/spec/unit/mixin/template_spec.rb @@ -39,7 +39,7 @@ describe Chef::Mixin::Template, "render_template" do describe "when running on windows" do before do - allow(Chef::Platform).to receive(:windows?).and_return(true) + allow(ChefConfig).to receive(:windows?).and_return(true) end it "should render the templates with windows line endings" do @@ -54,7 +54,7 @@ describe Chef::Mixin::Template, "render_template" do describe "when running on unix" do before do - allow(Chef::Platform).to receive(:windows?).and_return(false) + allow(ChefConfig).to receive(:windows?).and_return(false) end it "should render the templates with unix line endings" do |