summaryrefslogtreecommitdiff
path: root/spec/unit/provider/package/dpkg_spec.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-01-29 14:17:47 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2014-01-29 14:17:47 -0800
commitb19b7d000887209f9d8dc1dc6aa468a0497a7391 (patch)
tree68d1eb6c136df20c2800f1dddb4e2c1ed5d75a42 /spec/unit/provider/package/dpkg_spec.rb
parentb5c9c6afdfd83fe3f1bf4c991daffeff94b49750 (diff)
downloadchef-b19b7d000887209f9d8dc1dc6aa468a0497a7391.tar.gz
s/stub!/stub/g
fix deprecation warnings
Diffstat (limited to 'spec/unit/provider/package/dpkg_spec.rb')
-rw-r--r--spec/unit/provider/package/dpkg_spec.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/unit/provider/package/dpkg_spec.rb b/spec/unit/provider/package/dpkg_spec.rb
index 30021e31f3..03786ff00b 100644
--- a/spec/unit/provider/package/dpkg_spec.rb
+++ b/spec/unit/provider/package/dpkg_spec.rb
@@ -33,9 +33,9 @@ describe Chef::Provider::Package::Dpkg do
@status = mock("Status", :exitstatus => 0)
@stderr = StringIO.new
@pid = mock("PID")
- @provider.stub!(:popen4).and_return(@status)
+ @provider.stub(:popen4).and_return(@status)
- ::File.stub!(:exists?).and_return(true)
+ ::File.stub(:exists?).and_return(true)
end
describe "when loading the current resource state" do
@@ -48,14 +48,14 @@ describe Chef::Provider::Package::Dpkg do
it "should raise an exception if a source is supplied but not found" do
@provider.load_current_resource
@provider.define_resource_requirements
- ::File.stub!(:exists?).and_return(false)
+ ::File.stub(:exists?).and_return(false)
lambda { @provider.run_action(:install) }.should raise_error(Chef::Exceptions::Package)
end
describe 'gets the source package version from dpkg-deb' do
def check_version(version)
@stdout = StringIO.new("wget\t#{version}")
- @provider.stub!(:popen4).with("dpkg-deb -W #{@new_resource.source}").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ @provider.stub(:popen4).with("dpkg-deb -W #{@new_resource.source}").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
@provider.load_current_resource
@provider.current_resource.package_name.should == "wget"
@new_resource.version.should == version
@@ -76,7 +76,7 @@ describe Chef::Provider::Package::Dpkg do
it "gets the source package name from dpkg-deb correctly when the package name has `-', `+' or `.' characters" do
@stdout = StringIO.new("f.o.o-pkg++2\t1.11.4-1ubuntu1")
- @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ @provider.stub(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
@provider.load_current_resource
@provider.current_resource.package_name.should == "f.o.o-pkg++2"
end
@@ -103,7 +103,7 @@ Config-Version: 1.11.4-1ubuntu1
Depends: libc6 (>= 2.8~20080505), libssl0.9.8 (>= 0.9.8f-5)
Conflicts: wget-ssl
DPKG_S
- @provider.stub!(:popen4).with("dpkg -s wget").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
+ @provider.stub(:popen4).with("dpkg -s wget").and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
@provider.load_current_resource
@provider.current_resource.version.should == "1.11.4-1ubuntu1"
@@ -111,7 +111,7 @@ DPKG_S
it "should raise an exception if dpkg fails to run" do
@status = mock("Status", :exitstatus => -1)
- @provider.stub!(:popen4).and_return(@status)
+ @provider.stub(:popen4).and_return(@status)
lambda { @provider.load_current_resource }.should raise_error(Chef::Exceptions::Package)
end
end
@@ -158,7 +158,7 @@ DPKG_S
"DEBIAN_FRONTEND" => "noninteractive"
}
})
- @new_resource.stub!(:options).and_return("--force-yes")
+ @new_resource.stub(:options).and_return("--force-yes")
@provider.install_package("wget", "1.11.4-1ubuntu1")
end
@@ -186,7 +186,7 @@ DPKG_S
"DEBIAN_FRONTEND" => "noninteractive"
}
})
- @new_resource.stub!(:options).and_return("--force-yes")
+ @new_resource.stub(:options).and_return("--force-yes")
@provider.remove_package("wget", "1.11.4-1ubuntu1")
end
@@ -208,7 +208,7 @@ DPKG_S
"DEBIAN_FRONTEND" => "noninteractive"
}
})
- @new_resource.stub!(:options).and_return("--force-yes")
+ @new_resource.stub(:options).and_return("--force-yes")
@provider.purge_package("wget", "1.11.4-1ubuntu1")
end