Skip to content

Commit

Permalink
rake rubocop:autoauto_correct
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill Schwanitz committed Nov 3, 2016
1 parent eb0a61e commit 8086982
Show file tree
Hide file tree
Showing 7 changed files with 165 additions and 163 deletions.
2 changes: 2 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--color
--format documentation
88 changes: 44 additions & 44 deletions spec/classes/rsyslog_client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
let(:title) { 'rsyslog-client-basic' }

it 'compiles' do
should contain_file('/etc/rsyslog.d/client.conf')
is_expected.to contain_file('/etc/rsyslog.d/client.conf')
end
end

Expand All @@ -30,19 +30,19 @@
let(:params) { { split_config: true } }

it 'does not manage client.conf' do
should_not contain_file('/etc/rsyslog.d/client.conf')
is_expected.not_to contain_file('/etc/rsyslog.d/client.conf')
end

it 'configures client' do
should contain_file('/etc/rsyslog.d/00_client_config.conf').with_ensure('present')
is_expected.to contain_file('/etc/rsyslog.d/00_client_config.conf').with_ensure('present')
end

it 'configures client remote logging' do
should contain_file('/etc/rsyslog.d/50_client_remote.conf').with_ensure('present')
is_expected.to contain_file('/etc/rsyslog.d/50_client_remote.conf').with_ensure('present')
end

it 'removes client local logging' do
should contain_file('/etc/rsyslog.d/99_client_local.conf').with_ensure('absent')
is_expected.to contain_file('/etc/rsyslog.d/99_client_local.conf').with_ensure('absent')
end
end

Expand All @@ -51,7 +51,7 @@
let(:params) { { 'log_filters' => [{ 'expression' => '$msg contains \'error0\'', 'action' => '/var/log/err.log' }] } }

it 'compiles' do
should contain_file('/etc/rsyslog.d/client.conf').with_content(%r{if \$msg contains 'error0' then /var/log/err.log})
is_expected.to contain_file('/etc/rsyslog.d/client.conf').with_content(%r{if \$msg contains 'error0' then /var/log/err.log})
end
end
end
Expand All @@ -68,7 +68,7 @@
let(:title) { 'rsyslog-client-basic' }

it 'compiles' do
should contain_file('/etc/rsyslog.d/client.conf')
is_expected.to contain_file('/etc/rsyslog.d/client.conf')
end
end

Expand All @@ -77,19 +77,19 @@
let(:params) { { split_config: true } }

it 'does not manage client.conf' do
should_not contain_file('/etc/rsyslog.d/client.conf')
is_expected.not_to contain_file('/etc/rsyslog.d/client.conf')
end

it 'configures client' do
should contain_file('/etc/rsyslog.d/00_client_config.conf').with_ensure('present')
is_expected.to contain_file('/etc/rsyslog.d/00_client_config.conf').with_ensure('present')
end

it 'configures client remote logging' do
should contain_file('/etc/rsyslog.d/50_client_remote.conf').with_ensure('present')
is_expected.to contain_file('/etc/rsyslog.d/50_client_remote.conf').with_ensure('present')
end

it 'removes client local logging' do
should contain_file('/etc/rsyslog.d/99_client_local.conf').with_ensure('absent')
is_expected.to contain_file('/etc/rsyslog.d/99_client_local.conf').with_ensure('absent')
end
end

Expand All @@ -98,7 +98,7 @@
let(:params) { { 'log_filters' => [{ 'expression' => '$msg contains \'error0\'', 'action' => '/var/log/err.log' }] } }

it 'compiles' do
should contain_file('/etc/rsyslog.d/client.conf').with_content(%r{if \$msg contains 'error0' then /var/log/err.log})
is_expected.to contain_file('/etc/rsyslog.d/client.conf').with_content(%r{if \$msg contains 'error0' then /var/log/err.log})
end
end

Expand All @@ -108,7 +108,7 @@
context 'without SSL' do
let(:params) { { ssl_auth_mode: 'x509/name' } }
it 'fails' do
expect { should contain_class('rsyslog::client') }.to raise_error(Puppet::Error, %r{You need to enable SSL in order to use ssl_auth_mode.})
expect { is_expected.to contain_class('rsyslog::client') }.to raise_error(Puppet::Error, %r{You need to enable SSL in order to use ssl_auth_mode.})
end
end

Expand All @@ -123,7 +123,7 @@
let(:params) { ssl_params }

it 'compiles' do
should contain_file('/etc/rsyslog.d/client.conf').with_content(%r{\$ActionSendStreamDriverAuthMode anon}).without_content(%r{\$ActionSendStreamDriverPermittedPeer})
is_expected.to contain_file('/etc/rsyslog.d/client.conf').with_content(%r{\$ActionSendStreamDriverAuthMode anon}).without_content(%r{\$ActionSendStreamDriverPermittedPeer})
end
end

