puppetlabs-apache
puppetlabs-apache copied to clipboard
fix rewrite rules being ignored
In 7b22dae the default value for $rewrites was changed from undef to [] in manifests/vhost.pp. This results in templates_vhost/_rewrite.erb always evaluating to false (boolean check on an empty array variable is still true) unless $rewrites is explicitly set to undef. This results in the content of $rewrite_rule being ignored.
closes: #2318
@ekohl I agree, but since the logic is in a template we would need to check the final content in the file which I have no idea how to do with spec test. (anyone who nows please let me know !)
I would probably take this example: https://github.com/puppetlabs/puppetlabs-apache/blob/77255d652212466ae5dbc81b1381936794c50dbf/spec/defines/vhost_spec.rb#L1723-L1736 Then copy it and pass some parameters that triggers the behavior you want to test.
Note you can also test the whole file:
it {
is_expected.to contain_concat__fragment('rspec.example.com-rewrite').with_content <<~CONTENT
Here you can write the full content
And use multiple lines
CONTENT
}
@trefzer Hey sorry to bother you, just checking in on when you'll have time to finish with the sped test?
Good good good
Should be released by end of day