diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
commit | 3cccd102ba543e02725d247893729e5c73b38295 (patch) | |
tree | f36a04ec38517f5deaaacb5acc7d949688d1e187 /spec/factories/go_module_versions.rb | |
parent | 205943281328046ef7b4528031b90fbda70c75ac (diff) |
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'spec/factories/go_module_versions.rb')
-rw-r--r-- | spec/factories/go_module_versions.rb | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/spec/factories/go_module_versions.rb b/spec/factories/go_module_versions.rb index 145e6c95921..bdbd5a4423a 100644 --- a/spec/factories/go_module_versions.rb +++ b/spec/factories/go_module_versions.rb @@ -5,12 +5,10 @@ FactoryBot.define do skip_create initialize_with do - p = attributes[:params] - s = Packages::SemVer.parse(p.semver, prefixed: true) + s = Packages::SemVer.parse(semver, prefixed: true) + raise ArgumentError, "invalid sematic version: #{semver.inspect}" if !s && semver - raise ArgumentError, "invalid sematic version: '#{p.semver}'" if !s && p.semver - - new(p.mod, p.type, p.commit, name: p.name, semver: s, ref: p.ref) + new(mod, type, commit, name: name, semver: s, ref: ref) end mod { association(:go_module) } @@ -20,8 +18,6 @@ FactoryBot.define do semver { nil } ref { nil } - params { OpenStruct.new(mod: mod, type: type, commit: commit, name: name, semver: semver, ref: ref) } - trait :tagged do ref { mod.project.repository.find_tag(name) } commit { ref.dereferenced_target } @@ -36,8 +32,8 @@ FactoryBot.define do .max_by(&:to_s) .to_s end - - params { OpenStruct.new(mod: mod, type: :ref, commit: commit, semver: name, ref: ref) } + type { :ref } + semver { name } end end end |