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.61 spec/lib/builder/script_builder_spec.rb
vx-builder-0.5.60 spec/lib/builder/script_builder_spec.rb
vx-builder-0.5.59 spec/lib/builder/script_builder_spec.rb
vx-builder-0.5.58 spec/lib/builder/script_builder_spec.rb
vx-builder-0.5.57 spec/lib/builder/script_builder_spec.rb
vx-builder-0.5.56 spec/lib/builder/script_builder_spec.rb
vx-builder-0.5.55 spec/lib/builder/script_builder_spec.rb
vx-builder-0.5.54 spec/lib/builder/script_builder_spec.rb
vx-builder-0.5.53 spec/lib/builder/script_builder_spec.rb
vx-builder-0.5.52 spec/lib/builder/script_builder_spec.rb
vx-builder-0.5.51 spec/lib/builder/script_builder_spec.rb
vx-builder-0.5.50 spec/lib/builder/script_builder_spec.rb
vx-builder-0.5.49 spec/lib/builder/script_builder_spec.rb
vx-builder-0.5.48 spec/lib/builder/script_builder_spec.rb
vx-builder-0.5.47 spec/lib/builder/script_builder_spec.rb
vx-builder-0.5.46 spec/lib/builder/script_builder_spec.rb
vx-builder-0.5.45 spec/lib/builder/script_builder_spec.rb
vx-builder-0.5.44 spec/lib/builder/script_builder_spec.rb
vx-builder-0.5.43 spec/lib/builder/script_builder_spec.rb
vx-builder-0.5.42 spec/lib/builder/script_builder_spec.rb