Skip to content

Commit 6125526

Browse files
SHinGo-Kobapirj
authored andcommitted
fixed Style/RedundantRegexpEscape
1 parent c5fbfce commit 6125526

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

example_app_generator/generate_app.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# Remove the existing rails version so we can properly use main or other
1919
# edge branches
2020
gsub_file 'Gemfile', /^.*\bgem ['"]rails.*$/, ''
21-
gsub_file 'Gemfile', /^.*\bgem ['"]selenium\-webdriver.*$/, ''
21+
gsub_file 'Gemfile', /^.*\bgem ['"]selenium-webdriver.*$/, ''
2222
gsub_file "Gemfile", /.*web-console.*/, ''
2323
gsub_file "Gemfile", /.*debug.*/, ''
2424
gsub_file "Gemfile", /.*puma.*/, ''

spec/generators/rspec/feature/feature_generator_spec.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
expect(feature_spec).to contain(/require 'rails_helper'/)
2020
end
2121
it "contains the feature" do
22-
expect(feature_spec).to contain(/^RSpec.feature \"Posts\", #{type_metatag(:feature)}/)
22+
expect(feature_spec).to contain(/^RSpec.feature "Posts", #{type_metatag(:feature)}/)
2323
end
2424
end
2525
end
@@ -34,7 +34,7 @@
3434
expect(feature_spec).to exist
3535
end
3636
it "contains the feature" do
37-
expect(feature_spec).to contain(/^RSpec.feature \"Folder::Posts\", #{type_metatag(:feature)}/)
37+
expect(feature_spec).to contain(/^RSpec.feature "Folder::Posts", #{type_metatag(:feature)}/)
3838
end
3939
end
4040
end
@@ -49,7 +49,7 @@
4949
expect(feature_spec).to exist
5050
end
5151
it "contains the singularized feature" do
52-
expect(feature_spec).to contain(/^RSpec.feature \"Post\", #{type_metatag(:feature)}/)
52+
expect(feature_spec).to contain(/^RSpec.feature "Post", #{type_metatag(:feature)}/)
5353
end
5454
end
5555
end

spec/generators/rspec/generator/generator_generator_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
expect(generator_spec).to contain(/require 'rails_helper'/)
1717
end
1818
it "includes the generator type in the metadata" do
19-
expect(generator_spec).to contain(/^RSpec.describe \"Posts\", #{type_metatag(:generator)}/)
19+
expect(generator_spec).to contain(/^RSpec.describe "Posts", #{type_metatag(:generator)}/)
2020
end
2121
end
2222
end

spec/generators/rspec/system/system_generator_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
expect(system_spec).to contain(/require 'rails_helper'/)
2020
end
2121
it "contains the system" do
22-
expect(system_spec).to contain(/^RSpec.describe \"Posts\", #{type_metatag(:system)}/)
22+
expect(system_spec).to contain(/^RSpec.describe "Posts", #{type_metatag(:system)}/)
2323
end
2424
end
2525
end

spec/generators/rspec/view/view_generator_spec.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
run_generator %w[posts index]
1111
file('spec/views/posts/index.html.erb_spec.rb').tap do |f|
1212
expect(f).to contain(/require 'rails_helper'/)
13-
expect(f).to contain(/^RSpec.describe \"posts\/index\", #{type_metatag(:view)}/)
13+
expect(f).to contain(/^RSpec.describe "posts\/index", #{type_metatag(:view)}/)
1414
end
1515
end
1616

@@ -19,7 +19,7 @@
1919
run_generator %w[admin/posts index]
2020
file('spec/views/admin/posts/index.html.erb_spec.rb').tap do |f|
2121
expect(f).to contain(/require 'rails_helper'/)
22-
expect(f).to contain(/^RSpec.describe \"admin\/posts\/index\", #{type_metatag(:view)}/)
22+
expect(f).to contain(/^RSpec.describe "admin\/posts\/index", #{type_metatag(:view)}/)
2323
end
2424
end
2525
end
@@ -30,7 +30,7 @@
3030
run_generator %w[posts index --template_engine haml]
3131
file('spec/views/posts/index.html.haml_spec.rb').tap do |f|
3232
expect(f).to contain(/require 'rails_helper'/)
33-
expect(f).to contain(/^RSpec.describe \"posts\/index\", #{type_metatag(:view)}/)
33+
expect(f).to contain(/^RSpec.describe "posts\/index", #{type_metatag(:view)}/)
3434
end
3535
end
3636
end

spec/rspec/rails/matchers/action_cable/have_stream_spec.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def subscribed
9898

9999
expect {
100100
expect(subscription).to have_stream_from("chat_2")
101-
}.to raise_error(/expected to have stream "chat_2" started, but have \[\"chat_1\"\]/)
101+
}.to raise_error(/expected to have stream "chat_2" started, but have \["chat_1"\]/)
102102
end
103103

104104
context "with negated form" do
@@ -113,7 +113,7 @@ def subscribed
113113

114114
expect {
115115
expect(subscription).not_to have_stream_from("chat_1")
116-
}.to raise_error(/expected not to have stream "chat_1" started, but have \[\"chat_1\"\]/)
116+
}.to raise_error(/expected not to have stream "chat_1" started, but have \["chat_1"\]/)
117117
end
118118
end
119119

@@ -129,7 +129,7 @@ def subscribed
129129

130130
expect {
131131
expect(subscription).to have_stream_from(a_string_starting_with("room"))
132-
}.to raise_error(/expected to have stream a string starting with "room" started, but have \[\"chat_1\"\]/)
132+
}.to raise_error(/expected to have stream a string starting with "room" started, but have \["chat_1"\]/)
133133
end
134134
end
135135
end
@@ -160,7 +160,7 @@ def subscribed
160160

161161
expect {
162162
expect(subscription).to have_stream_for(StreamModel.new(31_337))
163-
}.to raise_error(/expected to have stream "broadcast:StreamModel#31337" started, but have \[\"broadcast:StreamModel#42\"\]/)
163+
}.to raise_error(/expected to have stream "broadcast:StreamModel#31337" started, but have \["broadcast:StreamModel#42"\]/)
164164
end
165165

166166
context "with negated form" do
@@ -175,7 +175,7 @@ def subscribed
175175

176176
expect {
177177
expect(subscription).not_to have_stream_for(StreamModel.new(42))
178-
}.to raise_error(/expected not to have stream "broadcast:StreamModel#42" started, but have \[\"broadcast:StreamModel#42\"\]/)
178+
}.to raise_error(/expected not to have stream "broadcast:StreamModel#42" started, but have \["broadcast:StreamModel#42"\]/)
179179
end
180180
end
181181
end

spec/support/generators.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def self.included(klass)
7373
it "the generator describes the provided NAME without monkey " \
7474
"patching setting the type to `:request`" do
7575
expect(request_spec).to contain(
76-
/^RSpec.describe \"Posts\", #{type_metatag(:request)}/
76+
/^RSpec.describe "Posts", #{type_metatag(:request)}/
7777
)
7878
end
7979

@@ -101,12 +101,12 @@ def self.included(klass)
101101
it "the generator describes the provided NAME without monkey " \
102102
"patching setting the type to `:request`" do
103103
expect(request_spec).to contain(
104-
/^RSpec.describe \"Api::Posts\", #{type_metatag(:request)}/
104+
/^RSpec.describe "Api::Posts", #{type_metatag(:request)}/
105105
)
106106
end
107107

108108
it "the generator includes a sample GET request" do
109-
expect(request_spec).to contain(/describe "GET \/api\/posts\"/)
109+
expect(request_spec).to contain(/describe "GET \/api\/posts"/)
110110
end
111111

112112
it "the generator sends the GET request to the index path" do

0 commit comments

Comments
 (0)