Expand All @@ -135,7 +135,7 @@
end

it 'contains ActionSendStreamDriverAuthMode' do
should contain_file('/etc/rsyslog.d/client.conf').with_content(%r{\$ActionSendStreamDriverAuthMode x509\/name}).without_content(%r{\$ActionSendStreamDriverPermittedPeer})
is_expected.to contain_file('/etc/rsyslog.d/client.conf').with_content(%r{\$ActionSendStreamDriverAuthMode x509\/name}).without_content(%r{\$ActionSendStreamDriverPermittedPeer})
end
end

Expand All @@ -147,7 +147,7 @@
end

it 'fails' do
expect { should contain_class('rsyslog::client') }.to raise_error(Puppet::Error, %r{You need to set auth_mode to 'x509\/name' in order to use ssl_permitted_peer.})
expect { is_expected.to contain_class('rsyslog::client') }.to raise_error(Puppet::Error, %r{You need to set auth_mode to 'x509\/name' in order to use ssl_permitted_peer.})
end
end

Expand All @@ -160,7 +160,7 @@
end

it 'contains ActionSendStreamDriverPermittedPeer' do
should contain_file('/etc/rsyslog.d/client.conf').with_content(%r{\$ActionSendStreamDriverAuthMode x509\/name}).with_content(%r{\$ActionSendStreamDriverPermittedPeer logs.example.com})
is_expected.to contain_file('/etc/rsyslog.d/client.conf').with_content(%r{\$ActionSendStreamDriverAuthMode x509\/name}).with_content(%r{\$ActionSendStreamDriverPermittedPeer logs.example.com})
end
end
end
Expand All @@ -179,7 +179,7 @@
let(:title) { 'rsyslog-client-basic' }

it 'compiles' do
should contain_file('/usr/local/etc/rsyslog.d/client.conf')
is_expected.to contain_file('/usr/local/etc/rsyslog.d/client.conf')
end
end

Expand All @@ -188,19 +188,19 @@
let(:params) { { split_config: true } }

it 'does not manage client.conf' do
should_not contain_file('/usr/local/etc/rsyslog.d/client.conf')
is_expected.not_to contain_file('/usr/local/etc/rsyslog.d/client.conf')
end

it 'configures client' do
should contain_file('/usr/local/etc/rsyslog.d/00_client_config.conf').with_ensure('present')
is_expected.to contain_file('/usr/local/etc/rsyslog.d/00_client_config.conf').with_ensure('present')
end

it 'configures client remote logging' do
should contain_file('/usr/local/etc/rsyslog.d/50_client_remote.conf').with_ensure('present')
is_expected.to contain_file('/usr/local/etc/rsyslog.d/50_client_remote.conf').with_ensure('present')
end

it 'removes client local logging' do
should contain_file('/usr/local/etc/rsyslog.d/99_client_local.conf').with_ensure('absent')
is_expected.to contain_file('/usr/local/etc/rsyslog.d/99_client_local.conf').with_ensure('absent')
end
end
end
Expand All @@ -226,7 +226,7 @@
let(:title) { 'rsyslog-client-basic' }

it 'compiles' do
should contain_file('/etc/rsyslog.d/client.conf')
is_expected.to contain_file('/etc/rsyslog.d/client.conf')
end
end

Expand All @@ -235,19 +235,19 @@
let(:params) { { split_config: true } }

it 'does not manage client.conf' do
should_not contain_file('/etc/rsyslog.d/client.conf')
is_expected.not_to contain_file('/etc/rsyslog.d/client.conf')
end

it 'configures client' do
should contain_file('/etc/rsyslog.d/00_client_config.conf').with_ensure('present')
is_expected.to contain_file('/etc/rsyslog.d/00_client_config.conf').with_ensure('present')
end

it 'configures client remote logging' do
should contain_file('/etc/rsyslog.d/50_client_remote.conf').with_ensure('present')
is_expected.to contain_file('/etc/rsyslog.d/50_client_remote.conf').with_ensure('present')
end

it 'removes client local logging' do
should contain_file('/etc/rsyslog.d/99_client_local.conf').with_ensure('absent')
is_expected.to contain_file('/etc/rsyslog.d/99_client_local.conf').with_ensure('absent')
end
end

Expand All @@ -256,7 +256,7 @@
let(:params) { { 'log_filters' => [{ 'expression' => '$msg contains \'error0\'', 'action' => '/var/log/err.log' }] } }

