Skip to content

Commit

Permalink
Fix tests on newer versions of Ruby
Browse files Browse the repository at this point in the history
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:0x000000010077d5c0> (class)> received :new with unexpected arguments
    expected: ({:foo=>"bar"}) (keyword arguments)
         got: ({:foo=>"bar"}) (options hash)
```
  • Loading branch information
gaffneyc committed Dec 19, 2024
1 parent bc16aaf commit ecca6af
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec/support/lint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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")

Expand Down

0 comments on commit ecca6af

Please sign in to comment.