Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update rubocop-performance and fix new offenses #95

Merged
merged 2 commits into from
Dec 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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