summaryrefslogtreecommitdiff
path: root/spec/unit
diff options
context:
space:
mode:
authorMike Dodge <mikedodge04@fb.com>2016-02-12 16:21:56 +0000
committerMike Dodge <mikedodge04@fb.com>2016-02-15 12:48:30 -0800
commitc2eea28dd0708c0aed8270d0f5c57be7f9cc4707 (patch)
tree7d5bda1a3082abcc46d51f704d711693b65ca5f9 /spec/unit
parent2b3298482ab4f251640cdce4ea82e3c5de8f2d4c (diff)
downloadchef-c2eea28dd0708c0aed8270d0f5c57be7f9cc4707.tar.gz
fixed provider spec
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/provider/launchd_spec.rb19
1 files changed, 11 insertions, 8 deletions
diff --git a/spec/unit/provider/launchd_spec.rb b/spec/unit/provider/launchd_spec.rb
index 150ac4bdf1..72a484233a 100644
--- a/spec/unit/provider/launchd_spec.rb
+++ b/spec/unit/provider/launchd_spec.rb
@@ -70,11 +70,6 @@ XML
expect(new_resource.label).to eql(label)
end
- it 'path should be /Library/LaunchDaemons/call.mom.weekly.plist' do
- expect(new_resource.path).
- to eq('/Library/LaunchDaemons/call.mom.weekly.plist')
- end
-
def run_resource_setup_for_action(action)
new_resource.action(action)
provider.action = action
@@ -87,10 +82,16 @@ XML
describe 'agent' do
it 'path should be /Library/LaunchAgents/call.mom.weekly.plist' do
new_resource.type 'agent'
- expect(new_resource.path).
+ expect(provider.gen_path_from_type).
to eq('/Library/LaunchAgents/call.mom.weekly.plist')
end
end
+ describe 'daemon' do
+ it 'path should be /Library/LaunchDaemons/call.mom.weekly.plist' do
+ expect(provider.gen_path_from_type).
+ to eq('/Library/LaunchDaemons/call.mom.weekly.plist')
+ end
+ end
end
describe 'with a :create action and' do
@@ -99,14 +100,16 @@ XML
new_resource.program '/Library/scripts/call_mom.sh'
new_resource.time_out 300
new_resource.start_calendar_interval 'Hourly' => 10, 'Weekday' => 7
- expect(provider.content?).to eql(test_plist)
+ expect(provider.content?).to be_truthy
+ expect(provider.content).to eql(test_plist)
end
end
describe 'hash is passed' do
it 'should produce the test_plist from the hash' do
new_resource.hash test_hash
- expect(provider.content?).to eql(test_plist)
+ expect(provider.content?).to be_truthy
+ expect(provider.content).to eql(test_plist)
end
end
end