Sha256: 7aff7828b302dff691c8e624063e5db6b28092d4cb776aeaff484026b88459af
Contents?: true
Size: 1.11 KB
Versions: 23
Compression:
Stored size: 1.11 KB
Contents
require 'spec_helper' require 'evrone/common/spawn' require 'fileutils' describe Evrone::CI::Router::ScriptBuilder::Prepare do let(:path) { '/tmp/.test' } let(:app) { ->(_) { _ } } let(:build) { create :build } let(:env) { OpenStruct.new build: build, init: [] } let(:mid) { described_class.new app } subject { mid.call env } before do FileUtils.rm_rf path FileUtils.mkdir_p path end after { FileUtils.rm_rf path } it { should eq env } its(:init) { should_not be_empty } context "run compiled script" do include Evrone::Common::Spawn let(:script) { "set -e\nset -x\n" + env.init.join("\n") } before { mid.call env } it "should be success" do code = spawn script, chdir: path do |out| puts " ===> #{out}" end expect(code).to eq 0 expect(File).to be_readable("#{path}/data/evrone/test-repo/git_ssh") expect(File).to be_readable("#{path}/data/evrone/test-repo/key") expect(File).to be_directory("#{path}/code/evrone/test-repo/.git") expect(File).to be_readable("#{path}/code/evrone/test-repo/Rakefile") end end end
Version data entries
23 entries across 23 versions & 1 rubygems