From ecca6af053e8b3a63e92f35854fe6d1850b7589f Mon Sep 17 00:00:00 2001 From: Chris Gaffney Date: Thu, 19 Dec 2024 10:35:28 -0500 Subject: [PATCH] Fix tests on newer versions of Ruby This is to get the tests green again before taking a deeper look into the impact of keyword args on Interactor as a whole. The failures looked something like this: ``` Failure/Error: new(context).tap(&:run).context #<# (class)> received :new with unexpected arguments expected: ({:foo=>"bar"}) (keyword arguments) got: ({:foo=>"bar"}) (options hash) ``` --- spec/support/lint.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/support/lint.rb b/spec/support/lint.rb index 55b84d5..9a78ee1 100644 --- a/spec/support/lint.rb +++ b/spec/support/lint.rb @@ -6,7 +6,7 @@ let(:instance) { double(:instance, context: context) } it "calls an instance with the given context" do - expect(interactor).to receive(:new).once.with(foo: "bar") { instance } + expect(interactor).to receive(:new).once.with({foo: "bar"}) { instance } expect(instance).to receive(:run).once.with(no_args) expect(interactor.call(foo: "bar")).to eq(context) @@ -25,7 +25,7 @@ let(:instance) { double(:instance, context: context) } it "calls an instance with the given context" do - expect(interactor).to receive(:new).once.with(foo: "bar") { instance } + expect(interactor).to receive(:new).once.with({foo: "bar"}) { instance } expect(instance).to receive(:run!).once.with(no_args) expect(interactor.call!(foo: "bar")).to eq(context) @@ -43,7 +43,7 @@ let(:context) { double(:context) } it "initializes a context" do - expect(Interactor::Context).to receive(:build).once.with(foo: "bar") { context } + expect(Interactor::Context).to receive(:build).once.with({foo: "bar"}) { context } instance = interactor.new(foo: "bar")