diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-20 14:43:17 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-20 14:43:17 +0300 |
commit | dfc94207fec2d84314b1a5410cface22e8b369bd (patch) | |
tree | c54022f61ced104305889a64de080998a0dc773b /spec/factories/packages/debian/file_metadatum.rb | |
parent | b874efeff674f6bf0355d5d242ecf81c6f7155df (diff) |
Add latest changes from gitlab-org/gitlab@15-11-stable-eev15.11.0-rc42
Diffstat (limited to 'spec/factories/packages/debian/file_metadatum.rb')
-rw-r--r-- | spec/factories/packages/debian/file_metadatum.rb | 70 |
1 files changed, 39 insertions, 31 deletions
diff --git a/spec/factories/packages/debian/file_metadatum.rb b/spec/factories/packages/debian/file_metadatum.rb index ef6c4e1f222..6b6cd9c51f3 100644 --- a/spec/factories/packages/debian/file_metadatum.rb +++ b/spec/factories/packages/debian/file_metadatum.rb @@ -2,11 +2,18 @@ FactoryBot.define do factory :debian_file_metadatum, class: 'Packages::Debian::FileMetadatum' do - package_file { association(:debian_package_file, without_loaded_metadatum: true) } + package_file do + if file_type == 'unknown' + association(:debian_package_file, :unknown, without_loaded_metadatum: true) + else + association(:debian_package_file, without_loaded_metadatum: true) + end + end + file_type { 'deb' } component { 'main' } architecture { 'amd64' } - fields { { 'a': 'b' } } + fields { { 'a' => 'b' } } trait(:unknown) do file_type { 'unknown' } @@ -32,19 +39,20 @@ FactoryBot.define do 'Source' => package_file.package.name, 'Binary' => 'sample-dev, libsample0, sample-udeb, sample-ddeb', 'Architecture' => 'any', - 'Version': package_file.package.version, + 'Version' => package_file.package.version, 'Maintainer' => "#{FFaker::Name.name} <#{FFaker::Internet.email}>", 'Homepage' => FFaker::Internet.http_url, 'Standards-Version' => '4.5.0', 'Build-Depends' => 'debhelper-compat (= 13)', - 'Package-List' => <<~EOF.rstrip, - libsample0 deb libs optional arch=any', - 'sample-ddeb deb libs optional arch=any', - sample-dev deb libdevel optional arch=any', - sample-udeb udeb libs optional arch=any', - EOF + 'Package-List' => <<~PACKAGELIST.rstrip, + libsample0 deb libs optional arch=any + sample-ddeb deb libs optional arch=any + sample-dev deb libdevel optional arch=any + sample-udeb udeb libs optional arch=any + PACKAGELIST 'Checksums-Sha1' => "\n4a9cb2a7c77a68dc0fe54ba8ecef133a7c949e9d 964 sample_1.2.3~alpha2.tar.xz", - 'Checksums-Sha256' => "\nc9d05185ca158bb804977fa9d7b922e8a0f644a2da41f99d2787dd61b1e2e2c5 964 sample_1.2.3~alpha2.tar.xz", + 'Checksums-Sha256' => + "\nc9d05185ca158bb804977fa9d7b922e8a0f644a2da41f99d2787dd61b1e2e2c5 964 sample_1.2.3~alpha2.tar.xz", 'Files' => "\nadc69e57cda38d9bb7c8d59cacfb6869 964 sample_1.2.3~alpha2.tar.xz" } end @@ -56,22 +64,22 @@ FactoryBot.define do architecture { 'amd64' } fields do { - 'Package' => 'libsample0', - 'Source' => package_file.package.name, - 'Version' => package_file.package.version, - 'Architecture' => 'amd64', - 'Maintainer' => "#{FFaker::Name.name} <#{FFaker::Internet.email}>", - 'Installed-Size' => '7', - 'Section' => 'libs', - 'Priority' => 'optional', - 'Multi-Arch' => 'same', - 'Homepage' => FFaker::Internet.http_url, - 'Description' => <<~EOF.rstrip - Some mostly empty lib - Used in GitLab tests. + 'Package' => 'libsample0', + 'Source' => package_file.package.name, + 'Version' => package_file.package.version, + 'Architecture' => 'amd64', + 'Maintainer' => "#{FFaker::NameCN.name} #{FFaker::Name.name} <#{FFaker::Internet.email}>", + 'Installed-Size' => '7', + 'Section' => 'libs', + 'Priority' => 'optional', + 'Multi-Arch' => 'same', + 'Homepage' => FFaker::Internet.http_url, + 'Description' => <<~DESCRIPTION.rstrip + Some mostly empty lib + Used in GitLab tests. - Testing another paragraph. - EOF + Testing another paragraph. + DESCRIPTION } end end @@ -93,12 +101,12 @@ FactoryBot.define do 'Priority' => 'optional', 'Multi-Arch' => 'same', 'Homepage' => FFaker::Internet.http_url, - 'Description' => <<~EOF.rstrip + 'Description' => <<~DESCRIPTION.rstrip Some mostly empty development files Used in GitLab tests. Testing another paragraph. - EOF + DESCRIPTION } end end @@ -107,28 +115,28 @@ FactoryBot.define do file_type { 'udeb' } component { 'main' } architecture { 'amd64' } - fields { { 'a': 'b' } } + fields { { 'a' => 'b' } } end trait(:ddeb) do file_type { 'ddeb' } component { 'main' } architecture { 'amd64' } - fields { { 'a': 'b' } } + fields { { 'a' => 'b' } } end trait(:buildinfo) do file_type { 'buildinfo' } component { 'main' } architecture { nil } - fields { { 'Architecture': 'amd64 source' } } + fields { { 'Architecture' => 'amd64 source' } } end trait(:changes) do file_type { 'changes' } component { nil } architecture { nil } - fields { { 'Architecture': 'source amd64' } } + fields { { 'Architecture' => 'source amd64' } } end end end |