Sha256: 92bb771267d56d684f30a8c9c1843cebcd152726c63cb5ebd126950fc30adddf

Contents?: true

Size: 942 Bytes

Versions: 9

Compression:

Stored size: 942 Bytes

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/"
    )

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

  when :env
    OpenStruct.new(
      init:           [],
      before_install: [],
      install:        [],
      announce:       [],
      before_script:  [],
      script:         [],
      after_script:   [],
      source:         options[:source] || create(:source),
      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

9 entries across 9 versions & 1 rubygems

Version Path
vx-builder-0.0.27 spec/support/create.rb
vx-builder-0.0.26 spec/support/create.rb
vx-builder-0.0.25 spec/support/create.rb
vx-builder-0.0.24 spec/support/create.rb
vx-builder-0.0.23 spec/support/create.rb
vx-builder-0.0.22 spec/support/create.rb
vx-builder-0.0.21 spec/support/create.rb
vx-builder-0.0.20 spec/support/create.rb
vx-builder-0.0.19 spec/support/create.rb