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