diff options
-rw-r--r-- | lib/chef/resource/systemd_unit.rb | 4 | ||||
-rw-r--r-- | spec/unit/resource/systemd_unit_spec.rb | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/chef/resource/systemd_unit.rb b/lib/chef/resource/systemd_unit.rb index 02194927ba..a4c3c3f180 100644 --- a/lib/chef/resource/systemd_unit.rb +++ b/lib/chef/resource/systemd_unit.rb @@ -61,7 +61,9 @@ class Chef content.each_pair do |sect, opts| doc.section(sect) do |section| opts.each_pair do |opt, val| - section.option(opt, val) + [val].flatten.each do |v| + section.option(opt, v) + end end end end diff --git a/spec/unit/resource/systemd_unit_spec.rb b/spec/unit/resource/systemd_unit_spec.rb index fa30255885..f05418eb34 100644 --- a/spec/unit/resource/systemd_unit_spec.rb +++ b/spec/unit/resource/systemd_unit_spec.rb @@ -20,11 +20,12 @@ require "spec_helper" describe Chef::Resource::SystemdUnit do let(:resource) { Chef::Resource::SystemdUnit.new("sysstat-collect.timer") } - let(:unit_content_string) { "[Unit]\nDescription = Run system activity accounting tool every 10 minutes\n\n[Timer]\nOnCalendar = *:00/10\n\n[Install]\nWantedBy = sysstat.service\n" } + let(:unit_content_string) { "[Unit]\nDescription = Run system activity accounting tool every 10 minutes\nDocumentation = foo\nDocumentation = bar\n\n[Timer]\nOnCalendar = *:00/10\n\n[Install]\nWantedBy = sysstat.service\n" } let(:unit_content_hash) do { "Unit" => { "Description" => "Run system activity accounting tool every 10 minutes", + "Documentation" => %w{foo bar}, }, "Timer" => { "OnCalendar" => "*:00/10", |