|
| 1 | +# frozen_string_literal: true |
| 2 | + |
1 | 3 | # Set defaults, use debian as base |
2 | 4 |
|
3 | 5 | server_available = '/etc/nginx/sites-available' |
4 | | -server_enabled = '/etc/nginx/sites-enabled' |
| 6 | +server_enabled = '/etc/nginx/sites-enabled' |
5 | 7 |
|
6 | 8 | # Override by platform family |
7 | 9 | case platform[:family] |
8 | | -when 'redhat','fedora' |
| 10 | +when 'redhat', 'fedora' |
9 | 11 | server_available = '/etc/nginx/conf.d' |
10 | 12 | server_enabled = '/etc/nginx/conf.d' |
11 | 13 | when 'suse' |
|
22 | 24 | it { should be_owned_by 'root' } |
23 | 25 | it { should be_grouped_into 'root' } |
24 | 26 | its('mode') { should cmp '0644' } |
25 | | - its('content') { should include %Q[ log_format main '$remote_addr - $remote_user [$time_local] $status ' |
| 27 | + its('content') do |
| 28 | + # rubocop:disable Metrics/LineLength |
| 29 | + should include %( log_format main '$remote_addr - $remote_user [$time_local] $status ' |
26 | 30 | '"$request" $body_bytes_sent "$http_referer" ' |
27 | | - '"$http_user_agent" "$http_x_forwarded_for"';] } |
| 31 | + '"$http_user_agent" "$http_x_forwarded_for"';) |
| 32 | + # rubocop:enable Metrics/LineLength |
| 33 | + end |
28 | 34 | end |
29 | 35 |
|
30 | 36 | # snippets configuration |
|
40 | 46 |
|
41 | 47 | # sites configuration |
42 | 48 | [server_available, server_enabled].each do |dir| |
43 | | - |
44 | | - describe file ("#{dir}/default") do |
45 | | - it { should_not exist } |
| 49 | + describe file "#{dir}/default" do |
| 50 | + it { should_not exist } |
46 | 51 | end |
47 | 52 |
|
48 | | - describe file ("#{dir}/mysite") do |
| 53 | + describe file "#{dir}/mysite" do |
49 | 54 | it { should be_file } |
50 | 55 | it { should be_owned_by 'root' } |
51 | 56 | it { should be_grouped_into 'root' } |
|
57 | 62 | its('content') { should include 'try_files $uri $uri/ =404;' } |
58 | 63 | its('content') { should include 'include snippets/letsencrypt.conf;' } |
59 | 64 | end |
60 | | - |
61 | 65 | end |
62 | 66 | end |
0 commit comments