diff --git a/.ruby-version b/.ruby-version index 860487ca..b0f2dcb3 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.7.1 +3.0.4 diff --git a/lib/use_case/base.rb b/lib/use_case/base.rb index 5468e0ff..1ffea6c2 100644 --- a/lib/use_case/base.rb +++ b/lib/use_case/base.rb @@ -1,19 +1,19 @@ # frozen_string_literal: true -require 'dry-initializer' -require 'types' -require 'errors' +require "dry-initializer" +require "types" +require "errors" module UseCase class Base extend Dry::Initializer - def self.call(*args, **kwargs) - new(*args, **kwargs).call + def self.call(...) + new(...).call end def call raise NotImplementedError end end -end \ No newline at end of file +end diff --git a/spec/lib/use_case/relationship/create_spec.rb b/spec/lib/use_case/relationship/create_spec.rb index ffd8f7dc..a0656cd0 100644 --- a/spec/lib/use_case/relationship/create_spec.rb +++ b/spec/lib/use_case/relationship/create_spec.rb @@ -42,14 +42,14 @@ describe UseCase::Relationship::Create do let!(:user1) { FactoryBot.create(:user, screen_name: "timallen") } let!(:user2) { FactoryBot.create(:user, screen_name: "joehilyar") } - subject { described_class.call(params) } + subject { described_class.call(**params) } context "type = 'follow'" do let(:type) { "follow" } include_examples "valid relationship type" - context "using screen names" do + context "using User model instances" do let(:source_user) { user1 } let(:target_user) { user2 } @@ -62,7 +62,7 @@ describe UseCase::Relationship::Create do include_examples "valid relationship type" - context "using screen names" do + context "using User model instances" do let(:source_user) { user1 } let(:target_user) { user2 } diff --git a/spec/lib/use_case/relationship/destroy_spec.rb b/spec/lib/use_case/relationship/destroy_spec.rb index 64ea2433..1080b76a 100644 --- a/spec/lib/use_case/relationship/destroy_spec.rb +++ b/spec/lib/use_case/relationship/destroy_spec.rb @@ -43,7 +43,7 @@ describe UseCase::Relationship::Destroy do let!(:user1) { FactoryBot.create(:user, screen_name: "timallen") } let!(:user2) { FactoryBot.create(:user, screen_name: "joehilyar") } - subject { described_class.call(params) } + subject { described_class.call(**params) } context "type = 'follow'" do let(:type) { "follow" }