it 'compiles' do
should contain_file('/etc/rsyslog.d/client.conf').with_content(%r{if \$msg contains 'error0' then /var/log/err.log})
is_expected.to contain_file('/etc/rsyslog.d/client.conf').with_content(%r{if \$msg contains 'error0' then /var/log/err.log})
end
end
end
Expand All @@ -273,7 +273,7 @@
let(:title) { 'rsyslog-client-basic' }

it 'compiles' do
should contain_file('/etc/rsyslog.d/client.conf')
is_expected.to contain_file('/etc/rsyslog.d/client.conf')
end
end

Expand All @@ -282,19 +282,19 @@
let(:params) { { split_config: true } }

it 'does not manage client.conf' do
should_not contain_file('/etc/rsyslog.d/client.conf')
is_expected.not_to contain_file('/etc/rsyslog.d/client.conf')
end

it 'configures client' do
should contain_file('/etc/rsyslog.d/00_client_config.conf').with_ensure('present')
is_expected.to contain_file('/etc/rsyslog.d/00_client_config.conf').with_ensure('present')
end

it 'configures client remote logging' do
should contain_file('/etc/rsyslog.d/50_client_remote.conf').with_ensure('present')
is_expected.to contain_file('/etc/rsyslog.d/50_client_remote.conf').with_ensure('present')
end

it 'removes client local logging' do
should contain_file('/etc/rsyslog.d/99_client_local.conf').with_ensure('absent')
is_expected.to contain_file('/etc/rsyslog.d/99_client_local.conf').with_ensure('absent')
end
end

Expand All @@ -303,7 +303,7 @@
let(:params) { { 'log_filters' => [{ 'expression' => '$msg contains \'error0\'', 'action' => '/var/log/err.log' }] } }

it 'compiles' do
should contain_file('/etc/rsyslog.d/client.conf').with_content(%r{if \$msg contains 'error0' then /var/log/err.log})
is_expected.to contain_file('/etc/rsyslog.d/client.conf').with_content(%r{if \$msg contains 'error0' then /var/log/err.log})
end
end
end
Expand All @@ -320,7 +320,7 @@
let(:title) { 'rsyslog-client-basic' }

it 'compiles' do
should contain_file('/usr/local/etc/rsyslog.d/client.conf')
is_expected.to contain_file('/usr/local/etc/rsyslog.d/client.conf')
end
end

Expand All @@ -329,19 +329,19 @@
let(:params) { { split_config: true } }

it 'does not manage client.conf' do
should_not contain_file('/usr/local/etc/rsyslog.d/client.conf')
is_expected.not_to contain_file('/usr/local/etc/rsyslog.d/client.conf')
end

it 'configures client' do
should contain_file('/usr/local/etc/rsyslog.d/00_client_config.conf').with_ensure('present')
is_expected.to contain_file('/usr/local/etc/rsyslog.d/00_client_config.conf').with_ensure('present')
end

it 'configures client remote logging' do
should contain_file('/usr/local/etc/rsyslog.d/50_client_remote.conf').with_ensure('present')
is_expected.to contain_file('/usr/local/etc/rsyslog.d/50_client_remote.conf').with_ensure('present')
end

it 'removes client local logging' do
should contain_file('/usr/local/etc/rsyslog.d/99_client_local.conf').with_ensure('absent')
is_expected.to contain_file('/usr/local/etc/rsyslog.d/99_client_local.conf').with_ensure('absent')
end
end
end
Expand All @@ -367,7 +367,7 @@
let(:title) { 'rsyslog-client-basic' }

it 'compiles' do
should contain_file('/etc/rsyslog.d/client.conf')
is_expected.to contain_file('/etc/rsyslog.d/client.conf')
end
end

Expand All @@ -376,19 +376,19 @@
let(:params) { { split_config: true } }

it 'does not manage client.conf' do
should_not contain_file('/etc/rsyslog.d/client.conf')
is_expected.not_to contain_file('/etc/rsyslog.d/client.conf')
end

it 'configures client' do
should contain_file('/etc/rsyslog.d/00_client_config.conf').with_ensure('present')
is_expected.to contain_file('/etc/rsyslog.d/00_client_config.conf').with_ensure('present')
end

it 'configures client remote logging' do
should contain_file('/etc/rsyslog.d/50_client_remote.conf').with_ensure('present')
is_expected.to contain_file('/etc/rsyslog.d/50_client_remote.conf').with_ensure('present')
end

it 'removes client local logging' do
should contain_file('/etc/rsyslog.d/99_client_local.conf').with_ensure('absent')
is_expected.to contain_file('/etc/rsyslog.d/99_client_local.conf').with_ensure('absent')
end
end
end
Expand Down
Loading

0 comments on commit 8086982

Please sign in to comment.