Sha256: 07189e908166a9cad9b44d8429d8802af16bd270b0484351bbd9c8ceb8ae0c75

Contents?: true

Size: 1.61 KB

Versions: 52

Compression:

Stored size: 1.61 KB

Contents

require 'spec_helper'

describe Vx::Builder::ScriptBuilder do
  let(:task)   { create :task }
  let(:source) { create :source }
  let(:script) { described_class.new task, source }
  subject { script }

  context "just created" do
    its(:source) { should eq source }
    its(:task)   { should eq task  }
  end

  context "#image" do
    subject { script.image }
    it { should eq 'one' }
  end

  context "vexor" do
    it "should avaialble timeout and read_timeout attributes" do
      expect(script.vexor.timeout).to eq 10
      expect(script.vexor.read_timeout).to eq 20

      simple_source = create :source, name: "simple.yml"
      simple_script = described_class.new task, simple_source
      expect(simple_script.vexor.timeout).to be_nil
      expect(simple_script.vexor.read_timeout).to be_nil
    end
  end

  context "parallel" do
    it "should create parallel jobs" do
      matrix = Vx::Builder::MatrixBuilder.new(source)
      configurations = matrix.build
      configuration = configurations[1]
      expect(configuration.parallel).to eq 3
      expect(configuration.parallel_job_number).to eq 1
      parallel_script = described_class.new task, configuration
      content = parallel_script.to_before_script
      expect(content).to match("CI_PARALLEL_JOBS\=3")
      expect(content).to match("CI_PARALLEL_JOB_NUMBER\=1")
    end
  end

  context "#to_before_script" do
    subject { script.to_before_script }
    it { should be }
  end

  context "#to_after_script" do
    subject { script.to_after_script }
    it { should be }
  end

  context "#to_script" do
    subject { script.to_script }
    it { should be }
  end

end

Version data entries

52 entries across 52 versions & 1 rubygems

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