Skip to content

Commit

Permalink
Merge pull request voxpupuli#85 from cirrax/dev_cix-btr
Browse files Browse the repository at this point in the history
fix template to display of component options
  • Loading branch information
ghoneycutt authored Sep 23, 2021
2 parents 31a76f2 + 6cfc7a0 commit c1f3b2f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions spec/defines/virtualhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,18 @@
}
end

context 'with deeply nested component options' do
let(:params) { { components: { 'comp1' => { 'type' => 'muc', 'options' => { 'bo' => true, 'arr' => %w[one two], 'str' => 'string' } } } } }

it {
is_expected.to contain_file(path_avail). \
with_content(%r{^Component "comp1" "muc"$}). \
with_content(%r{^ bo = true;$}). \
with_content(%r{^ arr = { "one"; "two" };$}).\
with_content(%r{^ str = "string";$})
}
end

context 'with disco items' do
let(:params) { { disco_items: %w[foo bar] } }

Expand Down
2 changes: 1 addition & 1 deletion templates/virtualhost.cfg.erb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Component "<%= name %>" <% if component.include?('type') then %>"<%= component['
<%- end -%>
<%- if component.include?('options') -%>
<%- component['options'].sort.each do |k, v| -%>
<%= k %> = <%= v %>;
<%= k %> = <%= print_recursive(v) %>;
<%- end -%>
<%- end -%>
<% end -%>
Expand Down

0 comments on commit c1f3b2f

Please sign in to comment.