Skip to content

Commit d912a64

Browse files
committed
Use interpolation in code samples
1 parent f78531e commit d912a64

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

spec/rubocop/cop/rails/helper_instance_variable_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
subject(:cop) { described_class.new }
55

66
it 'reports uses of instance variables' do
7-
expect_offense(<<-RUBY.strip_indent)
7+
expect_offense(<<-'RUBY'.strip_indent)
88
def welcome_message
9-
"Hello" + @user.name
10-
^^^^^ Do not use instance variables in helpers.
9+
"Hello #{@user.name}"
10+
^^^^^ Do not use instance variables in helpers.
1111
end
1212
RUBY
1313
end
@@ -22,9 +22,9 @@ def welcome_message(user)
2222
end
2323

2424
specify do
25-
expect_no_offenses(<<-RUBY.strip_indent)
25+
expect_no_offenses(<<-'RUBY'.strip_indent)
2626
def welcome_message(user)
27-
"Hello " + user.name
27+
"Hello #{user.name}"
2828
end
2929
RUBY
3030
end

0 commit comments

Comments
 (0)