Skip to content

Commit

Permalink
Merge pull request voxpupuli#1129 from wyardley/fix_undef_index_files
Browse files Browse the repository at this point in the history
Remove Optional for index_files (voxpupuli#1128)
  • Loading branch information
wyardley authored Oct 3, 2017
2 parents df7ba0f + 7557f1d commit 1b0f593
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion manifests/resource/location.pp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
String $server = undef,
Optional[String] $www_root = undef,
Optional[String] $autoindex = undef,
Optional[Array] $index_files = [
Array $index_files = [
'index.html',
'index.htm',
'index.php'],
Expand Down
2 changes: 1 addition & 1 deletion manifests/resource/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
Optional[String] $uwsgi = undef,
Optional[String] $uwsgi_params = "${nginx::config::conf_dir}/uwsgi_params",
Optional[String] $uwsgi_read_timeout = undef,
Optional[Array] $index_files = [
Array $index_files = [
'index.html',
'index.htm',
'index.php'],
Expand Down
12 changes: 12 additions & 0 deletions spec/defines/resource_location_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,12 @@
attr: 'index_files',
value: %w[name1 name2],
match: ' index name1 name2;'
},
{
title: 'should not set index_file(s)',
attr: 'index_files',
value: [],
notmatch: %r{\s+index\s+}
}
].each do |param|
context "when #{param[:attr]} is #{param[:value]}" do
Expand Down Expand Up @@ -391,6 +397,12 @@
attr: 'index_files',
value: %w[name1 name2],
match: ' index name1 name2;'
},
{
title: 'should not set index_file(s)',
attr: 'index_files',
value: [],
notmatch: %r{\s+index\s+}
}
].each do |param|
context "when #{param[:attr]} is #{param[:value]}" do
Expand Down
8 changes: 4 additions & 4 deletions spec/defines/resource_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@
{
title: 'should not set index_file(s)',
attr: 'index_files',
value: :undef,
match: %r{^((?!index).)*$}
value: [],
notmatch: %r{\s+index\s+}
}
].each do |param|
context "when #{param[:attr]} is #{param[:value]}" do
Expand Down Expand Up @@ -757,8 +757,8 @@
{
title: 'should not set index_file(s)',
attr: 'index_files',
value: :undef,
match: %r{^((?!index).)*$}
value: [],
notmatch: %r{\s+index\s+}
}
].each do |param|
context "when #{param[:attr]} is #{param[:value]}" do
Expand Down

0 comments on commit 1b0f593

Please sign in to comment.