Skip to content

Commit

Permalink
support for COVERALLS_SERVICE_NAME; version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
nickmerwin committed Jan 20, 2017
1 parent 03a9f8f commit 0c6e3aa
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/coveralls/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ def self.configuration
# standardized env vars
set_standard_service_params_for_generic_ci(config)

if service_name = ENV['COVERALLS_SERVICE_NAME']
config[:service_name] = service_name
end

config
end

Expand Down
2 changes: 1 addition & 1 deletion lib/coveralls/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Coveralls
VERSION = "0.8.18"
VERSION = "0.8.19"
end
13 changes: 13 additions & 0 deletions spec/coveralls/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,19 @@
end

context 'Services' do
context 'with env based service name' do
let(:service_name) { 'travis-enterprise' }
before do
ENV.stub(:[]).with('TRAVIS').and_return('1')
ENV.stub(:[]).with('COVERALLS_SERVICE_NAME').and_return(service_name)
end

it 'pulls the service name from the environment if set' do
config = Coveralls::Configuration.configuration
config[:service_name].should eq(service_name)
end
end

context 'on Travis' do
before do
ENV.stub(:[]).with('TRAVIS').and_return('1')
Expand Down

0 comments on commit 0c6e3aa

Please sign in to comment.