Adds rspec tests for nginx_cfg_prepend

This commit is contained in:
Prachetas Prabhu 2015-03-04 23:55:30 +00:00
parent ce407aa06d
commit 409f8ef4e3

View file

@ -164,6 +164,35 @@ describe 'nginx::config' do
' test1 test value 2;',
],
},
{
:title => 'should contain ordered appended directives from hash',
:attr => 'nginx_cfg_prepend',
:value => { 'test1' => 'test value 1', 'test2' => 'test value 2', 'allow' => 'test value 3' },
:match => [
'allow test value 3;',
'test1 test value 1;',
'test2 test value 2;',
],
},
{
:title => 'should contain duplicate appended directives from list of hashes',
:attr => 'nginx_cfg_prepend',
:value => [[ 'allow', 'test value 1'], ['allow', 'test value 2' ]],
:match => [
'allow test value 1;',
'allow test value 2;',
],
},
{
:title => 'should contain duplicate appended directives from array values',
:attr => 'nginx_cfg_prepend',
:value => { 'test1' => ['test value 1', 'test value 2', 'test value 3'] },
:match => [
'test1 test value 1;',
'test1 test value 2;',
'test1 test value 3;',
],
},
{
:title => 'should set pid',
:attr => 'pid',