Sha256: 2d8c431dfed962537dba8f395ce68b6ea4ce5a14af7bcb83252c58d93d8bb344
Contents?: true
Size: 1.98 KB
Versions: 87
Compression:
Stored size: 1.98 KB
Contents
describe KnapsackPro::Config::CI::Heroku 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 } context 'when environment exists' do let(:env) { { 'CI_NODE_TOTAL' => 4 } } it { should eql 4 } end context "when environment doesn't exist" do it { should be nil } end end describe '#node_index' do subject { described_class.new.node_index } context 'when environment exists' do let(:env) { { 'CI_NODE_INDEX' => 3 } } it { should eql 3 } end context "when environment doesn't exist" do it { should be nil } end end describe '#node_build_id' do subject { described_class.new.node_build_id } context 'when environment exists' do let(:env) { { 'HEROKU_TEST_RUN_ID' => 1234 } } it { should eql 1234 } 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) { { 'HEROKU_TEST_RUN_COMMIT_VERSION' => 'abbaec3ee5d334fd658da35646b42bc5' } } it { should eql 'abbaec3ee5d334fd658da35646b42bc5' } 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) { { 'HEROKU_TEST_RUN_BRANCH' => 'master' } } it { should eql 'master' } end context "when environment doesn't exist" do it { should be nil } end end describe '#project_dir' do subject { described_class.new.project_dir } context 'when environment exists' do let(:env) { { 'HEROKU_TEST_RUN_ID' => 1234 } } it { should eq '/app' } end context "when environment doesn't exist" do it { should be nil } end end end
Version data entries
87 entries across 87 versions & 1 rubygems