Sha256: d1d49fbddd44bd31d808927c2041bb9625941c59052ec095da6448eca297550b

Contents?: true

Size: 902 Bytes

Versions: 29

Compression:

Stored size: 902 Bytes

Contents

describe KnapsackPro::RepositoryAdapters::GitAdapter do
  let!(:circle_sha1) { ENV['CIRCLE_SHA1'] }
  let!(:circle_branch) { ENV['CIRCLE_BRANCH'] }

  before do
    stub_const('ENV', {
      'KNAPSACK_PRO_PROJECT_DIR' => KnapsackPro.root,
    })
  end

  it { should be_kind_of KnapsackPro::RepositoryAdapters::BaseAdapter }

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

    it { should_not be_nil }
    its(:size) { should eq 40 }
    it { should eq circle_sha1 } if ENV['CIRCLECI']
  end

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

    it { should_not be_nil }
    it { should eq circle_branch } if ENV['CIRCLECI']
  end

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

    it { expect(subject.include?('master')).to be true }
    it { expect(subject.include?(circle_branch)).to be true } if ENV['CIRCLECI']
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
knapsack_pro-5.1.2 spec/knapsack_pro/repository_adapters/git_adapter_spec.rb
knapsack_pro-5.1.1 spec/knapsack_pro/repository_adapters/git_adapter_spec.rb
knapsack_pro-5.1.0 spec/knapsack_pro/repository_adapters/git_adapter_spec.rb
knapsack_pro-5.0.0 spec/knapsack_pro/repository_adapters/git_adapter_spec.rb
knapsack_pro-4.1.0 spec/knapsack_pro/repository_adapters/git_adapter_spec.rb
knapsack_pro-4.0.0 spec/knapsack_pro/repository_adapters/git_adapter_spec.rb
knapsack_pro-3.11.0 spec/knapsack_pro/repository_adapters/git_adapter_spec.rb
knapsack_pro-3.10.0 spec/knapsack_pro/repository_adapters/git_adapter_spec.rb
knapsack_pro-3.9.0 spec/knapsack_pro/repository_adapters/git_adapter_spec.rb
knapsack_pro-3.8.0 spec/knapsack_pro/repository_adapters/git_adapter_spec.rb
knapsack_pro-3.7.0 spec/knapsack_pro/repository_adapters/git_adapter_spec.rb
knapsack_pro-3.6.0 spec/knapsack_pro/repository_adapters/git_adapter_spec.rb
knapsack_pro-3.5.0 spec/knapsack_pro/repository_adapters/git_adapter_spec.rb
knapsack_pro-3.4.2 spec/knapsack_pro/repository_adapters/git_adapter_spec.rb
knapsack_pro-3.4.1 spec/knapsack_pro/repository_adapters/git_adapter_spec.rb
knapsack_pro-3.4.0 spec/knapsack_pro/repository_adapters/git_adapter_spec.rb
knapsack_pro-3.3.1 spec/knapsack_pro/repository_adapters/git_adapter_spec.rb
knapsack_pro-3.3.0 spec/knapsack_pro/repository_adapters/git_adapter_spec.rb
knapsack_pro-3.2.1 spec/knapsack_pro/repository_adapters/git_adapter_spec.rb
knapsack_pro-3.2.0 spec/knapsack_pro/repository_adapters/git_adapter_spec.rb