summaryrefslogtreecommitdiff
path: root/spec/unit/resource/launchd_spec.rb
blob: 95febc47cf7d41c2f5a41b669b35cc88020d5203 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#

require "spec_helper"

describe Chef::Resource::Launchd do
  @launchd = Chef::Resource::Launchd.new("io.chef.chef-client")
  let(:resource) { Chef::Resource::Launchd.new(
    "io.chef.chef-client",
    run_context
  )}

  it "should create a new Chef::Resource::Launchd" do
    expect(resource).to be_a_kind_of(Chef::Resource)
    expect(resource).to be_a_kind_of(Chef::Resource::Launchd)
  end

  it "should have a resource name of Launchd" do
    expect(resource.resource_name).to eql(:launchd)
  end

  it "should have a default action of create" do
    expect(resource.action).to eql([:create])
  end

  it "should accept enable, disable, create, and delete as actions" do
    expect { resource.action :enable }.not_to raise_error
    expect { resource.action :disable }.not_to raise_error
    expect { resource.action :create }.not_to raise_error
    expect { resource.action :delete }.not_to raise_error
  end
end