Skip to content

Commit

Permalink
Rubocop: Fix Lint/ParenthesesAsGroupedExpression
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjfisher committed Feb 18, 2018
1 parent 76875aa commit c6e17f9
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 22 deletions.
8 changes: 0 additions & 8 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ Lint/HandleExceptions:
Exclude:
- 'lib/puppet/jenkins/plugins.rb'

# Offense count: 14
Lint/ParenthesesAsGroupedExpression:
Exclude:
- 'spec/classes/jenkins_direct_download_spec.rb'
- 'spec/classes/jenkins_spec.rb'
- 'spec/defines/jenkins_augeas_spec.rb'
- 'spec/unit/jenkins_plugins_spec.rb'

# Offense count: 1
Lint/UselessAssignment:
Exclude:
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/jenkins_direct_download_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
end

context 'package removable' do
let (:params) { { version: 'absent', direct_download: 'http://local.space/jenkins.rpm' } }
let(:params) { { version: 'absent', direct_download: 'http://local.space/jenkins.rpm' } }

it { is_expected.not_to contain_staging__file('jenkins.rpm') }
it { is_expected.to contain_package('jenkins').with_ensure('absent') }
end

context 'unsupported provider fails' do
let (:params) { { package_provider: false, direct_download: 'http://local.space/jenkins.rpm' } }
let(:params) { { package_provider: false, direct_download: 'http://local.space/jenkins.rpm' } }

it do
expect { is_expected.to compile }.to raise_error(RSpec::Expectations::ExpectationNotMetError, %r{error during compilation})
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/jenkins_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@
end

describe 'with default plugins override' do
let (:params) { { default_plugins: [] } }
let(:params) { { default_plugins: [] } }

it { is_expected.not_to contain_jenkins__plugin 'credentials' }
end
Expand Down
18 changes: 9 additions & 9 deletions spec/defines/jenkins_augeas_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

[false].each do |pval|
describe "with plugin param #{pval} (#{pval.class})" do
let (:params) { { config_filename: 'foo.xml', changes: ['set foo bar'], plugin: pval } }
let(:params) { { config_filename: 'foo.xml', changes: ['set foo bar'], plugin: pval } }

it do
is_expected.to contain_augeas('jenkins::augeas: myplug').with(
Expand All @@ -36,7 +36,7 @@

[true].each do |pval|
describe "with plugin param #{pval} (#{pval.class})" do
let (:params) { { config_filename: 'foo.xml', changes: ['set foo bar'], plugin: pval } }
let(:params) { { config_filename: 'foo.xml', changes: ['set foo bar'], plugin: pval } }

it do
is_expected.to contain_jenkins__plugin('myplug')
Expand All @@ -45,7 +45,7 @@
end

describe "with plugin param 'pluginname'" do
let (:params) { { config_filename: 'foo.xml', changes: ['set foo bar'], plugin: 'pluginname' } }
let(:params) { { config_filename: 'foo.xml', changes: ['set foo bar'], plugin: 'pluginname' } }

it do
is_expected.to contain_jenkins__plugin('pluginname')
Expand All @@ -60,7 +60,7 @@
# | `---' --- |

describe 'with plugin_version set' do
let (:params) do
let(:params) do
{
config_filename: 'foo.xml',
changes: [],
Expand All @@ -84,7 +84,7 @@
# `---'`---'` '`---'`---'' ``---' |---'`---^` `---^` ' '
# |
describe 'without context set' do
let (:params) do
let(:params) do
{
plugin: false,
config_filename: 'foo.xml',
Expand All @@ -102,7 +102,7 @@
end

describe 'with context set' do
let (:params) do
let(:params) do
{
plugin: false,
config_filename: 'foo.xml',
Expand All @@ -129,7 +129,7 @@

[['get foo != bar'], 'get foo != bar'].each do |pval|
describe "with param onlyif set and class is #{pval.class}" do
let (:params) do
let(:params) do
{
plugin: false,
config_filename: 'foo.xml',
Expand Down Expand Up @@ -157,7 +157,7 @@
# `---' |
[['set foo bar'], 'set foo bar'].each do |pval|
describe "with param changes set and class is #{pval.class}" do
let (:params) do
let(:params) do
{
plugin: false,
config_filename: 'foo.xml',
Expand Down Expand Up @@ -185,7 +185,7 @@
false => 'reload-jenkins'
}.each do |pval, expected|
describe "with param restart set to '#{pval}' (#{pval.class})" do
let (:params) do
let(:params) do
{
plugin: false,
config_filename: 'foo.xml',
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/jenkins_plugins_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
context 'uses json' do
it { is_expected.to be_instance_of Hash }
it { is_expected.to have_key('AdaptivePlugin') }
its (:size) { is_expected.to be 1 }
its(:size) { is_expected.to be 1 }
end

context 'uses okjson when json is not avaliable' do
Expand All @@ -155,7 +155,7 @@

it { is_expected.to be_instance_of Hash }
it { is_expected.to have_key('AdaptivePlugin') }
its (:size) { is_expected.to be 1 }
its(:size) { is_expected.to be 1 }
end
end

Expand Down

0 comments on commit c6e17f9

Please sign in to comment.