diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-30 12:10:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-30 12:10:51 +0300 |
commit | afa3d4e0666ea2cddcf995fadac75c35a75c9b64 (patch) | |
tree | cdb79919561fc2ee15985430f69ab7e8e376999d /spec/services/packages | |
parent | 0eeb1736417d4768a1e2ee34b62f25c1f591c6ca (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/packages')
4 files changed, 55 insertions, 55 deletions
diff --git a/spec/services/packages/debian/extract_changes_metadata_service_spec.rb b/spec/services/packages/debian/extract_changes_metadata_service_spec.rb index a7d121819a1..2a92b8ed26e 100644 --- a/spec/services/packages/debian/extract_changes_metadata_service_spec.rb +++ b/spec/services/packages/debian/extract_changes_metadata_service_spec.rb @@ -13,7 +13,7 @@ RSpec.describe Packages::Debian::ExtractChangesMetadataService do context 'with valid package file' do it 'extract metadata', :aggregate_failures do - expected_fields = { 'Architecture': 'source amd64', 'Binary': 'libsample0 sample-dev sample-udeb' } + expected_fields = { 'Architecture' => 'source amd64', 'Binary' => 'libsample0 sample-dev sample-udeb' } expect(subject[:file_type]).to eq(:changes) expect(subject[:architecture]).to be_nil @@ -40,7 +40,7 @@ RSpec.describe Packages::Debian::ExtractChangesMetadataService do let(:sha256_dsc) { '844f79825b7e8aaa191e514b58a81f9ac1e58e2180134b0c9512fa66d896d7ba 671 sample_1.2.3~alpha2.dsc' } let(:sha256_source) { 'b5a599e88e7cbdda3bde808160a21ba1dd1ec76b2ec8d4912aae769648d68362 864 sample_1.2.3~alpha2.tar.xz' } let(:sha256s) { "#{sha256_dsc}\n#{sha256_source}" } - let(:fields) { { Files: md5s, 'Checksums-Sha1': sha1s, 'Checksums-Sha256': sha256s } } + let(:fields) { { 'Files' => md5s, 'Checksums-Sha1' => sha1s, 'Checksums-Sha256' => sha256s } } let(:metadata) { { file_type: :changes, architecture: 'amd64', fields: fields } } before do diff --git a/spec/services/packages/debian/extract_deb_metadata_service_spec.rb b/spec/services/packages/debian/extract_deb_metadata_service_spec.rb index 33059adf8a2..ee3f3d179dc 100644 --- a/spec/services/packages/debian/extract_deb_metadata_service_spec.rb +++ b/spec/services/packages/debian/extract_deb_metadata_service_spec.rb @@ -10,17 +10,17 @@ RSpec.describe Packages::Debian::ExtractDebMetadataService do context 'with correct file' do it 'return as expected' do expected = { - 'Package': 'libsample0', - 'Source': 'sample', - 'Version': '1.2.3~alpha2', - 'Architecture': 'amd64', - 'Maintainer': 'John Doe <john.doe@example.com>', - 'Installed-Size': '7', - 'Section': 'libs', - 'Priority': 'optional', - 'Multi-Arch': 'same', - 'Homepage': 'https://gitlab.com/', - 'Description': "Some mostly empty lib\nUsed in GitLab tests.\n\nTesting another paragraph." + 'Package' => 'libsample0', + 'Source' => 'sample', + 'Version' => '1.2.3~alpha2', + 'Architecture' => 'amd64', + 'Maintainer' => 'John Doe <john.doe@example.com>', + 'Installed-Size' => '7', + 'Section' => 'libs', + 'Priority' => 'optional', + 'Multi-Arch' => 'same', + 'Homepage' => 'https://gitlab.com/', + 'Description' => "Some mostly empty lib\nUsed in GitLab tests.\n\nTesting another paragraph." } expect(subject.execute).to eq expected diff --git a/spec/services/packages/debian/extract_metadata_service_spec.rb b/spec/services/packages/debian/extract_metadata_service_spec.rb index 0aa9a67b263..e3911dbbfe0 100644 --- a/spec/services/packages/debian/extract_metadata_service_spec.rb +++ b/spec/services/packages/debian/extract_metadata_service_spec.rb @@ -33,11 +33,11 @@ RSpec.describe Packages::Debian::ExtractMetadataService do where(:case_name, :trait, :expected_file_type, :expected_architecture, :expected_fields) do 'with invalid' | :invalid | :unknown | nil | nil 'with source' | :source | :source | nil | nil - 'with dsc' | :dsc | :dsc | nil | { 'Binary': 'sample-dev, libsample0, sample-udeb' } - 'with deb' | :deb | :deb | 'amd64' | { 'Multi-Arch': 'same' } - 'with udeb' | :udeb | :udeb | 'amd64' | { 'Package': 'sample-udeb' } - 'with buildinfo' | :buildinfo | :buildinfo | nil | { 'Architecture': 'amd64 source', 'Build-Architecture': 'amd64' } - 'with changes' | :changes | :changes | nil | { 'Architecture': 'source amd64', 'Binary': 'libsample0 sample-dev sample-udeb' } + 'with dsc' | :dsc | :dsc | nil | { 'Binary' => 'sample-dev, libsample0, sample-udeb' } + 'with deb' | :deb | :deb | 'amd64' | { 'Multi-Arch' => 'same' } + 'with udeb' | :udeb | :udeb | 'amd64' | { 'Package' => 'sample-udeb' } + 'with buildinfo' | :buildinfo | :buildinfo | nil | { 'Architecture' => 'amd64 source', 'Build-Architecture' => 'amd64' } + 'with changes' | :changes | :changes | nil | { 'Architecture' => 'source amd64', 'Binary' => 'libsample0 sample-dev sample-udeb' } end with_them do diff --git a/spec/services/packages/debian/parse_debian822_service_spec.rb b/spec/services/packages/debian/parse_debian822_service_spec.rb index b67daca89c4..f43e38991ce 100644 --- a/spec/services/packages/debian/parse_debian822_service_spec.rb +++ b/spec/services/packages/debian/parse_debian822_service_spec.rb @@ -27,17 +27,17 @@ RSpec.describe Packages::Debian::ParseDebian822Service do it 'return as expected, preserving order' do expected = { 'Package: libsample0' => { - 'Package': 'libsample0', - 'Source': 'sample', - 'Version': '1.2.3~alpha2', - 'Architecture': 'amd64', - 'Maintainer': 'John Doe <john.doe@example.com>', - 'Installed-Size': '9', - 'Section': 'libs', - 'Priority': 'optional', - 'Multi-Arch': 'same', - 'Homepage': 'https://gitlab.com/', - 'Description': "Some mostly empty lib\nUsed in GitLab tests.\n\nTesting another paragraph." + 'Package' => 'libsample0', + 'Source' => 'sample', + 'Version' => '1.2.3~alpha2', + 'Architecture' => 'amd64', + 'Maintainer' => 'John Doe <john.doe@example.com>', + 'Installed-Size' => '9', + 'Section' => 'libs', + 'Priority' => 'optional', + 'Multi-Arch' => 'same', + 'Homepage' => 'https://gitlab.com/', + 'Description' => "Some mostly empty lib\nUsed in GitLab tests.\n\nTesting another paragraph." } } @@ -51,38 +51,38 @@ RSpec.describe Packages::Debian::ParseDebian822Service do it 'return as expected, preserving order' do expected = { 'Source: sample' => { - 'Source': 'sample', - 'Priority': 'optional', - 'Maintainer': 'John Doe <john.doe@example.com>', - 'Build-Depends': 'debhelper-compat (= 13)', - 'Standards-Version': '4.5.0', - 'Section': 'libs', - 'Homepage': 'https://gitlab.com/', - # 'Vcs-Browser': 'https://salsa.debian.org/debian/sample-1.2.3', - # '#Vcs-Git': 'https://salsa.debian.org/debian/sample-1.2.3.git', - 'Rules-Requires-Root': 'no' + 'Source' => 'sample', + 'Priority' => 'optional', + 'Maintainer' => 'John Doe <john.doe@example.com>', + 'Build-Depends' => 'debhelper-compat (= 13)', + 'Standards-Version' => '4.5.0', + 'Section' => 'libs', + 'Homepage' => 'https://gitlab.com/', + # 'Vcs-Browser' => 'https://salsa.debian.org/debian/sample-1.2.3', + # '#Vcs-Git' => 'https://salsa.debian.org/debian/sample-1.2.3.git', + 'Rules-Requires-Root' => 'no' }, 'Package: sample-dev' => { - 'Package': 'sample-dev', - 'Section': 'libdevel', - 'Architecture': 'any', - 'Multi-Arch': 'same', - 'Depends': 'libsample0 (= ${binary:Version}), ${misc:Depends}', - 'Description': "Some mostly empty developpement files\nUsed in GitLab tests.\n\nTesting another paragraph." + 'Package' => 'sample-dev', + 'Section' => 'libdevel', + 'Architecture' => 'any', + 'Multi-Arch' => 'same', + 'Depends' => 'libsample0 (= ${binary:Version}), ${misc:Depends}', + 'Description' => "Some mostly empty developpement files\nUsed in GitLab tests.\n\nTesting another paragraph." }, 'Package: libsample0' => { - 'Package': 'libsample0', - 'Architecture': 'any', - 'Multi-Arch': 'same', - 'Depends': '${shlibs:Depends}, ${misc:Depends}', - 'Description': "Some mostly empty lib\nUsed in GitLab tests.\n\nTesting another paragraph." + 'Package' => 'libsample0', + 'Architecture' => 'any', + 'Multi-Arch' => 'same', + 'Depends' => '${shlibs:Depends}, ${misc:Depends}', + 'Description' => "Some mostly empty lib\nUsed in GitLab tests.\n\nTesting another paragraph." }, 'Package: sample-udeb' => { - 'Package': 'sample-udeb', - 'Package-Type': 'udeb', - 'Architecture': 'any', - 'Depends': 'installed-base', - 'Description': 'Some mostly empty udeb' + 'Package' => 'sample-udeb', + 'Package-Type' => 'udeb', + 'Architecture' => 'any', + 'Depends' => 'installed-base', + 'Description' => 'Some mostly empty udeb' } } |