Skip to content

Commit 2f6d6b7

Browse files
committed
Fix FrozenError for save_bang_spec.rb
Follow ruby/ruby#2437. This PR fixes the following `FrozenError` for save_bang_spec.rb ```Failures: % ruby -v ruby 2.7.0dev (2019-10-09T16:08:42Z master 42edb05626) [x86_64-darwin17] % bundle exec rspec ./spec/rubocop/cop/rails/save_bang_spec.rb (snip) 1) RuboCop::Cop::Rails::SaveBang update behaves like checks_common_offense when using update without arguments Failure/Error: inspect_source(method.to_s) FrozenError: can't modify frozen String: "update" Shared Example Group: "checks_common_offense" called from ./spec/rubocop/cop/rails/save_bang_spec.rb:541 # ./spec/rubocop/cop/rails/save_bang_spec.rb:58:in `block (3 levels) in <top (required)>' ```
1 parent 80fcf14 commit 2f6d6b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spec/rubocop/cop/rails/save_bang_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
end
5656

5757
it "when using #{method} without arguments" do
58-
inspect_source(method.to_s)
58+
inspect_source(+method.to_s)
5959

6060
expect(cop.messages)
6161
.to eq(["Use `#{method}!` instead of `#{method}` " \

0 commit comments

Comments
 (0)