Skip to content

Commit

Permalink
Fix remaining rubocop offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
root-expert committed Jul 3, 2022
1 parent dd16ab8 commit 27ecaea
Show file tree
Hide file tree
Showing 6 changed files with 583 additions and 593 deletions.
2 changes: 2 additions & 0 deletions lib/puppet/type/splunk_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
desc 'splunk config'
end

# rubocop:disable Lint/EmptyBlock
newparam(:forwarder_installdir) do
end

Expand All @@ -21,6 +22,7 @@

newparam(:server_confdir) do
end
# rubocop:enable Lint/EmptyBlock

## Generate purge parameters for the splunk_config type
%i[
Expand Down
680 changes: 339 additions & 341 deletions spec/classes/enterprise_spec.rb

Large diffs are not rendered by default.

428 changes: 213 additions & 215 deletions spec/classes/forwarder_spec.rb

Large diffs are not rendered by default.

24 changes: 10 additions & 14 deletions spec/classes/splunk_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,17 @@
require 'spec_helper'

describe 'splunk' do
context 'supported operating systems' do
on_supported_os.each do |os, facts|
if os.start_with?('windows')
# Splunk Server not used supported on windows
else
context "on #{os}" do
let(:facts) do
facts
end
on_supported_os.each do |os, facts|
next if facts[:os]['name'] == 'windows' # Splunk Server not used supported on windows

context 'splunk class without any parameters' do
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_class('splunk') }
end
end
context "on #{os}" do
let(:facts) do
facts
end

context 'splunk class without any parameters' do
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_class('splunk') }
end
end
end
Expand Down
40 changes: 18 additions & 22 deletions spec/defines/addon_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@
describe 'splunk::addon' do
context 'fail if class prerequisit not declared' do
on_supported_os.each do |os, facts|
if os.start_with?('windows')
# Splunk Server not used supported on windows
else
context "on #{os}" do
let(:facts) do
facts
end
let(:title) { 'Splunk_TA' }
let(:params) { { 'splunkbase_source' => 'puppet:///modules/profiles/splunk-add-on.tgz' } }

it { is_expected.to compile.and_raise_error(%r{Error while evaluating a Function Call}) }
next if facts[:os]['name'] == 'windows' # Splunk Server not used supported on windows

context "on #{os}" do
let(:facts) do
facts
end
let(:title) { 'Splunk_TA' }
let(:params) { { 'splunkbase_source' => 'puppet:///modules/profiles/splunk-add-on.tgz' } }

it { is_expected.to compile.and_raise_error(%r{Error while evaluating a Function Call}) }
end
end
end
Expand All @@ -27,18 +25,16 @@
end

on_supported_os.each do |os, facts|
if os.start_with?('windows')
# Splunk Server not used supported on windows
else
context "on #{os}" do
let(:facts) do
facts
end
let(:title) { 'Splunk_TA' }
let(:params) { { 'splunkbase_source' => 'puppet:///modules/profiles/splunk-add-on.tgz' } }

it { is_expected.to compile.with_all_deps }
next if facts[:os]['name'] == 'windows' # Splunk Server not used supported on windows

context "on #{os}" do
let(:facts) do
facts
end
let(:title) { 'Splunk_TA' }
let(:params) { { 'splunkbase_source' => 'puppet:///modules/profiles/splunk-add-on.tgz' } }

it { is_expected.to compile.with_all_deps }
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/puppet/type/splunk_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'spec_helper'

describe Puppet::Type.type(:splunk_config) do
let(:subject) do
let(:subject) do # rubocop:disable RSpec/SubjectDeclaration
described_class.new(
name: 'config',
server_confdir: '/opt/splunk/etc',
Expand Down

0 comments on commit 27ecaea

Please sign in to comment.