From b9f095cfe22f624999bcd7bbcc8948f4c76ba74f Mon Sep 17 00:00:00 2001 From: Alexander Fisher Date: Wed, 31 Jan 2018 19:48:30 +0000 Subject: [PATCH] Rubocop: Fix Layout/SpaceInsideHashLiteralBraces --- lib/puppet/jenkins/okjson.rb | 2 +- spec/classes/jenkins_cli_spec.rb | 2 +- spec/classes/jenkins_slave_spec.rb | 10 ++-- spec/defines/jenkins_plugin_spec.rb | 6 +- spec/unit/facter/plugins_spec.rb | 6 +- spec/unit/jenkins_plugins_spec.rb | 58 +++++++++---------- .../cli_spec.rb | 2 +- .../provider/jenkins_credentials/cli_spec.rb | 4 +- .../puppet/provider/jenkins_job/cli_spec.rb | 10 ++-- .../jenkins_security_realm/cli_spec.rb | 2 +- .../puppet/x/jenkins/provider/cli_spec.rb | 6 +- 11 files changed, 54 insertions(+), 54 deletions(-) diff --git a/lib/puppet/jenkins/okjson.rb b/lib/puppet/jenkins/okjson.rb index eb3f0f484..3664a0916 100644 --- a/lib/puppet/jenkins/okjson.rb +++ b/lib/puppet/jenkins/okjson.rb @@ -530,5 +530,5 @@ class Error < ::StandardError Usurr3 = 0xe000 Spc = ' '[0] - Unesc = {?b => ?\b, ?f => ?\f, ?n => ?\n, ?r => ?\r, ?t => ?\t} + Unesc = { ?b => ?\b, ?f => ?\f, ?n => ?\n, ?r => ?\r, ?t => ?\t } end \ No newline at end of file diff --git a/spec/classes/jenkins_cli_spec.rb b/spec/classes/jenkins_cli_spec.rb index c56d941c3..046f4cd73 100644 --- a/spec/classes/jenkins_cli_spec.rb +++ b/spec/classes/jenkins_cli_spec.rb @@ -20,7 +20,7 @@ context '$cli => true' do let(:params) do { cli: true, cli_ssh_keyfile: '/path/to/key', - config_hash: { 'HTTP_PORT' => { 'value' => '9000' } }} + config_hash: { 'HTTP_PORT' => { 'value' => '9000' } } } end it { should contain_class('jenkins::cli') } it { should contain_exec('jenkins-cli') } diff --git a/spec/classes/jenkins_slave_spec.rb b/spec/classes/jenkins_slave_spec.rb index bcbc557fc..02445d6eb 100644 --- a/spec/classes/jenkins_slave_spec.rb +++ b/spec/classes/jenkins_slave_spec.rb @@ -42,12 +42,12 @@ describe 'with a non-default $slave_home' do let(:home) { '/home/rspec-runner' } - let(:params) { {slave_home: home } } + let(:params) { { slave_home: home } } it { should contain_file(slave_runtime_file).with_content(/^FSROOT="#{home}"$/) } end describe 'with service disabled' do - let(:params) { {enable: false, ensure: 'stopped' } } + let(:params) { { enable: false, ensure: 'stopped' } } it { should contain_service('jenkins-slave').with(enable: false, ensure: 'stopped') } end @@ -333,9 +333,9 @@ describe 'Darwin' do let(:facts) do - {osfamily: 'Darwin', - operatingsystem: 'Darwin', - kernel: 'Darwin'} + { osfamily: 'Darwin', + operatingsystem: 'Darwin', + kernel: 'Darwin' } end let(:home) { '/home/jenkins-slave' } let(:slave_runtime_file) { "#{home}/jenkins-slave" } diff --git a/spec/defines/jenkins_plugin_spec.rb b/spec/defines/jenkins_plugin_spec.rb index c596ae3a8..f9d5e41b5 100644 --- a/spec/defines/jenkins_plugin_spec.rb +++ b/spec/defines/jenkins_plugin_spec.rb @@ -176,7 +176,7 @@ class { jenkins: context 'by default' do context 'with a version' do let(:version) { '1.3.3.7' } - let(:params) { {version: version} } + let(:params) { { version: version } } let(:expected_url) do "#{plugin_host}/download/plugins/#{title}/#{version}/#{title}.hpi" end @@ -197,7 +197,7 @@ class { jenkins: let(:update_url) { 'http://rspec' } context 'without a version' do - let(:params) { {update_url: update_url} } + let(:params) { { update_url: update_url } } let(:expected_url) do "#{update_url}/latest/#{title}.hpi" end @@ -207,7 +207,7 @@ class { jenkins: context 'with a version' do let(:version) { '1.2.3' } - let(:params) { {update_url: update_url, version: version} } + let(:params) { { update_url: update_url, version: version } } let(:expected_url) do "#{update_url}/download/plugins/#{title}/#{version}/#{title}.hpi" end diff --git a/spec/unit/facter/plugins_spec.rb b/spec/unit/facter/plugins_spec.rb index 5e59a1c72..1469877ac 100644 --- a/spec/unit/facter/plugins_spec.rb +++ b/spec/unit/facter/plugins_spec.rb @@ -18,7 +18,7 @@ context 'with one plugin' do let(:plugins) do { - 'greenballs' => {plugin_version: '1.1', description: 'rspec'} + 'greenballs' => { plugin_version: '1.1', description: 'rspec' } } end @@ -29,8 +29,8 @@ context 'with multiple plugins' do let(:plugins) do { - 'greenballs' => {plugin_version: '1.1', description: 'rspec'}, - 'git' => {plugin_version: '1.7', description: 'rspec'} + 'greenballs' => { plugin_version: '1.1', description: 'rspec' }, + 'git' => { plugin_version: '1.7', description: 'rspec' } } end diff --git a/spec/unit/jenkins_plugins_spec.rb b/spec/unit/jenkins_plugins_spec.rb index 038a7faf4..dd890f68b 100644 --- a/spec/unit/jenkins_plugins_spec.rb +++ b/spec/unit/jenkins_plugins_spec.rb @@ -159,35 +159,35 @@ end let(:git_plugin) do - {'buildDate' => 'Jan 08, 2014', - 'dependencies' => - [{'name' => 'promoted-builds', 'optional' => true, 'version' => '2.7'}, - {'name' => 'token-macro', 'optional' => true, 'version' => '1.5.1'}, - {'name' => 'ssh-credentials', 'optional' => false, 'version' => '1.5.1'}, - {'name' => 'scm-api', 'optional' => false, 'version' => '0.1'}, - {'name' => 'credentials', 'optional' => false, 'version' => '1.9.3'}, - {'name' => 'multiple-scms', 'optional' => true, 'version' => '0.2'}, - {'name' => 'parameterized-trigger', 'optional' => true, 'version' => '2.4'}, - {'name' => 'git-client', 'optional' => false, 'version' => '1.6.0'}], - 'developers' => - [{'developerId' => 'kohsuke', 'name' => 'Kohsuke Kawaguchi'}, - {'developerId' => 'ndeloof', - 'email' => 'nicolas.deloof@gmail.com', - 'name' => 'Nicolas De Loof'}], - 'excerpt' => + { 'buildDate' => 'Jan 08, 2014', + 'dependencies' => + [{ 'name' => 'promoted-builds', 'optional' => true, 'version' => '2.7' }, + { 'name' => 'token-macro', 'optional' => true, 'version' => '1.5.1' }, + { 'name' => 'ssh-credentials', 'optional' => false, 'version' => '1.5.1' }, + { 'name' => 'scm-api', 'optional' => false, 'version' => '0.1' }, + { 'name' => 'credentials', 'optional' => false, 'version' => '1.9.3' }, + { 'name' => 'multiple-scms', 'optional' => true, 'version' => '0.2' }, + { 'name' => 'parameterized-trigger', 'optional' => true, 'version' => '2.4' }, + { 'name' => 'git-client', 'optional' => false, 'version' => '1.6.0' }], + 'developers' => + [{ 'developerId' => 'kohsuke', 'name' => 'Kohsuke Kawaguchi' }, + { 'developerId' => 'ndeloof', + 'email' => 'nicolas.deloof@gmail.com', + 'name' => 'Nicolas De Loof' }], + 'excerpt' => "This plugin allows use of Git as a build SCM. A recent Git runtime is required (1.7.9 minimum, 1.8.x recommended). Plugin is only tested on official git client. Use exotic installations at your own risks.", - 'gav' => 'org.jenkins-ci.plugins:git:2.0.1', - 'labels' => ['scm'], - 'name' => 'git', - 'previousTimestamp' => '2013-10-22T22:00:16.00Z', - 'previousVersion' => '2.0', - 'releaseTimestamp' => '2014-01-08T21:46:20.00Z', - 'requiredCore' => '1.480', - 'scm' => 'github.com', - 'sha1' => 'r5bK/IP8soP08D55Xpcx5yWHzdY=', - 'title' => 'Git Plugin', - 'url' => 'http://updates.jenkins-ci.org/download/plugins/git/2.0.1/git.hpi', - 'version' => '2.0.1', - 'wiki' => 'https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin'} + 'gav' => 'org.jenkins-ci.plugins:git:2.0.1', + 'labels' => ['scm'], + 'name' => 'git', + 'previousTimestamp' => '2013-10-22T22:00:16.00Z', + 'previousVersion' => '2.0', + 'releaseTimestamp' => '2014-01-08T21:46:20.00Z', + 'requiredCore' => '1.480', + 'scm' => 'github.com', + 'sha1' => 'r5bK/IP8soP08D55Xpcx5yWHzdY=', + 'title' => 'Git Plugin', + 'url' => 'http://updates.jenkins-ci.org/download/plugins/git/2.0.1/git.hpi', + 'version' => '2.0.1', + 'wiki' => 'https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin' } end end diff --git a/spec/unit/puppet/provider/jenkins_authorization_strategy/cli_spec.rb b/spec/unit/puppet/provider/jenkins_authorization_strategy/cli_spec.rb index dad009d26..f0ff50910 100644 --- a/spec/unit/puppet/provider/jenkins_authorization_strategy/cli_spec.rb +++ b/spec/unit/puppet/provider/jenkins_authorization_strategy/cli_spec.rb @@ -133,7 +133,7 @@ it do expect(described_class).to receive(:clihelper).with( ['get_authorization_strategy'], - {catalog: nil}, + { catalog: nil }, ) { strategy_oauth_json } raw = described_class.send :get_authorization_strategy diff --git a/spec/unit/puppet/provider/jenkins_credentials/cli_spec.rb b/spec/unit/puppet/provider/jenkins_credentials/cli_spec.rb index e550bee34..df273fc57 100644 --- a/spec/unit/puppet/provider/jenkins_credentials/cli_spec.rb +++ b/spec/unit/puppet/provider/jenkins_credentials/cli_spec.rb @@ -376,7 +376,7 @@ it do expect(described_class).to receive(:clihelper).with( ['credentials_list_json'], - {catalog: nil} + { catalog: nil } ) { JSON.pretty_generate(credentials[0]) } raw = described_class.send :credentials_list_json @@ -394,7 +394,7 @@ expect(described_class).to receive(:clihelper).with( ['credentials_update_json'], - {stdinjson: credentials[0]}, + { stdinjson: credentials[0] }, ) provider.send :credentials_update_json diff --git a/spec/unit/puppet/provider/jenkins_job/cli_spec.rb b/spec/unit/puppet/provider/jenkins_job/cli_spec.rb index dfc33d874..aca625cb2 100644 --- a/spec/unit/puppet/provider/jenkins_job/cli_spec.rb +++ b/spec/unit/puppet/provider/jenkins_job/cli_spec.rb @@ -140,7 +140,7 @@ it do expect(described_class).to receive(:cli).with( ['list-jobs'], - {catalog: nil} + { catalog: nil } ) { list_jobs_output } ret = described_class.send :list_jobs @@ -152,7 +152,7 @@ it do expect(described_class).to receive(:cli).with( ['get-job', 'foo'], - {catalog: nil} + { catalog: nil } ) { foo_xml } ret = described_class.send :get_job, 'foo' @@ -164,7 +164,7 @@ it do expect(described_class).to receive(:clihelper).with( ['job_enabled', 'foo'], - {catalog: nil} + { catalog: nil } ) { 'true' } ret = described_class.send :job_enabled, 'foo' @@ -181,7 +181,7 @@ expect(described_class).to receive(:cli).with( ['create-job', 'foo'], - {stdin: foo_xml} + { stdin: foo_xml } ) provider.send :create_job @@ -197,7 +197,7 @@ expect(described_class).to receive(:cli).with( ['update-job', 'foo'], - {stdin: foo_xml} + { stdin: foo_xml } ) provider.send :update_job diff --git a/spec/unit/puppet/provider/jenkins_security_realm/cli_spec.rb b/spec/unit/puppet/provider/jenkins_security_realm/cli_spec.rb index 6db7719da..320f2f7e2 100644 --- a/spec/unit/puppet/provider/jenkins_security_realm/cli_spec.rb +++ b/spec/unit/puppet/provider/jenkins_security_realm/cli_spec.rb @@ -131,7 +131,7 @@ it do expect(described_class).to receive(:clihelper).with( ['get_security_realm'], - {catalog: nil} + { catalog: nil } ) { realm_oauth_json } raw = described_class.send :get_security_realm diff --git a/spec/unit/puppet/x/jenkins/provider/cli_spec.rb b/spec/unit/puppet/x/jenkins/provider/cli_spec.rb index 257f88566..059fccfaa 100644 --- a/spec/unit/puppet/x/jenkins/provider/cli_spec.rb +++ b/spec/unit/puppet/x/jenkins/provider/cli_spec.rb @@ -80,7 +80,7 @@ expect(described_class).to receive(:instances). with(catalog) { [provider] } - described_class.prefetch({resource.name => resource}) + described_class.prefetch({ resource.name => resource }) expect(resource.provider).to eq provider end @@ -95,7 +95,7 @@ expect(described_class).to receive(:instances). with(catalog) { [provider] } - described_class.prefetch({resource.name => resource}) + described_class.prefetch({ resource.name => resource }) expect(resource.provider).to eq provider end @@ -344,7 +344,7 @@ it 'uses catalog values' do expect(described_class.superclass).to receive(:execute).with( 'java -jar cat.jar -s http://localhost:111 foo', - { failonfail: true, combine: true} + { failonfail: true, combine: true } ) described_class.cli('foo', { catalog: catalog })