Skip to content

Commit

Permalink
Fix new RuboCop warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobEvelyn committed Jun 10, 2024
1 parent 4bbb254 commit 320c1d6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion benchmarks/benchmarks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def benchmark_name

# Use metaprogramming to ensure that each class is created in exactly the
# the same way.
BENCHMARK_GEMS.each do |benchmark_gem|
BENCHMARK_GEMS.each do |benchmark_gem| # rubocop:disable Metrics/BlockLength
eval <<~HEREDOC, binding, __FILE__, __LINE__ + 1 # rubocop:disable Security/Eval
class #{benchmark_gem.klass}Example
#{benchmark_gem.activation_code}
Expand Down
2 changes: 1 addition & 1 deletion spec/dokaz_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
require "memo_wise"

# Enable the example RSpec `after` call in README.md to execute successfully
def after(scope, &)
def after(scope, &block)
# Do nothing
end
22 changes: 11 additions & 11 deletions spec/memo_wise_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@
expect(target.proc_method_counter).to eq(1)
end

it "will not memoize methods with implicit block arguments" do
it "does not memoize methods with implicit block arguments" do
expect { target.implicit_block_method }.to raise_error(LocalJumpError)
end

it "will not memoize methods with explicit block arguments" do
it "does not memoize methods with explicit block arguments" do
expect { target.explicit_block_method { nil } }.to raise_error(LocalJumpError)
end
end
Expand All @@ -153,7 +153,7 @@

# Now confirm our non-memoized method is not memoized.
expect(Array.new(4) { non_memoized.no_args }).to all eq("#{non_memoized_name}_no_args")
expect(non_memoized.send("#{non_memoized_name}_no_args_counter")).to eq(4)
expect(non_memoized.send(:"#{non_memoized_name}_no_args_counter")).to eq(4)
end
end

Expand All @@ -167,7 +167,7 @@
expect(Array.new(4) { non_memoized.with_one_positional_arg(1) }).
to all eq("#{non_memoized_name}_with_one_positional_arg: a=1")

expect(non_memoized.send("#{non_memoized_name}_one_positional_arg_counter")).to eq(4)
expect(non_memoized.send(:"#{non_memoized_name}_one_positional_arg_counter")).to eq(4)
end
end

Expand All @@ -181,7 +181,7 @@
expect(Array.new(4) { non_memoized.with_positional_args(1, 2) }).
to all eq("#{non_memoized_name}_with_positional_args: a=1, b=2")

expect(non_memoized.send("#{non_memoized_name}_positional_args_counter")).to eq(4)
expect(non_memoized.send(:"#{non_memoized_name}_positional_args_counter")).to eq(4)
end
end
end
Expand Down Expand Up @@ -884,8 +884,8 @@ def no_args_counter
end

it "doesn't define #inherited" do
expect(klass).to be_respond_to(:inherited)
expect(klass.new).to_not be_respond_to(:inherited)
expect(klass).to respond_to(:inherited)
expect(klass.new).to_not respond_to(:inherited)
end
end

Expand Down Expand Up @@ -921,8 +921,8 @@ def no_args_counter
end

it "doesn't define #inherited" do
expect(klass).to be_respond_to(:inherited)
expect(klass.new).to_not be_respond_to(:inherited)
expect(klass).to respond_to(:inherited)
expect(klass.new).to_not respond_to(:inherited)
end
end

Expand Down Expand Up @@ -960,8 +960,8 @@ def no_args_counter
end

it "doesn't define #inherited" do
expect(klass).to be_respond_to(:inherited)
expect(klass.new).to_not be_respond_to(:inherited)
expect(klass).to respond_to(:inherited)
expect(klass.new).to_not respond_to(:inherited)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/support/define_methods_for_testing_memo_wise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def self.define_methods_for_testing_memo_wise(target:, via:)

# :nocov:
raise ArgumentError, "Not a Class or Module: #{target.inspect}" unless target.is_a?(Module)
raise ArgumentError, "Unknown value for 'via': #{via}" unless %i[instance self_dot].include?(via) # rubocop:disable Layout/EmptyLineAfterGuardClause
raise ArgumentError, "Unknown value for 'via': #{via}" unless %i[instance self_dot].include?(via)
# :nocov:

self_prefix = via == :self_dot ? "self." : ""
Expand Down

0 comments on commit 320c1d6

Please sign in to comment.