coveralls 0.7.11 → 0.7.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: edcff37f5ab5399144743e4efc3b289ffd83216f
4
- data.tar.gz: ea91f1f2f2e83d00772180e194929fce84a92fff
3
+ metadata.gz: 8e0bd0063aa8ae76c60cecafc2d08742206ae0d9
4
+ data.tar.gz: 5580074308250e46d55621c9ba08d563eb081f15
5
5
  SHA512:
6
- metadata.gz: 20b31c714e9426d75cc947648ca6753655acec1e44c0763e5a61833e52c6f0236daf9c3000188bb80761ce277c839c6bff487089ea4777cc60e52dd5f07a6447
7
- data.tar.gz: 4d306557d8eb08965f929a9cd3ba6ac7acb670f845dead56483a4604310228ac19b89f1adfe1765b9d786a63c9e27616356a3532440699ccee0404b6f3264652
6
+ metadata.gz: 838521b4b4096571dc61fc25d581b133243b1d455296d7f341d42e0ac7222a2c1a5ee8eb0c13574d4072c995b64ec6df8260e74acae3ac11598eb6e9f05b35dc
7
+ data.tar.gz: e02194eb03ab2f201c8bfed5c231bedd6c9d77f6ba06f62ad4e8021a14f60423882b861c568a58d6e28f05772ed7f140f0bd4e3c96b5f5d1d391d2a54011ab52
@@ -134,16 +134,16 @@ module Coveralls
134
134
  Dir.chdir(root) do
135
135
 
136
136
  hash[:head] = {
137
- :id => `git log -1 --pretty=format:'%H'`,
138
- :author_name => `git log -1 --pretty=format:'%aN'`,
139
- :author_email => `git log -1 --pretty=format:'%ae'`,
140
- :committer_name => `git log -1 --pretty=format:'%cN'`,
141
- :committer_email => `git log -1 --pretty=format:'%ce'`,
142
- :message => `git log -1 --pretty=format:'%s'`
137
+ :id => ENV.fetch("GIT_ID", `git log -1 --pretty=format:'%H'`),
138
+ :author_name => ENV.fetch("GIT_AUTHOR_NAME", `git log -1 --pretty=format:'%aN'`),
139
+ :author_email => ENV.fetch("GIT_AUTHOR_EMAIL", `git log -1 --pretty=format:'%ae'`),
140
+ :committer_name => ENV.fetch("GIT_COMMITTER_NAME", `git log -1 --pretty=format:'%cN'`),
141
+ :committer_email => ENV.fetch("GIT_COMMITTER_EMAIL", `git log -1 --pretty=format:'%ce'`),
142
+ :message => ENV.fetch("GIT_MESSAGE", `git log -1 --pretty=format:'%s'`)
143
143
  }
144
144
 
145
145
  # Branch
146
- hash[:branch] = `git rev-parse --abbrev-ref HEAD`
146
+ hash[:branch] = ENV.fetch("GIT_BRANCH", `git rev-parse --abbrev-ref HEAD`)
147
147
 
148
148
  # Remotes
149
149
  remotes = nil
@@ -1,3 +1,3 @@
1
1
  module Coveralls
2
- VERSION = "0.7.11"
2
+ VERSION = "0.7.12"
3
3
  end
@@ -236,7 +236,7 @@ describe Coveralls::Configuration do
236
236
  let(:service_number) { SecureRandom.hex(4) }
237
237
  let(:service_build_url) { SecureRandom.hex(4) }
238
238
  let(:service_branch) { SecureRandom.hex(4) }
239
- let(:service_pull_request) { SecureRandom.hex(4) }
239
+ let(:service_pull_request) { '1234' }
240
240
 
241
241
  before do
242
242
  ENV.stub(:[]).with('CI_NAME').and_return(service_name)
@@ -281,5 +281,34 @@ describe Coveralls::Configuration do
281
281
  end
282
282
  end
283
283
 
284
+ describe '.git' do
285
+ let(:git_id) { SecureRandom.hex(2) }
286
+ let(:author_name) { SecureRandom.hex(4) }
287
+ let(:author_email) { SecureRandom.hex(4) }
288
+ let(:committer_name) { SecureRandom.hex(4) }
289
+ let(:committer_email) { SecureRandom.hex(4) }
290
+ let(:message) { SecureRandom.hex(4) }
291
+ let(:branch) { SecureRandom.hex(4) }
284
292
 
293
+ before do
294
+ allow(ENV).to receive(:fetch).with('GIT_ID', anything).and_return(git_id)
295
+ allow(ENV).to receive(:fetch).with('GIT_AUTHOR_NAME', anything).and_return(author_name)
296
+ allow(ENV).to receive(:fetch).with('GIT_AUTHOR_EMAIL', anything).and_return(author_email)
297
+ allow(ENV).to receive(:fetch).with('GIT_COMMITTER_NAME', anything).and_return(committer_name)
298
+ allow(ENV).to receive(:fetch).with('GIT_COMMITTER_EMAIL', anything).and_return(committer_email)
299
+ allow(ENV).to receive(:fetch).with('GIT_MESSAGE', anything).and_return(message)
300
+ allow(ENV).to receive(:fetch).with('GIT_BRANCH', anything).and_return(branch)
301
+ end
302
+
303
+ it 'uses ENV vars' do
304
+ config = Coveralls::Configuration.git
305
+ config[:head][:id].should eq(git_id)
306
+ config[:head][:author_name].should eq(author_name)
307
+ config[:head][:author_email].should eq(author_email)
308
+ config[:head][:committer_name].should eq(committer_name)
309
+ config[:head][:committer_email].should eq(committer_email)
310
+ config[:head][:message].should eq(message)
311
+ config[:branch].should eq(branch)
312
+ end
313
+ end
285
314
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coveralls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.11
4
+ version: 0.7.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Merwin
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-02-24 00:00:00.000000000 Z
12
+ date: 2015-03-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json