Skip to content

Commit a393b10

Browse files
committed
drop legacy tests for init.pp
1 parent eeaf285 commit a393b10

File tree

1 file changed

+10
-34
lines changed

1 file changed

+10
-34
lines changed

spec/classes/nginx_spec.rb

+10-34
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@
395395
{
396396
title: 'should set worker_processes',
397397
attr: 'worker_processes',
398-
value: '4',
398+
value: 4,
399399
match: 'worker_processes 4;'
400400
},
401401
{
@@ -407,7 +407,7 @@
407407
{
408408
title: 'should set worker_rlimit_nofile',
409409
attr: 'worker_rlimit_nofile',
410-
value: '10000',
410+
value: 10000,
411411
match: 'worker_rlimit_nofile 10000;'
412412
},
413413
{
@@ -464,7 +464,7 @@
464464
{
465465
title: 'should set worker_connections',
466466
attr: 'worker_connections',
467-
value: '100',
467+
value: 100,
468468
match: ' worker_connections 100;'
469469
},
470470
{
@@ -503,12 +503,6 @@
503503
value: 'eventport',
504504
match: %r{\s*use\s+eventport;}
505505
},
506-
{
507-
title: 'should not set events_use',
508-
attr: 'events_use',
509-
value: false,
510-
notmatch: %r{use }
511-
},
512506
{
513507
title: 'should set access_log',
514508
attr: 'http_access_log',
@@ -686,36 +680,18 @@
686680
value: '/path/to/proxy.cache',
687681
match: %r{\s+proxy_cache_path\s+/path/to/proxy.cache levels=1 keys_zone=d2:100m max_size=500m inactive=20m;}
688682
},
689-
{
690-
title: 'should not set proxy_cache_path',
691-
attr: 'proxy_cache_path',
692-
value: false,
693-
notmatch: %r{proxy_cache_path}
694-
},
695683
{
696684
title: 'should set fastcgi_cache_path',
697685
attr: 'fastcgi_cache_path',
698686
value: '/path/to/proxy.cache',
699687
match: %r{\s*fastcgi_cache_path\s+/path/to/proxy.cache levels=1 keys_zone=d3:100m max_size=500m inactive=20m;}
700688
},
701-
{
702-
title: 'should not set fastcgi_cache_path',
703-
attr: 'fastcgi_cache_path',
704-
value: false,
705-
notmatch: %r{fastcgi_cache_path}
706-
},
707689
{
708690
title: 'should set fastcgi_cache_use_stale',
709691
attr: 'fastcgi_cache_use_stale',
710692
value: 'invalid_header',
711693
match: ' fastcgi_cache_use_stale invalid_header;'
712694
},
713-
{
714-
title: 'should not set fastcgi_cache_use_stale',
715-
attr: 'fastcgi_cache_use_stale',
716-
value: false,
717-
notmatch: %r{fastcgi_cache_use_stale}
718-
},
719695
{
720696
title: 'should contain ordered appended directives from hash',
721697
attr: 'http_cfg_prepend',
@@ -906,7 +882,13 @@
906882
end
907883

908884
context 'when proxy_cache_path is /path/to/proxy.cache and loader_files is 1000' do
909-
let(:params) { { conf_dir: '/path/to/nginx', proxy_cache_path: '/path/to/proxy.cache', proxy_cache_loader_files: '1000' } }
885+
let(:params) do
886+
{
887+
conf_dir: '/path/to/nginx',
888+
proxy_cache_path: '/path/to/proxy.cache',
889+
proxy_cache_loader_files: 1000
890+
}
891+
end
910892
it { is_expected.to contain_file('/path/to/nginx/nginx.conf').with_content(%r{\s+proxy_cache_path\s+/path/to/proxy.cache levels=1 keys_zone=d2:100m max_size=500m inactive=20m loader_files=1000;}) }
911893
end
912894

@@ -1085,12 +1067,6 @@
10851067
it { is_expected.to contain_file('/etc/nginx/nginx.conf').with_content %r{^user www-data;} }
10861068
end
10871069

1088-
context 'when nginx_error_log_severity = invalid' do
1089-
let(:params) { { nginx_error_log_severity: 'invalid' } }
1090-
1091-
it { expect { is_expected.to contain_class('nginx::config') }.to raise_error(Puppet::Error, %r{\$nginx_error_log_severity must be debug, info, notice, warn, error, crit, alert or emerg}) }
1092-
end
1093-
10941070
context 'when log_dir is non-default' do
10951071
let(:params) { { log_dir: '/foo/bar' } }
10961072

0 commit comments

Comments
 (0)