Sha256: 19fd1b9855dd9ce929ee428b7283cb8d3173d4a3f9f0788bcdd6422608442cd5

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 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(
      'name',
      msg.src,
      msg.sha,
      deploy_key: msg.deploy_key,
      branch:     msg.branch,
      cache_url_prefix: "http://example.com/",
      artifacts_url_prefix: "http://example.com/"
    )

  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:   [],
      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

1 entries across 1 versions & 1 rubygems

Version Path
vx-builder-0.0.29 spec/support/create.rb