summaryrefslogtreecommitdiff
path: root/lib/gitlab/ci/pipeline/seed/stage.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-03-21 13:08:30 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-03-21 13:08:30 +0100
commit9b5a912f9377a77e52e9acdf7471acd27c709264 (patch)
treea1def3c44127c2bc872cba67557f86a1c9c43d7f /lib/gitlab/ci/pipeline/seed/stage.rb
parentb82de0f0087a91165a7306fa9fe11a0cbc48fcd5 (diff)
downloadgitlab-ce-9b5a912f9377a77e52e9acdf7471acd27c709264.tar.gz
Make it easier to test pipeline stage seeds
Diffstat (limited to 'lib/gitlab/ci/pipeline/seed/stage.rb')
-rw-r--r--lib/gitlab/ci/pipeline/seed/stage.rb11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/gitlab/ci/pipeline/seed/stage.rb b/lib/gitlab/ci/pipeline/seed/stage.rb
index b431206fd2c..6d824e52334 100644
--- a/lib/gitlab/ci/pipeline/seed/stage.rb
+++ b/lib/gitlab/ci/pipeline/seed/stage.rb
@@ -3,7 +3,10 @@ module Gitlab
module Pipeline
module Seed
class Stage < Seed::Base
- delegate :size, to: :@seeds
+ attr_reader :pipeline, :seeds
+
+ delegate :size, to: :seeds
+ delegate :dig, to: :seeds
def initialize(pipeline, name, builds)
@pipeline = pipeline
@@ -24,12 +27,6 @@ module Gitlab
project: @pipeline.project }
end
- # TODO decouple
- #
- def builds_attributes
- @seeds.map(&:attributes)
- end
-
def to_resource
::Ci::Stage.new(attributes).tap do |stage|
@seeds.each do |seed|