summaryrefslogtreecommitdiff
path: root/spec/unit/provider
diff options
context:
space:
mode:
authorBryan McLellan <btm@opscode.com>2013-10-04 10:25:15 -0700
committerBryan McLellan <btm@opscode.com>2013-10-10 11:29:23 -0700
commit548394ea1f5f0937b69663d6a9301b01bc08f728 (patch)
treee74df707820bd233b60d3cb759f6cadad4ea53ec /spec/unit/provider
parent1137bf8acdd4bfe4caab7648ea7b079638b77ea9 (diff)
downloadchef-548394ea1f5f0937b69663d6a9301b01bc08f728.tar.gz
CHEF-1559: Modify test syntax for Ruby 1.8 compat
Diffstat (limited to 'spec/unit/provider')
-rw-r--r--spec/unit/provider/service/debian_service_spec.rb32
1 files changed, 9 insertions, 23 deletions
diff --git a/spec/unit/provider/service/debian_service_spec.rb b/spec/unit/provider/service/debian_service_spec.rb
index 1168875b28..ff0f4f421b 100644
--- a/spec/unit/provider/service/debian_service_spec.rb
+++ b/spec/unit/provider/service/debian_service_spec.rb
@@ -36,9 +36,7 @@ describe Chef::Provider::Service::Debian do
describe "load_current_resource" do
it "ensures /usr/sbin/update-rc.d is available" do
- File.should_receive(:exists?)
- .with("/usr/sbin/update-rc.d")
- .and_return(false)
+ File.should_receive(:exists?).with("/usr/sbin/update-rc.d") .and_return(false)
@provider.define_resource_requirements
lambda {
@@ -65,14 +63,11 @@ describe Chef::Provider::Service::Debian do
@stderr = StringIO.new
@status = mock("Status", :exitstatus => 0, :stdout => @stdout)
@provider.stub!(:shell_out!).and_return(@status)
- @provider.stub!(:popen4)
- .and_yield(@pid, @stdin, @stdout, @stderr)
- .and_return(@status)
+ @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
end
it "says the service is enabled" do
- @provider.service_currently_enabled?(@provider.get_priority)
- .should be_true
+ @provider.service_currently_enabled?(@provider.get_priority).should be_true
end
it "stores the 'enabled' state" do
@@ -91,14 +86,11 @@ describe Chef::Provider::Service::Debian do
@stderr = StringIO.new
@status = mock("Status", :exitstatus => 0, :stdout => @stdout)
@provider.stub!(:shell_out!).and_return(@status)
- @provider.stub!(:popen4)
- .and_yield(@pid, @stdin, @stdout, @stderr)
- .and_return(@status)
+ @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
end
it "says the service is disabled" do
- @provider.service_currently_enabled?(@provider.get_priority)
- .should be_false
+ @provider.service_currently_enabled?(@provider.get_priority).should be_false
end
it "stores the 'disabled' state" do
@@ -171,14 +163,11 @@ insserv: remove service /etc/init.d/../rc0.d/K20chef-client
@stderr = StringIO.new(streams["linked"]["stderr"])
@status = mock("Status", :exitstatus => 0, :stdout => @stdout)
@provider.stub!(:shell_out!).and_return(@status)
- @provider.stub!(:popen4)
- .and_yield(@pid, @stdin, @stdout, @stderr)
- .and_return(@status)
+ @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
end
it "says the service is enabled" do
- @provider.service_currently_enabled?(@provider.get_priority)
- .should be_true
+ @provider.service_currently_enabled?(@provider.get_priority).should be_true
end
it "stores the 'enabled' state" do
@@ -207,14 +196,11 @@ insserv: remove service /etc/init.d/../rc0.d/K20chef-client
@stderr = StringIO.new(streams["not linked"]["stderr"])
@status = mock("Status", :exitstatus => 0, :stdout => @stdout)
@provider.stub!(:shell_out!).and_return(@status)
- @provider.stub!(:popen4)
- .and_yield(@pid, @stdin, @stdout, @stderr)
- .and_return(@status)
+ @provider.stub!(:popen4).and_yield(@pid, @stdin, @stdout, @stderr).and_return(@status)
end
it "says the service is disabled" do
- @provider.service_currently_enabled?(@provider.get_priority)
- .should be_false
+ @provider.service_currently_enabled?(@provider.get_priority).should be_false
end
it "stores the 'disabled' state" do