summaryrefslogtreecommitdiff
path: root/spec/unit/mixin
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/mixin')
-rw-r--r--spec/unit/mixin/checksum_spec.rb2
-rw-r--r--spec/unit/mixin/command_spec.rb2
-rw-r--r--spec/unit/mixin/enforce_ownership_and_permissions_spec.rb8
-rw-r--r--spec/unit/mixin/path_sanity_spec.rb16
-rw-r--r--spec/unit/mixin/shell_out_spec.rb2
-rw-r--r--spec/unit/mixin/template_spec.rb4
6 files changed, 17 insertions, 17 deletions
diff --git a/spec/unit/mixin/checksum_spec.rb b/spec/unit/mixin/checksum_spec.rb
index c0f0acdeb4..b701dd6a50 100644
--- a/spec/unit/mixin/checksum_spec.rb
+++ b/spec/unit/mixin/checksum_spec.rb
@@ -30,7 +30,7 @@ describe Chef::Mixin::Checksum do
@cache = Chef::Digester.instance
@file = CHEF_SPEC_DATA + "/checksum/random.txt"
@stat = mock("File::Stat", { :mtime => Time.at(0) })
- File.stub!(:stat).and_return(@stat)
+ File.stub(:stat).and_return(@stat)
end
it "gets the checksum of a file" do
diff --git a/spec/unit/mixin/command_spec.rb b/spec/unit/mixin/command_spec.rb
index a2a2fef461..96660be436 100644
--- a/spec/unit/mixin/command_spec.rb
+++ b/spec/unit/mixin/command_spec.rb
@@ -76,7 +76,7 @@ describe Chef::Mixin::Command, :volatile do
include Chef::Mixin::Command
it "logs the command's stderr and stdout output if the command failed" do
- Chef::Log.stub!(:level).and_return(:debug)
+ Chef::Log.stub(:level).and_return(:debug)
begin
run_command(:command => "sh -c 'echo hello; echo world >&2; false'")
violated "Exception expected, but nothing raised."
diff --git a/spec/unit/mixin/enforce_ownership_and_permissions_spec.rb b/spec/unit/mixin/enforce_ownership_and_permissions_spec.rb
index cffb1b941d..fe72d53de5 100644
--- a/spec/unit/mixin/enforce_ownership_and_permissions_spec.rb
+++ b/spec/unit/mixin/enforce_ownership_and_permissions_spec.rb
@@ -56,8 +56,8 @@ describe Chef::Mixin::EnforceOwnershipAndPermissions do
Struct::Passwd.new("root", "x", 0, 0, "root", "/root", "/bin/bash")
end
group_struct = OpenStruct.new(:name => "root", :passwd => "x", :gid => 0)
- Etc.stub!(:getpwuid).and_return(passwd_struct)
- Etc.stub!(:getgrgid).and_return(group_struct)
+ Etc.stub(:getpwuid).and_return(passwd_struct)
+ Etc.stub(:getgrgid).and_return(group_struct)
end
it "does not set updated_by_last_action on the new resource" do
@@ -80,8 +80,8 @@ describe Chef::Mixin::EnforceOwnershipAndPermissions do
Struct::Passwd.new("root", "x", 0, 0, "root", "/root", "/bin/bash")
end
group_struct = OpenStruct.new(:name => "root", :passwd => "x", :gid => 0)
- Etc.stub!(:getpwuid).and_return(passwd_struct)
- Etc.stub!(:getgrgid).and_return(group_struct)
+ Etc.stub(:getpwuid).and_return(passwd_struct)
+ Etc.stub(:getgrgid).and_return(group_struct)
end
it "sets updated_by_last_action on the new resource" do
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}"
diff --git a/spec/unit/mixin/shell_out_spec.rb b/spec/unit/mixin/shell_out_spec.rb
index c7ca56fe84..f325f687d9 100644
--- a/spec/unit/mixin/shell_out_spec.rb
+++ b/spec/unit/mixin/shell_out_spec.rb
@@ -32,7 +32,7 @@ describe Chef::Mixin::ShellOut do
let(:output) { StringIO.new }
let!(:capture_log_output) { Chef::Log.logger = Logger.new(output) }
- let(:assume_deprecation_log_level) { Chef::Log.stub!(:level).and_return(:warn) }
+ let(:assume_deprecation_log_level) { Chef::Log.stub(:level).and_return(:warn) }
context 'without options' do
let(:command_args) { [ cmd ] }
diff --git a/spec/unit/mixin/template_spec.rb b/spec/unit/mixin/template_spec.rb
index ca2c3c7318..3aa0b9ba22 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
- Chef::Platform.stub!(:windows?).and_return(true)
+ Chef::Platform.stub(: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
- Chef::Platform.stub!(:windows?).and_return(false)
+ Chef::Platform.stub(:windows?).and_return(false)
end
it "should render the templates with unix line endings" do