You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
diff --git a/spec/rubocop/cop/rspec/example_wording_spec.rb b/spec/rubocop/cop/rspec/example_wording_spec.rb
index 100ae719..ae83c6ac 100644
--- a/spec/rubocop/cop/rspec/example_wording_spec.rb+++ b/spec/rubocop/cop/rspec/example_wording_spec.rb@@ -351,5 +351,18 @@ RSpec.describe RuboCop::Cop::RSpec::ExampleWording do
end
RUBY
end
++ it 'keeps escaped single-quote after autocorrection' do+ expect_offense(<<~'RUBY')+ it 'should return foo\'s bar' do+ ^^^^^^^^^^^^^^^^^^^^^^^^ Do not use should when describing your tests.+ end+ RUBY++ expect_correction(<<~'RUBY')+ it 'returns foo\'s bar' do+ end+ RUBY+ end
end
end
Failures:
1) RuboCop::Cop::RSpec::ExampleWording when `DisallowedExamples: Workz` keeps escaped single-quote after autocorrection
Failure/Error:
expect_correction(<<~'RUBY')
it 'returns foo\'s bar' do
end
RUBY
expected: "it 'returns foo\\'s bar' do\nend\n"
got: "it 'returns foo's bar' do\nend\n"
(compared using ==)
Diff:
@@ -1 +1 @@
-it 'returns foo\'s bar' do
+it 'returns foo's bar' do
# ./spec/rubocop/cop/rspec/example_wording_spec.rb:362:in `block (3 levels) in <top (required)>'
Since this cop supports not only str but also dstr, it would be difficult to simply fix it with String#inspect 🤔
The text was updated successfully, but these errors were encountered:
I noticed that it autocorrects as follows, which causes syntax error:
This can be confirmed by the following test code.
Since this cop supports not only
str
but alsodstr
, it would be difficult to simply fix it withString#inspect
🤔The text was updated successfully, but these errors were encountered: