diff options
Diffstat (limited to 'spec/unit/resource/service_spec.rb')
-rw-r--r-- | spec/unit/resource/service_spec.rb | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/spec/unit/resource/service_spec.rb b/spec/unit/resource/service_spec.rb index 205282b99f..67a4635983 100644 --- a/spec/unit/resource/service_spec.rb +++ b/spec/unit/resource/service_spec.rb @@ -124,6 +124,27 @@ describe Chef::Resource::Service do end.to raise_error(ArgumentError) end + it "should accept an array for options" do + @resource.options ["-r", "-s"] + expect(@resource.options).to eql(["-r", "-s"]) + end + + it "should accept a string for options" do + @resource.options "-r" + expect(@resource.options).to eql(["-r"]) + end + + it "should accept a string with multiple flags for options" do + @resource.options "-r -s" + expect(@resource.options).to eql(["-r", "-s"]) + end + + it "should not accept a boolean for options" do + expect do + @resource.options true + end.to raise_error(ArgumentError) + end + %w{enabled running}.each do |attrib| it "should accept true for #{attrib}" do @resource.send(attrib, true) @@ -175,5 +196,4 @@ describe Chef::Resource::Service do expect(@resource.identity).to eq("superfriend") end end - end |