Sha256: 0a8559182efb7870cd6439179dbfce356d7aa793779eb0155e830b5a64a9b459

Contents?: true

Size: 1.16 KB

Versions: 4

Compression:

Stored size: 1.16 KB

Contents

require 'ostruct'

def create(name, options = {})
  case name
  when :message
    Vx::Message::PerformBuild.test_message

  when :task
    msg = create(:message)
    Vx::Builder::Task.new(
      job_id:     1,
      build_id:   12,
      name:       'name',
      src:        msg.src,
      sha:        msg.sha,
      deploy_key: msg.deploy_key,
      branch:     msg.branch,
      cache_url_prefix: "http://example.com",
      artifacts_url_prefix: "http://example.com",
      pull_request_id: options[:pull_request_id]
    )

  when :source
    name = options[:name] || "travis.yml"
    Vx::Builder::BuildConfiguration.from_yaml(fixture(name))

  when :env
    OpenStruct.new(
      init:           [],
      before_install: [],
      install:        [],
      announce:       [],
      before_script:  [],
      script:         [],
      after_script:   [],
      after_script_init: [],
      source:         options[:source] || create(:source),
      after_success:  [],
      task:           create(:task),
      cache_key:      [],
      cached_directories: []
    )

  when :command_from_env
    env = options[:env]
    a = ["set -e"]
    a += env.init
    a.join("\n")
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vx-builder-0.1.3 spec/support/create.rb
vx-builder-0.1.2 spec/support/create.rb
vx-builder-0.1.1 spec/support/create.rb
vx-builder-0.1.0 spec/support/create.rb