Skip to content

Commit

Permalink
Rubocop: Fix Layout/SpaceInsideHashLiteralBraces
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjfisher committed Jan 31, 2018
1 parent 40819e6 commit b9f095c
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 54 deletions.
2 changes: 1 addition & 1 deletion lib/puppet/jenkins/okjson.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion spec/classes/jenkins_cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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') }
Expand Down
10 changes: 5 additions & 5 deletions spec/classes/jenkins_slave_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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" }
Expand Down
6 changes: 3 additions & 3 deletions spec/defines/jenkins_plugin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions spec/unit/facter/plugins_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
58 changes: 29 additions & 29 deletions spec/unit/jenkins_plugins_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href='http://git-scm.com/'>Git</a> as a build SCM. A recent Git runtime is required (1.7.9 minimum, 1.8.x recommended). Plugin is only tested on official <a href='http://git-scm.com/'>git client</a>. 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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/puppet/provider/jenkins_credentials/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions spec/unit/puppet/provider/jenkins_job/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
Expand All @@ -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'
Expand All @@ -181,7 +181,7 @@

expect(described_class).to receive(:cli).with(
['create-job', 'foo'],
{stdin: foo_xml}
{ stdin: foo_xml }
)

provider.send :create_job
Expand All @@ -197,7 +197,7 @@

expect(described_class).to receive(:cli).with(
['update-job', 'foo'],
{stdin: foo_xml}
{ stdin: foo_xml }
)

provider.send :update_job
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions spec/unit/puppet/x/jenkins/provider/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 })
Expand Down

0 comments on commit b9f095c

Please sign in to comment.