File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4848 host : 'redis1' ,
4949 password : 'hunter2' ,
5050 port : 867 ,
51- slowlog_max_len : ' 5309' ,
51+ slowlog_max_len : 5309 ,
5252 tags : %w{ foo bar } ,
5353 keys : %w{ baz bat } ,
5454 warn_on_missing_keys : false ,
6969 host : 'redis1' ,
7070 password : 'hunter2' ,
7171 ports : %w( 2379 2380 2381 ) ,
72- slowlog_max_len : ' 5309' ,
72+ slowlog_max_len : 5309 ,
7373 tags : %w{ foo bar } ,
7474 keys : %w{ baz bat } ,
7575 warn_on_missing_keys : false ,
8787 it { should contain_file ( conf_file ) . with_content ( %r{port: 2381} ) }
8888 end
8989
90+ context 'with strings instead of ints' do
91+ let ( :params ) { {
92+ host : 'redis1' ,
93+ password : 'hunter2' ,
94+ port : '867' ,
95+ slowlog_max_len : '5309' ,
96+ tags : %w{ foo bar } ,
97+ keys : %w{ baz bat } ,
98+ warn_on_missing_keys : false ,
99+ command_stats : true ,
100+ } }
101+ it { should contain_file ( conf_file ) . with_content ( %r{host: redis1} ) }
102+ it { should contain_file ( conf_file ) . with_content ( %r{^[^#]*password: hunter2} ) }
103+ it { should contain_file ( conf_file ) . with_content ( %r{port: 867} ) }
104+ it { should contain_file ( conf_file ) . with_content ( %r{^[^#]*slowlog-max-len: 5309} ) }
105+ it { should contain_file ( conf_file ) . with_content ( %r{tags:.*\s +- foo\s +- bar} ) }
106+ it { should contain_file ( conf_file ) . with_content ( %r{keys:.*\s +- baz\s +- bat} ) }
107+ it { should contain_file ( conf_file ) . with_content ( %r{warn_on_missing_keys: false} ) }
108+ it { should contain_file ( conf_file ) . with_content ( %r{command_stats: true} ) }
109+ end
110+
90111 context 'with instances set' do
91112 let ( :params ) { {
92113 instances : [
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ instances:
99<% if instance['password'] and ! instance['password'].empty? -%>
1010 password: <%= instance['password'] %>
1111<% end -%>
12- <% if instance['slowlog_max_len'] and ! instance['slowlog_max_len'].empty? -%>
12+ <% if instance['slowlog_max_len'] and ! instance['slowlog_max_len'].to_s .empty? -%>
1313 # unix_socket_path: /var/run/redis/redis.sock # optional, can be used in lieu of host/port
1414 slowlog-max-len: <%= instance['slowlog_max_len'] %>
1515<% end -%>
You can’t perform that action at this time.
0 commit comments