diff options
author | Brice Figureau <brice-puppet@daysofwonder.com> | 2009-07-25 12:55:20 +0200 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-07-29 07:48:54 +1000 |
commit | da828a4234754e9122034706ca65f6b6f7d5c2ab (patch) | |
tree | c488956b45617d0284c1c50bfe52d95f39d1ef63 /spec/unit/provider/service | |
parent | 389843629c5ec2950f44b0fdaacb1d7470bc4aec (diff) | |
download | puppet-da828a4234754e9122034706ca65f6b6f7d5c2ab.tar.gz puppet-da828a4234754e9122034706ca65f6b6f7d5c2ab.tar.xz puppet-da828a4234754e9122034706ca65f6b6f7d5c2ab.zip |
Fix #2448 - fix the broken runit provider and tests
The runit provider was broken when the daemontools provider
was enhanced.This patch aims to fix this.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Diffstat (limited to 'spec/unit/provider/service')
-rw-r--r-- | spec/unit/provider/service/runit.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/unit/provider/service/runit.rb b/spec/unit/provider/service/runit.rb index b0c5dd896..4a7a238a9 100644 --- a/spec/unit/provider/service/runit.rb +++ b/spec/unit/provider/service/runit.rb @@ -30,6 +30,8 @@ describe provider_class do @resource.stubs(:[]).with(:path).returns @daemondir @resource.stubs(:ref).returns "Service[myservice]" + @provider.stubs(:sv) + @provider.stubs(:resource).returns @resource end @@ -58,8 +60,18 @@ describe provider_class do end describe "when starting" do - it "should call enable" do + it "should enable the service if it is not enabled" do + @provider.stubs(:sv) + @provider.stubs(:ucommand) + + @provider.expects(:enabled?).returns false @provider.expects(:enable) + + @provider.start + end + + it "should execute external command 'sv start /etc/service/myservice'" do + @provider.expects(:ucommand).with(:start).returns("") @provider.start end end |