Class: Chef::Resource::Link

Inherits:
Chef::Resource show all
Defined in:
lib/chef/handler/resources/link.rb

Instance Method Summary collapse

Instance Method Details

#to_serverspecObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/chef/handler/resources/link.rb', line 4

def to_serverspec
  ERB.new(
    "\n  describe file('\#{target_file}') do\n<%- unless action.include? :delete -%>\n    it { should be_symlink }\n    it { should be_linked_to '\#{to}' }\n    it { should be_mode '\#{mode}' }\n    it { should be_owned_by '\#{owner}' }\n    it { should be_grouped_into '\#{group}' }\n<%- else -%>\nit { should_not be_symlink }\n<%- end -%>\n  end\n",
    safe_level = nil, trim_mode = '-').result(binding)
end