summaryrefslogtreecommitdiff
path: root/spec/unit/resource/service_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/resource/service_spec.rb')
-rw-r--r--spec/unit/resource/service_spec.rb36
1 files changed, 18 insertions, 18 deletions
diff --git a/spec/unit/resource/service_spec.rb b/spec/unit/resource/service_spec.rb
index c06eb9dd77..067fa7d0d3 100644
--- a/spec/unit/resource/service_spec.rb
+++ b/spec/unit/resource/service_spec.rb
@@ -7,9 +7,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.
@@ -23,7 +23,7 @@ describe Chef::Resource::Service do
before(:each) do
@resource = Chef::Resource::Service.new("chef")
- end
+ end
it "should create a new Chef::Resource::Service" do
@resource.should be_a_kind_of(Chef::Resource)
@@ -42,7 +42,7 @@ describe Chef::Resource::Service do
@resource.service_name "something"
@resource.service_name.should eql("something")
end
-
+
it "should accept a string for the service pattern" do
@resource.pattern ".*"
@resource.pattern.should eql(".*")
@@ -53,7 +53,7 @@ describe Chef::Resource::Service do
@resource.pattern /.*/
}.should raise_error(ArgumentError)
end
-
+
it "should accept a string for the service start command" do
@resource.start_command "/etc/init.d/chef start"
@resource.start_command.should eql("/etc/init.d/chef start")
@@ -64,7 +64,7 @@ describe Chef::Resource::Service do
@resource.start_command /.*/
}.should raise_error(ArgumentError)
end
-
+
it "should accept a string for the service stop command" do
@resource.stop_command "/etc/init.d/chef stop"
@resource.stop_command.should eql("/etc/init.d/chef stop")
@@ -75,23 +75,23 @@ describe Chef::Resource::Service do
@resource.stop_command /.*/
}.should raise_error(ArgumentError)
end
-
+
it "should accept a string for the service status command" do
@resource.status_command "/etc/init.d/chef status"
@resource.status_command.should eql("/etc/init.d/chef status")
end
-
+
it "should not accept a regexp for the service status command" do
lambda {
@resource.status_command /.*/
}.should raise_error(ArgumentError)
end
-
+
it "should accept a string for the service restart command" do
@resource.restart_command "/etc/init.d/chef restart"
@resource.restart_command.should eql("/etc/init.d/chef restart")
end
-
+
it "should not accept a regexp for the service restart command" do
lambda {
@resource.restart_command /.*/
@@ -102,13 +102,13 @@ describe Chef::Resource::Service do
@resource.reload_command "/etc/init.d/chef reload"
@resource.reload_command.should eql("/etc/init.d/chef reload")
end
-
+
it "should not accept a regexp for the service reload command" do
lambda {
@resource.reload_command /.*/
}.should raise_error(ArgumentError)
end
-
+
it "should accept a string for the service init command" do
@resource.init_command "/etc/init.d/chef"
@resource.init_command.should eql("/etc/init.d/chef")
@@ -122,15 +122,15 @@ describe Chef::Resource::Service do
%w{enabled running}.each do |attrib|
it "should accept true for #{attrib}" do
- @resource.send(attrib, true)
+ @resource.send(attrib, true)
@resource.send(attrib).should eql(true)
end
-
+
it "should accept false for #{attrib}" do
@resource.send(attrib, false)
@resource.send(attrib).should eql(false)
end
-
+
it "should not accept a string for #{attrib}" do
lambda { @resource.send(attrib, "poop") }.should raise_error(ArgumentError)
end
@@ -138,7 +138,7 @@ describe Chef::Resource::Service do
it "should default all the feature support to false" do
support_hash = { :status => false, :restart => false, :reload=> false }
@resource.supports.should == support_hash
- end
+ end
it "should allow you to set what features this resource supports as a array" do
support_array = [ :status, :restart ]
@@ -155,7 +155,7 @@ describe Chef::Resource::Service do
end
describe "when it has pattern and supports" do
- before do
+ before do
@resource.service_name("superfriend")
@resource.enabled(true)
@resource.running(false)
@@ -172,5 +172,5 @@ describe Chef::Resource::Service do
end
end
-
+
end