Skip to content

Commit

Permalink
Update RuboCop configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepingkingstudios committed Jun 1, 2024
1 parent 4d9ffb7 commit 43eb861
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require:
- rubocop-rspec

AllCops:
TargetRubyVersion: 2.7
TargetRubyVersion: 3.1
NewCops: enable
Include:
- Gemfile
Expand Down
4 changes: 2 additions & 2 deletions lib/rspec/sleeping_king_studios/concerns/memoized_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ module MemoizedHelpers
# @param method_name [String] the name of the helper method.
#
# @yieldreturn [Object] the value of the memoized helper method.
def let?(method_name, &block)
def let?(method_name, &)
return method_name if method_defined?(method_name)

let(method_name, &block)
let(method_name, &)
end
end
end
12 changes: 6 additions & 6 deletions lib/rspec/sleeping_king_studios/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,20 +126,20 @@ def strict_predicate_matching=(value)

# Get or set the configuration options for
# RSpec::SleepingKingStudios::Examples.
def examples(&block)
def examples(&)
@examples ||= RSpec::SleepingKingStudios::Configuration::Examples.new

@examples.instance_eval(&block) if block_given?
@examples.instance_eval(&) if block_given?

@examples
end

# Get or set the configuration options for
# RSpec::SleepingKingStudios::Matchers.
def matchers(&block)
def matchers(&)
@matchers ||= RSpec::SleepingKingStudios::Configuration::Matchers.new

@matchers.instance_eval(&block) if block_given?
@matchers.instance_eval(&) if block_given?

@matchers
end
Expand All @@ -148,10 +148,10 @@ def matchers(&block)

class RSpec::Core::Configuration # rubocop:disable Style/Documentation
# Get or set the configuration options for RSpec::SleepingKingStudios.
def sleeping_king_studios(&block)
def sleeping_king_studios(&)
@sleeping_king_studios ||= RSpec::SleepingKingStudios::Configuration.new

@sleeping_king_studios.instance_eval(&block) if block_given?
@sleeping_king_studios.instance_eval(&) if block_given?

@sleeping_king_studios
end
Expand Down
20 changes: 10 additions & 10 deletions lib/rspec/sleeping_king_studios/deferred/dsl/hooks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ module Hooks
# @param block [Proc] the implementation of the hook.
#
# @return [void]
def after(scope, *flags, **conditions, &block)
def after(scope, *flags, **conditions, &)
deferred_hooks << RSpec::SleepingKingStudios::Deferred::Calls::Hook.new(
:after,
scope,
*flags,
**conditions,
&block
&
)
end

Expand All @@ -34,13 +34,13 @@ def after(scope, *flags, **conditions, &block)
# @param block [Proc] the implementation of the hook.
#
# @return [void]
def append_after(scope, *flags, **conditions, &block)
def append_after(scope, *flags, **conditions, &)
deferred_hooks << RSpec::SleepingKingStudios::Deferred::Calls::Hook.new(
:append_after,
scope,
*flags,
**conditions,
&block
&
)
end

Expand All @@ -53,13 +53,13 @@ def append_after(scope, *flags, **conditions, &block)
# @param block [Proc] the implementation of the hook.
#
# @return [void]
def around(scope, *flags, **conditions, &block)
def around(scope, *flags, **conditions, &)
deferred_hooks << RSpec::SleepingKingStudios::Deferred::Calls::Hook.new(
:around,
scope,
*flags,
**conditions,
&block
&
)
end

Expand All @@ -72,13 +72,13 @@ def around(scope, *flags, **conditions, &block)
# @param block [Proc] the implementation of the hook.
#
# @return [void]
def before(scope, *flags, **conditions, &block)
def before(scope, *flags, **conditions, &)
deferred_hooks << RSpec::SleepingKingStudios::Deferred::Calls::Hook.new(
:before,
scope,
*flags,
**conditions,
&block
&
)
end

Expand All @@ -105,13 +105,13 @@ def deferred_hooks
# @param block [Proc] the implementation of the hook.
#
# @return [void]
def prepend_before(scope, *flags, **conditions, &block)
def prepend_before(scope, *flags, **conditions, &)
deferred_hooks << RSpec::SleepingKingStudios::Deferred::Calls::Hook.new(
:prepend_before,
scope,
*flags,
**conditions,
&block
&
)
end
end
Expand Down
9 changes: 2 additions & 7 deletions lib/rspec/sleeping_king_studios/deferred/missing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,8 @@ module ClassMethods

private

def method_missing(symbol, *args, **kwargs, &block)
deferred_calls << RSpec::SleepingKingStudios::Deferred::Call.new(
symbol,
*args,
**kwargs,
&block
)
def method_missing(...)
deferred_calls << RSpec::SleepingKingStudios::Deferred::Call.new(...)

nil
end
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def <=>(other)

# Require Factories, Custom Matchers, &c
support_path = File.join(__dir__, '/support/**/*.rb')
Dir[support_path].sort.each { |f| require f }
Dir[support_path].each { |f| require f }

RSpec.configure do |config|
config.disable_monkey_patching!
Expand Down
2 changes: 1 addition & 1 deletion spec/support/integration/deferred/launch_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module LaunchExamples
let(:launch_site) { 'KSC' }

def launch_rocket
subject.launch(launch_site: launch_site)
subject.launch(launch_site:)
end

it 'should launch the rocket' do
Expand Down
2 changes: 1 addition & 1 deletion spec/support/sandbox.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def self.run(*files) # rubocop:disable Metrics/MethodLength
doc: doc.join,
errors: err.string,
json: JSON.parse(raw_json),
status: status
status:
)
end
end
Expand Down

0 comments on commit 43eb861

Please sign in to comment.