Skip to content

Commit 6205628

Browse files
author
jordanbreen28
committed
(CONT-802) - Style/RedundantRegexpEscape
1 parent 54e8af2 commit 6205628

File tree

4 files changed

+16
-29
lines changed

4 files changed

+16
-29
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,6 @@ RSpec/RepeatedExampleGroupBody:
2222
Exclude:
2323
- 'spec/defines/config/server/realm_spec.rb'
2424

25-
# # Offense count: 1
26-
# Style/MixinUsage:
27-
# Exclude:
28-
# - 'spec/spec_helper.rb'
29-
30-
# Offense count: 22
31-
# This cop supports safe autocorrection (--autocorrect).
32-
Style/RedundantRegexpEscape:
33-
Exclude:
34-
- 'spec/acceptance/acceptance_3b_spec.rb'
35-
- 'spec/acceptance/acceptance_4b_spec.rb'
36-
- 'spec/defines/setenv/entry_spec.rb'
37-
3825
# Offense count: 1
3926
# This cop supports safe autocorrection (--autocorrect).
4027
# Configuration parameters: EnforcedStyle.

spec/acceptance/acceptance_3b_spec.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ class { 'tomcat':
169169

170170
it 'shoud have a service named FooBar and a class names FooBar' do
171171
run_shell('cat /opt/apache-tomcat8/tomcat8/conf/server.xml') do |r|
172-
expect(r.stdout).to match(%r{<Service name="org.apache.catalina.core.StandardService" className="org.apache.catalina.core.StandardService"><\/Service>})
172+
expect(r.stdout).to match(%r{<Service name="org.apache.catalina.core.StandardService" className="org.apache.catalina.core.StandardService"></Service>})
173173
end
174174
end
175175
end
@@ -187,7 +187,7 @@ class { 'tomcat':
187187

188188
it 'has changed the conf.xml file' do
189189
run_shell('cat /opt/apache-tomcat8/tomcat8/conf/server.xml') do |r|
190-
expect(r.stdout).to match(%r{<Valve className="org.apache.catalina.valves.AccessLogValve"><\/Valve>})
190+
expect(r.stdout).to match(%r{<Valve className="org.apache.catalina.valves.AccessLogValve"></Valve>})
191191
end
192192
end
193193
end
@@ -206,7 +206,7 @@ class { 'tomcat':
206206

207207
it 'has changed the conf.xml file' do
208208
run_shell('cat /opt/apache-tomcat8/tomcat8/conf/server.xml') do |r|
209-
expect(r.stdout).not_to match(%r{<Valve className="org.apache.catalina.valves.AccessLogValve"><\/Valve>})
209+
expect(r.stdout).not_to match(%r{<Valve className="org.apache.catalina.valves.AccessLogValve"></Valve>})
210210
end
211211
end
212212
end
@@ -321,7 +321,7 @@ class { 'tomcat':
321321

322322
it 'has changed the context.xml file' do
323323
run_shell('cat /opt/apache-tomcat8/tomcat8/conf/context.xml') do |r|
324-
expect(r.stdout).to match(%r{<Environment name="testEnvVar" type="java.lang.String" value="a value with a space"><\/Environment>})
324+
expect(r.stdout).to match(%r{<Environment name="testEnvVar" type="java.lang.String" value="a value with a space"></Environment>})
325325
end
326326
end
327327
end
@@ -344,7 +344,7 @@ class { 'tomcat':
344344

345345
it 'has changed the context.xml file' do
346346
run_shell('cat /opt/apache-tomcat8/tomcat8/conf/context.xml') do |r|
347-
expect(r.stdout).to match(%r{<Valve className="org.apache.catalina.valves.AccessLogValve".*><\/Valve>})
347+
expect(r.stdout).to match(%r{<Valve className="org.apache.catalina.valves.AccessLogValve".*></Valve>})
348348
end
349349
end
350350
end
@@ -384,8 +384,8 @@ class { 'tomcat':
384384

385385
it 'has changed the context.xml file' do
386386
run_shell('cat /opt/apache-tomcat8/tomcat8/conf/context.xml') do |r|
387-
expect(r.stdout).to match(%r{<Valve className="org.apache.catalina.valves.AccessLogValve".*prefix="localhost_access_log".*><\/Valve>})
388-
expect(r.stdout).to match(%r{<Valve className="org.apache.catalina.valves.AccessLogValve".*prefix="localhost_access_log_rare".*><\/Valve>})
387+
expect(r.stdout).to match(%r{<Valve className="org.apache.catalina.valves.AccessLogValve".*prefix="localhost_access_log".*></Valve>})
388+
expect(r.stdout).to match(%r{<Valve className="org.apache.catalina.valves.AccessLogValve".*prefix="localhost_access_log_rare".*></Valve>})
389389
end
390390
end
391391
end
@@ -408,7 +408,7 @@ class { 'tomcat':
408408

409409
it 'has changed the context.xml file' do
410410
run_shell('cat /opt/apache-tomcat8/tomcat8/conf/context.xml') do |r|
411-
expect(r.stdout).to match(%r{<Valve className="org.apache.catalina.valves.AccessLogValve".*name="testValve".*><\/Valve>})
411+
expect(r.stdout).to match(%r{<Valve className="org.apache.catalina.valves.AccessLogValve".*name="testValve".*></Valve>})
412412
end
413413
end
414414
end
@@ -440,8 +440,8 @@ class { 'tomcat':
440440

441441
it 'has changed the context.xml file' do
442442
run_shell('cat /opt/apache-tomcat8/tomcat8/conf/context.xml') do |r|
443-
expect(r.stdout).to match(%r{<Valve className="org.apache.catalina.valves.AccessLogValve".*name="testValve".*><\/Valve>})
444-
expect(r.stdout).to match(%r{<Valve className="org.apache.catalina.valves.AccessLogValve".*name="testValve2".*><\/Valve>})
443+
expect(r.stdout).to match(%r{<Valve className="org.apache.catalina.valves.AccessLogValve".*name="testValve".*></Valve>})
444+
expect(r.stdout).to match(%r{<Valve className="org.apache.catalina.valves.AccessLogValve".*name="testValve2".*></Valve>})
445445
end
446446
end
447447
end

spec/acceptance/acceptance_4b_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ class { 'tomcat': catalina_home => '/opt/apache-tomcat40', }
8383
it 'contains two realms in config file', retry: 5, retry_wait: 10 do
8484
run_shell('cat /opt/apache-tomcat40/conf/server.xml') do |r|
8585
expect(r.stdout).to match(
86-
%r{<Realm puppetName="org.apache.catalina.realm.MyRealm1" className="org.apache.catalina.realm.MyRealm" resourceName="MyRealm1" otherAttribute="more stuff"><\/Realm>},
86+
%r{<Realm puppetName="org.apache.catalina.realm.MyRealm1" className="org.apache.catalina.realm.MyRealm" resourceName="MyRealm1" otherAttribute="more stuff"></Realm>},
8787
)
8888
expect(r.stdout).to match(
89-
%r{<Realm puppetName="org.apache.catalina.realm.MyRealm2" className="org.apache.catalina.realm.MyRealm" resourceName="MyRealm2" otherAttribute="more stuff"><\/Realm>},
89+
%r{<Realm puppetName="org.apache.catalina.realm.MyRealm2" className="org.apache.catalina.realm.MyRealm" resourceName="MyRealm2" otherAttribute="more stuff"></Realm>},
9090
)
9191
end
9292
end

spec/defines/setenv/entry_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
it { is_expected.to contain_concat('/opt/apache-tomcat/bin/setenv.sh') }
2929

3030
it {
31-
expect(subject).to contain_concat__fragment('setenv-FOO').with_content(%r{export FOO=\/bin\/true}).with('target' => '/opt/apache-tomcat/bin/setenv.sh')
31+
expect(subject).to contain_concat__fragment('setenv-FOO').with_content(%r{export FOO=/bin/true}).with('target' => '/opt/apache-tomcat/bin/setenv.sh')
3232
}
3333
end
3434

@@ -45,7 +45,7 @@
4545
it { is_expected.to contain_concat('/opt/apache-tomcat/foo/bin/setenv.sh') }
4646

4747
it {
48-
expect(subject).to contain_concat__fragment('setenv-FOO').with_content(%r{export BAR="\/bin\/true"}).with('target' => '/opt/apache-tomcat/foo/bin/setenv.sh')
48+
expect(subject).to contain_concat__fragment('setenv-FOO').with_content(%r{export BAR="/bin/true"}).with('target' => '/opt/apache-tomcat/foo/bin/setenv.sh')
4949
}
5050
end
5151

@@ -91,7 +91,7 @@
9191
it { is_expected.to contain_concat('/opt/apache-tomcat/foo/bin/setenv.sh') }
9292

9393
it {
94-
expect(subject).to contain_concat__fragment('setenv-FOO').with_content(%r{export BAR="\/bin\/true \/bin\/false"}).with('target' => '/opt/apache-tomcat/foo/bin/setenv.sh')
94+
expect(subject).to contain_concat__fragment('setenv-FOO').with_content(%r{export BAR="/bin/true /bin/false"}).with('target' => '/opt/apache-tomcat/foo/bin/setenv.sh')
9595
}
9696
end
9797

@@ -107,7 +107,7 @@
107107
it { is_expected.to contain_concat('/opt/apache-tomcat/bin/setenv.sh') }
108108

109109
it {
110-
expect(subject).to contain_concat__fragment('setenv-FOO').with_content(%r{export BAR=\/bin\/true}).with('target' => '/opt/apache-tomcat/bin/setenv.sh', 'order' => '10')
110+
expect(subject).to contain_concat__fragment('setenv-FOO').with_content(%r{export BAR=/bin/true}).with('target' => '/opt/apache-tomcat/bin/setenv.sh', 'order' => '10')
111111
}
112112
end
113113
end

0 commit comments

Comments
 (0)