Skip to content

Commit

Permalink
Use RuboCop RSpec 2.27
Browse files Browse the repository at this point in the history
  • Loading branch information
koic committed Mar 1, 2024
1 parent 08ac312 commit 9ba15dd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -10,7 +10,7 @@ gem 'bump', require: false
gem 'rake'
gem 'rspec'
gem 'rubocop', github: 'rubocop/rubocop'
gem 'rubocop-rspec', '~> 2.26.0'
gem 'rubocop-rspec', '~> 2.27.0'
gem 'simplecov'
gem 'test-queue'
gem 'yard', '~> 0.9'
Expand Down
Expand Up @@ -2,7 +2,7 @@

RSpec.describe RuboCop::Cop::Performance::RedundantEqualityComparisonBlock, :config do
context 'when TargetRubyVersion >= 2.5', :ruby25 do
RuboCop::Cop::Performance::RedundantEqualityComparisonBlock::TARGET_METHODS.each do |method_name|
described_class::TARGET_METHODS.each do |method_name|
it "registers and corrects an offense when using `#{method_name}` with `===` comparison block" do
expect_offense(<<~RUBY, method_name: method_name)
items.#{method_name} { |item| pattern === item }
Expand Down
10 changes: 5 additions & 5 deletions spec/rubocop/cop/performance/string_identifier_argument_spec.rb
@@ -1,8 +1,8 @@
# frozen_string_literal: true

RSpec.describe RuboCop::Cop::Performance::StringIdentifierArgument, :config do
RuboCop::Cop::Performance::StringIdentifierArgument::RESTRICT_ON_SEND.each do |method|
if method == RuboCop::Cop::Performance::StringIdentifierArgument::TWO_ARGUMENTS_METHOD
described_class::RESTRICT_ON_SEND.each do |method|
if method == described_class::TWO_ARGUMENTS_METHOD
it 'registers an offense when using string two arguments for `alias_method`' do
expect_offense(<<~RUBY)
alias_method 'new', 'original'
Expand Down Expand Up @@ -44,7 +44,7 @@
RUBY
end

if RuboCop::Cop::Performance::StringIdentifierArgument::INTERPOLATION_IGNORE_METHODS.include?(method)
if described_class::INTERPOLATION_IGNORE_METHODS.include?(method)
it 'does not register an offense when using string interpolation for `#{method}` method' do
# NOTE: These methods don't support `::` when passing a symbol. const_get('A::B') is valid
# but const_get(:'A::B') isn't. Since interpolated arguments may contain any content these
Expand All @@ -68,7 +68,7 @@
end
end

RuboCop::Cop::Performance::StringIdentifierArgument::MULTIPLE_ARGUMENTS_METHODS.each do |method|
described_class::MULTIPLE_ARGUMENTS_METHODS.each do |method|
it "registers an offense when using string multiple arguments for `#{method}` method" do
expect_offense(<<~RUBY, method: method)
#{method} 'one', 'two', 'three'
Expand All @@ -89,7 +89,7 @@
end
end

RuboCop::Cop::Performance::StringIdentifierArgument::COMMAND_METHODS.each do |method|
described_class::COMMAND_METHODS.each do |method|
it "does not register an offense when using string argument for `#{method}` method with receiver" do
expect_no_offenses(<<~RUBY)
obj.#{method}('do_something')
Expand Down

0 comments on commit 9ba15dd

Please sign in to comment.