Sha256: 0a886816a03ea985050961316051ec27a18f2c9693bd277e59ef97e21e2b77b8

Contents?: true

Size: 1.43 KB

Versions: 60

Compression:

Stored size: 1.43 KB

Contents

describe KnapsackPro::Config::CI::Codefresh do
  let(:env) { {} }

  before do
    stub_const('ENV', env)
  end

  it { should be_kind_of KnapsackPro::Config::CI::Base }

  describe '#node_total' do
    subject { described_class.new.node_total }

    it { should be nil }
  end

  describe '#node_index' do
    subject { described_class.new.node_index }

    it { should be nil }
  end

  describe '#node_build_id' do
    subject { described_class.new.node_build_id }

    context 'when environment exists' do
      let(:env) { { 'CF_BUILD_ID' => '1005' } }
      it { should eql '1005' }
    end

    context "when environment doesn't exist" do
      it { should be nil }
    end
  end

  describe '#commit_hash' do
    subject { described_class.new.commit_hash }

    context 'when environment exists' do
      let(:env) { { 'CF_REVISION' => 'b624067a61d2134df1db74ebdabb1d8d' } }
      it { should eql 'b624067a61d2134df1db74ebdabb1d8d' }
    end

    context "when environment doesn't exist" do
      it { should be nil }
    end
  end

  describe '#branch' do
    subject { described_class.new.branch }

    context 'when environment exists' do
      let(:env) { { 'CF_BRANCH' => 'codefresh-branch' } }
      it { should eql 'codefresh-branch' }
    end

    context "when environment doesn't exist" do
      it { should be nil }
    end
  end

  describe '#project_dir' do
    subject { described_class.new.project_dir }

    it { should be nil }
  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
knapsack_pro-2.18.2 spec/knapsack_pro/config/ci/codefresh_spec.rb
knapsack_pro-2.18.1 spec/knapsack_pro/config/ci/codefresh_spec.rb
knapsack_pro-2.18.0 spec/knapsack_pro/config/ci/codefresh_spec.rb
knapsack_pro-2.17.0 spec/knapsack_pro/config/ci/codefresh_spec.rb
knapsack_pro-2.16.0 spec/knapsack_pro/config/ci/codefresh_spec.rb
knapsack_pro-2.15.0 spec/knapsack_pro/config/ci/codefresh_spec.rb
knapsack_pro-2.14.0 spec/knapsack_pro/config/ci/codefresh_spec.rb
knapsack_pro-2.13.0 spec/knapsack_pro/config/ci/codefresh_spec.rb
knapsack_pro-2.12.0 spec/knapsack_pro/config/ci/codefresh_spec.rb
knapsack_pro-2.11.0 spec/knapsack_pro/config/ci/codefresh_spec.rb
knapsack_pro-2.10.1 spec/knapsack_pro/config/ci/codefresh_spec.rb
knapsack_pro-2.10.0 spec/knapsack_pro/config/ci/codefresh_spec.rb
knapsack_pro-2.9.0 spec/knapsack_pro/config/ci/codefresh_spec.rb
knapsack_pro-2.8.0 spec/knapsack_pro/config/ci/codefresh_spec.rb
knapsack_pro-2.7.0 spec/knapsack_pro/config/ci/codefresh_spec.rb
knapsack_pro-2.6.0 spec/knapsack_pro/config/ci/codefresh_spec.rb
knapsack_pro-2.5.0 spec/knapsack_pro/config/ci/codefresh_spec.rb
knapsack_pro-2.4.0 spec/knapsack_pro/config/ci/codefresh_spec.rb
knapsack_pro-2.3.0 spec/knapsack_pro/config/ci/codefresh_spec.rb
knapsack_pro-2.2.1 spec/knapsack_pro/config/ci/codefresh_spec.rb