Skip to content

Commit

Permalink
added gitlab specs; version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
nickmerwin committed Feb 26, 2016
1 parent 20478d6 commit e40627c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
1 change: 0 additions & 1 deletion lib/coveralls/configuration.rb
Expand Up @@ -89,7 +89,6 @@ def self.set_service_params_for_tddium(config)

def self.set_service_params_for_gitlab(config)
config[:service_name] = 'gitlab-ci'
config[:service_number] = ENV['CI_BUILD_REF'][0..5]
config[:service_job_number] = ENV['CI_BUILD_NAME']
config[:service_job_id] = ENV['CI_BUILD_ID']
config[:service_branch] = ENV['CI_BUILD_REF_NAME']
Expand Down
2 changes: 1 addition & 1 deletion lib/coveralls/version.rb
@@ -1,3 +1,3 @@
module Coveralls
VERSION = "0.8.11"
VERSION = "0.8.12"
end
24 changes: 24 additions & 0 deletions spec/coveralls/configuration_spec.rb
Expand Up @@ -193,6 +193,30 @@
end
end

describe '.set_service_params_for_gitlab' do
let(:commit_sha) { SecureRandom.hex(32) }
let(:service_job_number) { "spec:one" }
let(:service_job_id) { 1234 }
let(:service_branch) { "feature" }

before do
ENV.stub(:[]).with('CI_BUILD_NAME').and_return(service_job_number)
ENV.stub(:[]).with('CI_BUILD_ID').and_return(service_job_id)
ENV.stub(:[]).with('CI_BUILD_REF_NAME').and_return(service_branch)
ENV.stub(:[]).with('CI_BUILD_REF').and_return(commit_sha)
end

it 'should set the expected parameters' do
config = {}
Coveralls::Configuration.set_service_params_for_gitlab(config)
config[:service_name].should eq('gitlab-ci')
config[:service_job_number].should eq(service_job_number)
config[:service_job_id].should eq(service_job_id)
config[:service_branch].should eq(service_branch)
config[:commit_sha].should eq(commit_sha)
end
end

describe '.set_service_params_for_semaphore' do
let(:semaphore_build_num) { SecureRandom.hex(4) }
before do
Expand Down

0 comments on commit e40627c

Please sign in to comment.