Skip to content

Commit

Permalink
Fix kwarg changes in ruby 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcolvar committed Jan 24, 2023
1 parent 8ea73e4 commit 96719ee
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions lib/valkyrie/persistence/fedora/ordered_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class HeadSentinel < Sentinel
# @param parent [Valkyrie::Persistence::Fedora::OrderedList]
# @param next_node [ListNode]
# @param prev_node [ListNode]
def initialize(*args)
def initialize(*args, **kwargs)
super
@next ||= TailSentinel.new(parent, prev_node: self)
end
Expand All @@ -166,7 +166,7 @@ class TailSentinel < Sentinel
# @param parent [Valkyrie::Persistence::Fedora::OrderedList]
# @param next_node [ListNode]
# @param prev_node [ListNode]
def initialize(*args)
def initialize(*args, **kwargs)
super
prev.next = self if prev&.next != self
end
Expand Down
2 changes: 1 addition & 1 deletion spec/support/fedora_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def fedora_auth
end

def wipe_fedora!(base_path:, fedora_version: 4)
Valkyrie::Persistence::Fedora::MetadataAdapter.new(fedora_adapter_config(base_path: base_path, fedora_version: fedora_version)).persister.wipe!
Valkyrie::Persistence::Fedora::MetadataAdapter.new(**fedora_adapter_config(base_path: base_path, fedora_version: fedora_version)).persister.wipe!
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/valkyrie/persistence/fedora/metadata_adapter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[4, 5, 6].each do |fedora_version|
context "fedora #{fedora_version}" do
let(:version) { fedora_version }
let(:adapter) { described_class.new(fedora_adapter_config(base_path: "test_fed", fedora_version: version)) }
let(:adapter) { described_class.new(**fedora_adapter_config(base_path: "test_fed", fedora_version: version)) }
it_behaves_like "a Valkyrie::MetadataAdapter"

describe "#schema" do
Expand All @@ -15,7 +15,7 @@
end

context "with a custom schema" do
let(:adapter) { described_class.new(fedora_adapter_config(base_path: "test_fed", schema: "custom-schema", fedora_version: version)) }
let(:adapter) { described_class.new(**fedora_adapter_config(base_path: "test_fed", schema: "custom-schema", fedora_version: version)) }
specify { expect(adapter.schema).to eq("custom-schema") }
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
let(:version) { fedora_version }
let(:adapter) do
Valkyrie::Persistence::Fedora::MetadataAdapter.new(
fedora_adapter_config(base_path: "test_fed", schema: schema, fedora_version: version)
**fedora_adapter_config(base_path: "test_fed", schema: schema, fedora_version: version)
)
end

Expand Down
2 changes: 1 addition & 1 deletion spec/valkyrie/persistence/fedora/persister_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

let(:adapter) do
Valkyrie::Persistence::Fedora::MetadataAdapter.new(
fedora_adapter_config(
**fedora_adapter_config(
base_path: "test_fed",
schema: Valkyrie::Persistence::Fedora::PermissiveSchema.new(title: RDF::URI("http://example.com/title")),
fedora_version: version
Expand Down
10 changes: 5 additions & 5 deletions spec/valkyrie/storage/fedora_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Valkyrie::Specs::FedoraCustomResource < Valkyrie::Resource
wipe_fedora!(base_path: "test", fedora_version: 4)
end

let(:storage_adapter) { described_class.new(fedora_adapter_config(base_path: 'test', fedora_version: 4)) }
let(:storage_adapter) { described_class.new(**fedora_adapter_config(base_path: 'test', fedora_version: 4)) }
let(:file) { fixture_file_upload('files/example.tif', 'image/tiff') }

it_behaves_like "a Valkyrie::StorageAdapter"
Expand Down Expand Up @@ -50,7 +50,7 @@ class Valkyrie::Specs::FedoraCustomResource < Valkyrie::Resource
wipe_fedora!(base_path: "test", fedora_version: 5)
end

let(:storage_adapter) { described_class.new(fedora_adapter_config(base_path: 'test', fedora_version: 5)) }
let(:storage_adapter) { described_class.new(**fedora_adapter_config(base_path: 'test', fedora_version: 5)) }
let(:file) { fixture_file_upload('files/example.tif', 'image/tiff') }

it_behaves_like "a Valkyrie::StorageAdapter"
Expand Down Expand Up @@ -91,7 +91,7 @@ class Valkyrie::Specs::FedoraCustomResource < Valkyrie::Resource
end
context 'when using default transformer' do
context 'and basepath is passed in' do
let(:storage_adapter) { described_class.new(fedora_adapter_config(base_path: 'test', fedora_version: 5)) }
let(:storage_adapter) { described_class.new(**fedora_adapter_config(base_path: 'test', fedora_version: 5)) }

it 'produces a valid URI' do
expected_uri = 'fedora://localhost:8998/rest/test/AN1D4UHA/original'
Expand All @@ -100,7 +100,7 @@ class Valkyrie::Specs::FedoraCustomResource < Valkyrie::Resource
end

context "when basepath uses default (e.g. '/')" do
let(:storage_adapter) { described_class.new(fedora_adapter_config(base_path: '/', fedora_version: 5)) }
let(:storage_adapter) { described_class.new(**fedora_adapter_config(base_path: '/', fedora_version: 5)) }

it 'produces a valid URI' do
expected_uri = RDF::URI.new('fedora://localhost:8998/rest/AN1D4UHA/original')
Expand Down Expand Up @@ -128,7 +128,7 @@ class Valkyrie::Specs::FedoraCustomResource < Valkyrie::Resource
RDF::URI.new(base_url + (head.scan(/..?/).first(4) + [id]).join('/'))
end
end
let(:storage_adapter) { described_class.new(fedora_adapter_config(base_path: 'test', fedora_version: 5)) }
let(:storage_adapter) { described_class.new(**fedora_adapter_config(base_path: 'test', fedora_version: 5)) }

it 'produces a valid URI' do
expected_uri = 'fedora://localhost:8998/rest/test/AN/1D/4U/HA/AN1D4UHA/original'
Expand Down

0 comments on commit 96719ee

Please sign in to comment.