diff options
Diffstat (limited to 'spec/unit/mixin/path_sanity_spec.rb')
-rw-r--r-- | spec/unit/mixin/path_sanity_spec.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/unit/mixin/path_sanity_spec.rb b/spec/unit/mixin/path_sanity_spec.rb index bea2e78ecd..64c667b483 100644 --- a/spec/unit/mixin/path_sanity_spec.rb +++ b/spec/unit/mixin/path_sanity_spec.rb @@ -33,9 +33,9 @@ describe Chef::Mixin::PathSanity do Chef::Config[:enforce_path_sanity] = true @ruby_bindir = '/some/ruby/bin' @gem_bindir = '/some/gem/bin' - Gem.stub!(:bindir).and_return(@gem_bindir) - RbConfig::CONFIG.stub!(:[]).with('bindir').and_return(@ruby_bindir) - Chef::Platform.stub!(:windows?).and_return(false) + Gem.stub(:bindir).and_return(@gem_bindir) + RbConfig::CONFIG.stub(:[]).with('bindir').and_return(@ruby_bindir) + Chef::Platform.stub(:windows?).and_return(false) end it "adds all useful PATHs even if environment is an empty hash" do @@ -65,8 +65,8 @@ describe Chef::Mixin::PathSanity do it "does not create entries for Ruby/Gem bindirs if they exist in SANE_PATH or PATH" do ruby_bindir = '/usr/bin' gem_bindir = '/yo/gabba/gabba' - Gem.stub!(:bindir).and_return(gem_bindir) - RbConfig::CONFIG.stub!(:[]).with('bindir').and_return(ruby_bindir) + Gem.stub(:bindir).and_return(gem_bindir) + RbConfig::CONFIG.stub(:[]).with('bindir').and_return(ruby_bindir) env = {"PATH" => gem_bindir} @sanity.enforce_path_sanity(env) env["PATH"].should == "/yo/gabba/gabba:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" @@ -75,9 +75,9 @@ describe Chef::Mixin::PathSanity do it "builds a valid windows path" do ruby_bindir = 'C:\ruby\bin' gem_bindir = 'C:\gems\bin' - Gem.stub!(:bindir).and_return(gem_bindir) - RbConfig::CONFIG.stub!(:[]).with('bindir').and_return(ruby_bindir) - Chef::Platform.stub!(:windows?).and_return(true) + Gem.stub(:bindir).and_return(gem_bindir) + RbConfig::CONFIG.stub(:[]).with('bindir').and_return(ruby_bindir) + Chef::Platform.stub(:windows?).and_return(true) env = {"PATH" => 'C:\Windows\system32;C:\mr\softie'} @sanity.enforce_path_sanity(env) env["PATH"].should == "C:\\Windows\\system32;C:\\mr\\softie;#{ruby_bindir};#{gem_bindir}" |