Skip to content

Commit

Permalink
Merge pull request #95 from mvz/update-rubocop-performance
Browse files Browse the repository at this point in the history
Update rubocop-performance and fix new offenses
  • Loading branch information
mvz authored Dec 23, 2023
2 parents 0be6e9e + 4111a9f commit 9b963f5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion live_ast.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "rubocop", "~> 1.51"
spec.add_development_dependency "rubocop-minitest", "~> 0.33.0"
spec.add_development_dependency "rubocop-packaging", "~> 0.5.2"
spec.add_development_dependency "rubocop-performance", "~> 1.18"
spec.add_development_dependency "rubocop-performance", "~> 1.20"
spec.add_development_dependency "rubocop-rake", "~> 0.6.0"
end
8 changes: 4 additions & 4 deletions test/encoding_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ class AllEncodingTest < RegularTest
}.freeze

ENC_TESTS.each_pair do |abbr, name|
define_method "test_#{abbr}" do
define_method :"test_#{abbr}" do
require_relative "encoding_test/#{abbr}"
self.class.class_eval { include EncodingTest }

str = send("#{abbr}_string")
str = send(:"#{abbr}_string")

assert_equal name, str.encoding.to_s

ast = EncodingTest.instance_method("#{abbr}_string").to_ast
ast = EncodingTest.instance_method(:"#{abbr}_string").to_ast

assert_equal "UTF-8", no_arg_def_return(ast).encoding.to_s

LiveAST.load "./test/encoding_test/#{abbr}.rb"

ast = EncodingTest.instance_method("#{abbr}_string").to_ast
ast = EncodingTest.instance_method(:"#{abbr}_string").to_ast

assert_equal "UTF-8", no_arg_def_return(ast).encoding.to_s
end
Expand Down
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def assert_nothing_raised
empty equal in_delta in_epsilon includes instance_of
kind_of match nil operator respond_to same
).each { |name|
alias_method "assert_not_#{name}", "refute_#{name}"
alias_method :"assert_not_#{name}", "refute_#{name}"
}
end

Expand Down

0 comments on commit 9b963f5

Please sign in to comment.