Commit 9c7440cd authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'issue_344279_last_2' into 'master'

Fix the offenses introduced by Style/OpenStructUse

See merge request gitlab-org/gitlab!74141
parents 0999038b 955876d0
...@@ -2632,5 +2632,4 @@ Style/OpenStructUse: ...@@ -2632,5 +2632,4 @@ Style/OpenStructUse:
- 'spec/support/shared_examples/requests/api/pypi_packages_shared_examples.rb' - 'spec/support/shared_examples/requests/api/pypi_packages_shared_examples.rb'
- 'spec/support_specs/helpers/stub_feature_flags_spec.rb' - 'spec/support_specs/helpers/stub_feature_flags_spec.rb'
- 'spec/tooling/rspec_flaky/flaky_example_spec.rb' - 'spec/tooling/rspec_flaky/flaky_example_spec.rb'
- 'spec/workers/packages/maven/metadata/sync_worker_spec.rb'
- 'tooling/rspec_flaky/flaky_example.rb' - 'tooling/rspec_flaky/flaky_example.rb'
...@@ -8,6 +8,7 @@ RSpec.describe Packages::Maven::Metadata::SyncWorker, type: :worker do ...@@ -8,6 +8,7 @@ RSpec.describe Packages::Maven::Metadata::SyncWorker, type: :worker do
let(:versions) { %w[1.2 1.1 2.1 3.0-SNAPSHOT] } let(:versions) { %w[1.2 1.1 2.1 3.0-SNAPSHOT] }
let(:worker) { described_class.new } let(:worker) { described_class.new }
let(:data_struct) { Struct.new(:release, :latest, :versions, keyword_init: true) }
describe '#perform' do describe '#perform' do
let(:user) { create(:user) } let(:user) { create(:user) }
...@@ -197,7 +198,7 @@ RSpec.describe Packages::Maven::Metadata::SyncWorker, type: :worker do ...@@ -197,7 +198,7 @@ RSpec.describe Packages::Maven::Metadata::SyncWorker, type: :worker do
def versions_from(xml_content) def versions_from(xml_content)
xml_doc = Nokogiri::XML(xml_content) xml_doc = Nokogiri::XML(xml_content)
OpenStruct.new( data_struct.new(
release: xml_doc.xpath('//metadata/versioning/release').first.content, release: xml_doc.xpath('//metadata/versioning/release').first.content,
latest: xml_doc.xpath('//metadata/versioning/latest').first.content, latest: xml_doc.xpath('//metadata/versioning/latest').first.content,
versions: xml_doc.xpath('//metadata/versioning/versions/version').map(&:content) versions: xml_doc.xpath('//metadata/versioning/versions/version').map(&:content)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment