Skip to content

Commit e79b31c

Browse files
committed
[Adding resolver array to streamhost template along with relevant tests]-[SMK]
[Correcting typo]-[SMK] [Removing redundant casting as requested]-[SMK] Co-authored-by: Alexander Fisher <[email protected]> [Removing additional casting]-[SMK] [Adding tests for resolvers]-[SMK] [Correcting typo in the Template testing array is empty and changing IPs to RFC5735]-[SMK]
1 parent 361e539 commit e79b31c

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

spec/defines/resource_stream_spec.rb

+6
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@
101101
value: 'spdy',
102102
match: %r{\s+listen\s+\[::\]:80 spdy;}
103103
},
104+
{
105+
title: 'should set resolver(s)',
106+
attr: 'resolver',
107+
value: ['203.0.113.1', '203.0.113.2'],
108+
match: %r{\s+resolver\s+203.0.113.1 203.0.113.2;}
109+
},
104110
{
105111
title: 'should contain raw_prepend directives',
106112
attr: 'raw_prepend',

templates/streamhost/streamhost.erb

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ server {
1818
listen [<%= @ipv6_listen_ip %>]:<%= @ipv6_listen_port %> <% if @ipv6_listen_options %><%= @ipv6_listen_options %><% end %>;
1919
<%- end -%>
2020
<%- end -%>
21+
<%- unless @resolver.empty? -%>
22+
resolver <% @resolver.each do |res| %> <%= res %><% end %>;
23+
<%- end -%>
2124

2225
<% Array(@raw_prepend).each do |line| -%>
2326
<%= line %>

0 commit comments

Comments
 (0)