Sha256: e874162fa60f51b3a6c4310bfed9904a0fd19aa333ab264a0156697e38a8a44a

Contents?: true

Size: 1.06 KB

Versions: 59

Compression:

Stored size: 1.06 KB

Contents

require 'spec_helper'
require 'yaml'
require 'tmpdir'
require 'fileutils'

describe "(integration) go" do
  let(:path) { Dir.tmpdir + "/vx-builder-test" }

  before do
    FileUtils.rm_rf(path)
    FileUtils.mkdir_p(path)
  end
  after { FileUtils.rm_rf(path) }

  def build(file, options = {})
    config = Vx::Builder::BuildConfiguration.from_yaml(file)
    matrix = Vx::Builder.matrix config
    options[:task] ||= create(:task)
    script = Vx::Builder.script(options[:task], matrix.build.first)
    OpenStruct.new script: script, matrix: matrix
  end

  it "should succesfuly run lang/clojure", real: true do
    file = {"language" => "clojure"}.to_yaml
    task = create(
      :task,
      sha: "HEAD",
      branch: "lang/clojure"
    )

    b = build(file, task: task)
    Dir.chdir(path) do
      File.open("script.sh", "w") do |io|
        io.write "set -e\n"
        io.write b.script.to_before_script
        io.write b.script.to_script
      end
      system("env", "-", "USER=$USER", "HOME=#{path}", "bash", "script.sh" )
      expect($?.to_i).to eq 0
    end
  end
end

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
vx-builder-0.5.38 spec/integration/clojure_spec.rb
vx-builder-0.5.37 spec/integration/clojure_spec.rb
vx-builder-0.5.36 spec/integration/clojure_spec.rb
vx-builder-0.5.35 spec/integration/clojure_spec.rb
vx-builder-0.5.34 spec/integration/clojure_spec.rb
vx-builder-0.5.33 spec/integration/clojure_spec.rb
vx-builder-0.5.32 spec/integration/clojure_spec.rb
vx-builder-0.5.31 spec/integration/clojure_spec.rb
vx-builder-0.5.30 spec/integration/clojure_spec.rb
vx-builder-0.5.29 spec/integration/clojure_spec.rb
vx-builder-0.5.28 spec/integration/clojure_spec.rb
vx-builder-0.5.27 spec/integration/clojure_spec.rb
vx-builder-0.5.26 spec/integration/clojure_spec.rb
vx-builder-0.5.25 spec/integration/clojure_spec.rb
vx-builder-0.5.24 spec/integration/clojure_spec.rb
vx-builder-0.5.23 spec/integration/clojure_spec.rb
vx-builder-0.5.22 spec/integration/clojure_spec.rb
vx-builder-0.5.21 spec/integration/clojure_spec.rb
vx-builder-0.5.20 spec/integration/clojure_spec.rb
vx-builder-0.5.19 spec/integration/clojure_spec.rb