Skip to content

Commit df1fa3d

Browse files
authored
Merge pull request #1095 from rubocop-hq/quotes
Add some consistency around formatting of literal strings
2 parents cecc4b3 + 4995bd2 commit df1fa3d

18 files changed

+35
-39
lines changed

lib/rubocop/cop/rspec/around_block.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module RSpec
2727
# end
2828
class AroundBlock < Base
2929
MSG_NO_ARG = 'Test object should be passed to around block.'
30-
MSG_UNUSED_ARG = 'You should call `%<arg>s.call` '\
30+
MSG_UNUSED_ARG = 'You should call `%<arg>s.call` ' \
3131
'or `%<arg>s.run`.'
3232

3333
def_node_matcher :hook, <<-PATTERN

lib/rubocop/cop/rspec/be.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module RSpec
2020
# expect(foo).to be(true)
2121
#
2222
class Be < Base
23-
MSG = 'Don\'t use `be` without an argument.'
23+
MSG = "Don't use `be` without an argument."
2424

2525
def_node_matcher :be_without_args, <<-PATTERN
2626
(send _ #Runners.all $(send nil? :be))

lib/rubocop/cop/rspec/before_after_all.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ module RSpec
2424
# after(:each) { Widget.delete_all }
2525
# end
2626
class BeforeAfterAll < Base
27-
MSG = 'Beware of using `%<hook>s` as it may cause state to leak '\
28-
'between tests. If you are using `rspec-rails`, and '\
29-
'`use_transactional_fixtures` is enabled, then records created '\
27+
MSG = 'Beware of using `%<hook>s` as it may cause state to leak ' \
28+
'between tests. If you are using `rspec-rails`, and ' \
29+
'`use_transactional_fixtures` is enabled, then records created ' \
3030
'in `%<hook>s` are not automatically rolled back.'
3131

3232
def_node_matcher :before_or_after_all, <<-PATTERN

lib/rubocop/cop/rspec/describe_class.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module RSpec
3737
class DescribeClass < Base
3838
include TopLevelGroup
3939

40-
MSG = 'The first argument to describe should be '\
40+
MSG = 'The first argument to describe should be ' \
4141
'the class or module being tested.'
4242

4343
def_node_matcher :example_group_with_ignored_metadata?, <<~PATTERN

lib/rubocop/cop/rspec/describe_method.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module RSpec
1919
class DescribeMethod < Base
2020
include TopLevelGroup
2121

22-
MSG = 'The second argument to describe should be the method '\
22+
MSG = 'The second argument to describe should be the method ' \
2323
"being tested. '#instance' or '.class'."
2424

2525
def_node_matcher :second_argument, <<~PATTERN

lib/rubocop/cop/rspec/expect_output.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module RSpec
1515
# # good
1616
# expect { my_app.print_report }.to output('Hello World').to_stdout
1717
class ExpectOutput < Base
18-
MSG = 'Use `expect { ... }.to output(...).to_%<name>s` '\
18+
MSG = 'Use `expect { ... }.to output(...).to_%<name>s` ' \
1919
'instead of mutating $%<name>s.'
2020

2121
def on_gvasgn(node)

lib/rubocop/cop/rspec/instance_spy.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module RSpec
2121
class InstanceSpy < Base
2222
extend AutoCorrector
2323

24-
MSG = 'Use `instance_spy` when you check your double '\
24+
MSG = 'Use `instance_spy` when you check your double ' \
2525
'with `have_received`.'
2626

2727
def_node_search :null_double, <<-PATTERN

lib/rubocop/cop/rspec/it_behaves_like.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class ItBehavesLike < Base
2222
extend AutoCorrector
2323
include ConfigurableEnforcedStyle
2424

25-
MSG = 'Prefer `%<replacement>s` over `%<original>s` when including '\
25+
MSG = 'Prefer `%<replacement>s` over `%<original>s` when including ' \
2626
'examples in a nested context.'
2727

2828
def_node_matcher :example_inclusion_offense, '(send _ % ...)'

lib/rubocop/cop/rspec/iterated_expectation.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module RSpec
1717
# end
1818
class IteratedExpectation < Base
1919
MSG = 'Prefer using the `all` matcher instead ' \
20-
'of iterating over an array.'
20+
'of iterating over an array.'
2121

2222
def_node_matcher :each?, <<-PATTERN
2323
(block

lib/rubocop/cop/rspec/message_spies.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ class MessageSpies < Base
2929

3030
MSG_RECEIVE = 'Prefer `receive` for setting message expectations.'
3131

32-
MSG_HAVE_RECEIVED = 'Prefer `have_received` for setting message '\
33-
'expectations. Setup `%<source>s` as a spy using '\
32+
MSG_HAVE_RECEIVED = 'Prefer `have_received` for setting message ' \
33+
'expectations. Setup `%<source>s` as a spy using ' \
3434
'`allow` or `instance_spy`.'
3535

3636
SUPPORTED_STYLES = %w[have_received receive].freeze

0 commit comments

Comments
 (0)