Sha256: 07602b5eb54e0975e6d3c6790c61fa4acdaeba42b6229765c5689ca5ebf185f1

Contents?: true

Size: 715 Bytes

Versions: 2

Compression:

Stored size: 715 Bytes

Contents

require 'spec_helper'

describe Evrone::CI::Worker::DockerFetchRepo, run_docker: true do
  let(:exit_code)   { 0 }
  let(:app)         { ->(_) { exit_code } }
  let(:options)     { {} }
  let(:job)         { create :job, options }
  let(:env)         { OpenStruct.new job: job }
  let(:mid)         { described_class.new app }
  let(:docker_mid)  { Evrone::CI::Worker::DockerStartContainer.new(mid) }

  subject { docker_mid.call env }

  it "should be" do
    expect(subject).to eq 0
  end

  context "when fail to fetch repo" do
    let(:options) { { src: "/not-exists-repo.git" } }
    it "should be" do
      expect(subject).to eq(-1)
      expect(job.output).to be_include("does not exist")
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
evrone-ci-worker-0.2.0.pre1 spec/lib/worker/middlewares/docker_fetch_repo_spec.rb
evrone-ci-worker-0.2.0.pre0 spec/lib/worker/middlewares/docker_fetch_repo_spec.rb