Class: Chef::Resource::Template

Inherits:
File show all
Defined in:
lib/chef/handler/resources/template.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
# File 'lib/chef/handler/resources/template.rb', line 4

def to_serverspec
  "\n  describe file('\#{path}') do\n    it { should be_file }\n    it { should be_mode '\#{mode}' }\n    it { should be_owned_by '\#{owner}' }\n    it { should be_grouped_into '\#{group}' }\n    its(:content) do\nshould match <<-EOF\n\#{::File.read(path) if ::File.exist?(path)}\nEOF\n    end\n  end\n"
end