Skip to content

Commit

Permalink
enable Lint/ParenthesesAsGroupedExpression
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Apr 11, 2016
1 parent 5e85e38 commit f1a4b88
Show file tree
Hide file tree
Showing 12 changed files with 122 additions and 99 deletions.
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Lint/Loop:

# DISABLED
Lint/ParenthesesAsGroupedExpression:
Enabled: false
Enabled: true

Lint/RescueException:
Enabled: false
Expand Down
20 changes: 11 additions & 9 deletions spec/classes/agent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
require 'spec_helper'

describe 'zabbix::agent' do
let (:node) { 'agent.example.com' }
let (:params) do
let :node do
'agent.example.com'
end
let :params do
{
server: '192.168.1.1',
serveractive: '192.168.1.1',
Expand All @@ -12,7 +14,7 @@
end

context 'On RedHat 7.1' do
let (:facts) do
let :facts do
{
osfamily: 'RedHat',
operatingsystem: 'RedHat',
Expand Down Expand Up @@ -42,7 +44,7 @@
it { should contain_file('/etc/zabbix/zabbix_agentd.d').with_ensure('directory') }

context "when declaring manage_repo is true" do
let (:params) do
let :params do
{
manage_repo: true,
}
Expand All @@ -53,7 +55,7 @@
end

context "when declaring manage_resources is true" do
let (:params) do
let :params do
{
manage_resources: true,
}
Expand All @@ -63,7 +65,7 @@
end

context "configuration file with hostnameitem" do
let (:params) do
let :params do
{
hostnameitem: 'system.hostname',
}
Expand All @@ -73,7 +75,7 @@
end

context "when declaring manage_firewall is true" do
let (:params) do
let :params do
{
manage_firewall: true,
}
Expand All @@ -83,7 +85,7 @@
end

context "when declaring manage_firewall is false" do
let (:params) do
let :params do
{
manage_firewall: false,
}
Expand All @@ -93,7 +95,7 @@
end

context "configuration file with full options" do
let (:params) do
let :params do
{
allowroot: '0',
agent_configfile_path: '/etc/zabbix/zabbix_agentd.conf',
Expand Down
10 changes: 6 additions & 4 deletions spec/classes/database_mysql_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
require 'spec_helper'

describe 'zabbix::database::mysql' do
let (:node) { 'rspec.puppet.com' }
let :node do
'rspec.puppet.com'
end

context 'On RedHat 6.5' do
let (:facts) do
let :facts do
{
osfamily: 'RedHat',
operatingsystem: 'RedHat',
Expand All @@ -26,7 +28,7 @@
end

describe "when zabbix_type is server" do
let (:params) do
let :params do
{
database_name: 'zabbix-server',
database_user: 'zabbix-server',
Expand All @@ -43,7 +45,7 @@
end

describe "when zabbix_type is proxy" do
let (:params) do
let :params do
{
database_name: 'zabbix-proxy',
database_user: 'zabbix-proxy',
Expand Down
12 changes: 7 additions & 5 deletions spec/classes/database_postgresql_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
require 'spec_helper'

describe 'zabbix::database::postgresql' do
let (:node) { 'rspec.puppet.com' }
let :node do
'rspec.puppet.com'
end

let (:pre_condition) do
let :pre_condition do
"include ::postgresql::server"
end

context 'On RedHat 6.5' do
let (:facts) do
let :facts do
{
osfamily: 'RedHat',
operatingsystem: 'RedHat',
Expand All @@ -30,7 +32,7 @@
end

describe "when zabbix_type is server" do
let (:params) do
let :params do
{
database_name: 'zabbix-server',
database_user: 'zabbix-server',
Expand All @@ -48,7 +50,7 @@
end

describe "when zabbix_type is proxy" do
let (:params) do
let :params do
{
database_name: 'zabbix-proxy',
database_user: 'zabbix-proxy',
Expand Down
22 changes: 12 additions & 10 deletions spec/classes/database_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
require 'spec_helper'

describe 'zabbix::database' do
let (:node) { 'rspec.puppet.com' }
let :node do
'rspec.puppet.com'
end

let (:pre_condition) do
let :pre_condition do
"class {'postgresql::server':}"
end

context 'On RedHat 6.5' do
let (:facts) do
let :facts do
{
osfamily: 'RedHat',
operatingsystem: 'RedHat',
Expand All @@ -30,7 +32,7 @@
end

describe "database_type is postgresql, zabbix_type is server and is multiple host setup" do
let (:params) do
let :params do
{
database_type: 'postgresql',
database_name: 'zabbix-server',
Expand All @@ -54,7 +56,7 @@
end

describe "database_type is postgresql, zabbix_type is server and is single node setup" do
let (:params) do
let :params do
{
database_type: 'postgresql',
database_name: 'zabbix-server',
Expand All @@ -78,7 +80,7 @@
end

describe "database_type is postgresql, zabbix_type is proxy" do
let (:params) do
let :params do
{
database_type: 'postgresql',
database_name: 'zabbix-proxy',
Expand All @@ -94,7 +96,7 @@
end

describe "database_type is mysql, zabbix_type is server and is multiple host setup" do
let (:params) do
let :params do
{
database_type: 'mysql',
database_name: 'zabbix-server',
Expand All @@ -116,7 +118,7 @@
end

describe "database_type is mysql, zabbix_type is server and is a single host setup" do
let (:params) do
let :params do
{
database_type: 'mysql',
database_name: 'zabbix-server',
Expand All @@ -138,7 +140,7 @@
end

describe "database_type is mysql, zabbix_type is proxy and is a single host setup" do
let (:params) do
let :params do
{
database_type: 'mysql',
database_name: 'zabbix-proxy',
Expand All @@ -152,7 +154,7 @@
end

describe "database_type is sqlite, zabbix_type is proxy and is a multiple host setup" do
let (:params) do
let :params do
{
database_type: 'sqlite',
database_name: 'zabbix-server',
Expand Down
8 changes: 5 additions & 3 deletions spec/classes/javagateway_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
require 'spec_helper'

describe 'zabbix::javagateway' do
let (:node) { 'rspec.puppet.com' }
let :node do
'rspec.puppet.com'
end

context 'On RedHat 6.5' do
let (:facts) do
let :facts do
{
osfamily: 'RedHat',
operatingsystem: 'RedHat',
Expand All @@ -29,7 +31,7 @@
it { should contain_service('zabbix-java-gateway')}

context 'when declaring manage_repo is true' do
let (:params) do
let :params do
{
manage_repo: true,
}
Expand Down
22 changes: 12 additions & 10 deletions spec/classes/proxy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@
require 'spec_helper'

describe 'zabbix::proxy' do
let (:node) { 'rspec.puppet.com' }
let :node do
'rspec.puppet.com'
end

let (:params) do
let :params do
{
zabbix_server_host: '192.168.1.1',
zabbix_version: '2.4'
}
end

context 'On RedHat 7.1' do
let (:facts) do
let :facts do
{
osfamily: 'RedHat',
operatingsystem: 'RedHat',
Expand All @@ -32,15 +34,15 @@
}
end

let (:pre_condition) do
let :pre_condition do
"class {'postgresql::server':}"
end

it { should contain_file('/etc/zabbix/zabbix_proxy.conf.d').with_ensure('directory') }
it { should contain_file('/etc/zabbix/zabbix_proxy.conf.d').with_require('File[/etc/zabbix/zabbix_proxy.conf]') }

describe "when manage_repo is true" do
let (:params) do
let :params do
{
manage_repo: true,
}
Expand All @@ -51,7 +53,7 @@
end

describe "when database_type is postgresql" do
let (:params) do
let :params do
{
database_type: 'postgresql',
}
Expand All @@ -65,7 +67,7 @@
end

describe "when database_type is mysql" do
let (:params) do
let :params do
{
database_type: 'mysql',
}
Expand All @@ -79,7 +81,7 @@
end

describe "when manage_resources is true" do
let (:params) do
let :params do
{
manage_resources: true,
listenip: '192.168.1.1',
Expand All @@ -90,7 +92,7 @@
end

context 'with zabbix::database::postgresql class' do
let (:params) do
let :params do
{
database_type: 'postgresql',
manage_database: true,
Expand Down Expand Up @@ -285,7 +287,7 @@
end

context "with zabbix_proxy.conf and version 3.0" do
let (:params) do
let :params do
{
tlsaccept: 'cert',
tlscafile: '/etc/zabbix/keys/zabbix-server.ca',
Expand Down
Loading

0 comments on commit f1a4b88

Please sign in to comment.