Skip to content

Commit efd8764

Browse files
committed
Pet rubocop
1 parent 1148d76 commit efd8764

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

lib/puppet/util/puppetdb_validator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,6 @@ def attempt_connection
6363
end
6464
rescue StandardError => e
6565
log_error(e.message)
66-
return false
66+
false
6767
end
6868
end

spec/acceptance/basic_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# No point diagnosing any more if the module wasn't copied properly
88
shell('ls /etc/puppetlabs/code/modules/puppetdb') do |r|
99
r.exit_code.should be_zero
10-
r.stdout.should =~ %r{metadata\.json}
10+
r.stdout.should include('metadata.json')
1111
r.stderr.should == ''
1212
end
1313
end

spec/spec_helper_acceptance.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def build_url(platform)
6060
end
6161

6262
hosts.each do |host|
63-
if host['platform'] =~ %r{debian}
63+
if %r{debian}.match?(host['platform'])
6464
on host, 'echo \'export PATH=/var/lib/gems/1.8/bin/:${PATH}\' >> ~/.bashrc'
6565
end
6666
# install_puppet
@@ -81,7 +81,7 @@ def build_url(platform)
8181
relver = Regexp.last_match(1)
8282
on host, "rpm -ivh #{build_url('fedora')}#{relver}.noarch.rpm"
8383
on host, 'yum install -y puppetserver'
84-
elsif host['platform'] =~ %r{(ubuntu|debian)}
84+
elsif %r{(ubuntu|debian)}.match?(host['platform'])
8585
unless host.check_for_package 'curl'
8686
on host, 'apt-get install -y curl'
8787
end
@@ -121,15 +121,15 @@ def build_url(platform)
121121
'puppet7'
122122
end
123123
install_puppet_agent_on(hosts, opts) unless ENV['BEAKER_provision'] == 'no'
124-
install_ca_certs unless ENV['PUPPET_INSTALL_TYPE'] =~ %r{pe}i
124+
install_ca_certs unless %r{pe}i.match?(ENV['PUPPET_INSTALL_TYPE'])
125125
install_module_on(hosts)
126126
install_module_dependencies_on(hosts)
127127

128128
RSpec.configure do |c|
129129
# Readable test descriptions
130130
c.formatter = :documentation
131131
hosts.each do |host|
132-
if host[:platform] =~ %r{el-7-x86_64} && host[:hypervisor] =~ %r{docker}
132+
if host[:platform].include('el-7-x86_64') && host[:hypervisor].include('docker')
133133
on(host, "sed -i '/nodocs/d' /etc/yum.conf")
134134
end
135135
end

0 commit comments

Comments
 (0)