summaryrefslogtreecommitdiff
path: root/spec/unit/provider/service/init_service_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/provider/service/init_service_spec.rb')
-rw-r--r--spec/unit/provider/service/init_service_spec.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/unit/provider/service/init_service_spec.rb b/spec/unit/provider/service/init_service_spec.rb
index 4131ee61a8..c7d47e6281 100644
--- a/spec/unit/provider/service/init_service_spec.rb
+++ b/spec/unit/provider/service/init_service_spec.rb
@@ -6,9 +6,9 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
-#
+#
# http://www.apache.org/licenses/LICENSE-2.0
-#
+#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -40,7 +40,7 @@ PS
@status = mock("Status", :exitstatus => 0, :stdout => @stdout)
@provider.stub!(:shell_out!).and_return(@status)
end
-
+
it "should create a current resource with the name of the new resource" do
@provider.load_current_resource
@provider.current_resource.should equal(@current_resource)
@@ -60,7 +60,7 @@ PS
@provider.should_receive(:shell_out).with("/etc/init.d/#{@current_resource.service_name} status").and_return(@status)
@provider.load_current_resource
end
-
+
it "should set running to true if the status command returns 0" do
@provider.stub!(:shell_out).with("/etc/init.d/#{@current_resource.service_name} status").and_return(@status)
@provider.load_current_resource
@@ -90,9 +90,9 @@ PS
@provider.should_receive(:shell_out).with("/etc/init.d/chefhasmonkeypants status").and_return(@status)
@provider.load_current_resource
end
-
+
end
-
+
describe "when an init command has been specified" do
before do
@new_resource.stub!(:init_command).and_return("/opt/chef-server/service/erchef")
@@ -107,7 +107,7 @@ PS
end
describe "when the node has not specified a ps command" do
-
+
it "should raise an error if the node has a nil ps attribute" do
@node.automatic_attrs[:command] = {:ps => nil}
@provider.load_current_resource
@@ -123,7 +123,7 @@ PS
@provider.define_resource_requirements
lambda { @provider.process_resource_requirements }.should raise_error(Chef::Exceptions::Service)
end
-
+
end
@@ -139,7 +139,7 @@ aj 7842 5057 0 21:26 pts/2 00:00:06 chef
aj 7842 5057 0 21:26 pts/2 00:00:06 poos
RUNNING_PS
@status.stub!(:stdout).and_return(@stdout)
- @provider.load_current_resource
+ @provider.load_current_resource
@current_resource.running.should be_true
end
@@ -172,7 +172,7 @@ RUNNING_PS
it "should call '/etc/init.d/service_name start' if no start command is specified" do
@provider.should_receive(:shell_out!).with("/etc/init.d/#{@new_resource.service_name} start")
@provider.start_service()
- end
+ end
end
describe Chef::Provider::Service::Init, "stop_service" do