Sha256: 8c001539d655e4971c1592f8e9aa4b2e01c1ce0f60a5880f2642614ff28f2dc9

Contents?: true

Size: 692 Bytes

Versions: 22

Compression:

Stored size: 692 Bytes

Contents

require 'spec_helper'
require 'pathname'
require 'fileutils'

describe Evrone::CI::Worker::LocalCreateDirs do
  let(:app)         { ->(_) { 0 } }
  let(:job)         { create :job }
  let(:path_prefix) { Pathname.new '/tmp/.ci' }
  let(:env)         { OpenStruct.new job: job, path_prefix: path_prefix }
  let(:mid)         { described_class.new app }

  subject { mid.call env }

  after do
    FileUtils.rm_rf path_prefix
  end

  it { should eq 0 }

  context "create and assign directories" do

    before do
      subject
    end

    it "tmp_dir" do
      expect(env.tmp_dir.to_s).to eq '/tmp/.ci/tmp/evrone/test-repo'
      expect(File.directory? env.tmp_dir).to be
    end

  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
evrone-ci-worker-0.2.0.pre27 spec/lib/worker/middlewares/local_create_dirs_spec.rb
evrone-ci-worker-0.2.0.pre26 spec/lib/worker/middlewares/local_create_dirs_spec.rb
evrone-ci-worker-0.2.0.pre25 spec/lib/worker/middlewares/local_create_dirs_spec.rb
evrone-ci-worker-0.2.0.pre24 spec/lib/worker/middlewares/local_create_dirs_spec.rb
evrone-ci-worker-0.2.0.pre23 spec/lib/worker/middlewares/local_create_dirs_spec.rb
evrone-ci-worker-0.2.0.pre22 spec/lib/worker/middlewares/local_create_dirs_spec.rb
evrone-ci-worker-0.2.0.pre21 spec/lib/worker/middlewares/local_create_dirs_spec.rb
evrone-ci-worker-0.2.0.pre20 spec/lib/worker/middlewares/local_create_dirs_spec.rb
evrone-ci-worker-0.2.0.pre19 spec/lib/worker/middlewares/local_create_dirs_spec.rb
evrone-ci-worker-0.2.0.pre18 spec/lib/worker/middlewares/local_create_dirs_spec.rb
evrone-ci-worker-0.2.0.pre17 spec/lib/worker/middlewares/local_create_dirs_spec.rb
evrone-ci-worker-0.2.0.pre15 spec/lib/worker/middlewares/local_create_dirs_spec.rb
evrone-ci-worker-0.2.0.pre14 spec/lib/worker/middlewares/local_create_dirs_spec.rb
evrone-ci-worker-0.2.0.pre13 spec/lib/worker/middlewares/local_create_dirs_spec.rb
evrone-ci-worker-0.2.0.pre12 spec/lib/worker/middlewares/local_create_dirs_spec.rb
evrone-ci-worker-0.2.0.pre11 spec/lib/worker/middlewares/local_create_dirs_spec.rb
evrone-ci-worker-0.2.0.pre10 spec/lib/worker/middlewares/local_create_dirs_spec.rb
evrone-ci-worker-0.2.0.pre9 spec/lib/worker/middlewares/local_create_dirs_spec.rb
evrone-ci-worker-0.2.0.pre8 spec/lib/worker/middlewares/local_create_dirs_spec.rb
evrone-ci-worker-0.2.0.pre7 spec/lib/worker/middlewares/local_create_dirs_spec.rb