singularity_dsl 1.6.0 → 1.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YzZjNjM3MDEwOTQ0YTZjYTNjZDdjYjI1NTEzMThiNmJiMmM3OTAwNw==
4
+ ZmQwNTFiMTY3ODJhN2IzMDRjZTg5YzY5Y2M3MDc0NTBkODA2YzlmMA==
5
5
  data.tar.gz: !binary |-
6
- Yjc0MGYyNWE0ZjQzN2FlYzljMDA5ZDQ3YmM2MzE4ZmVmYWM3NzNhNA==
6
+ NTFiOTkyNjVkYWMxNTFkZGI5MWVlODAxNGVlYTBkNGI5N2U3ZWI2YQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YTU3MThlYzcxYTE0OTRjYTVkYTM1ZTAzMmNmODk2OGI0MjA4MmY4ZDdkNWNj
10
- ZjhiYjE5NWVlZDg1YTg1OWJkYjVhYzU3ZGU0NmFlYzUzMGU4YzRkNjY3YzY1
11
- YTNmMmEyM2E1NTRlN2M4NmFiOTcwNjQzMWQ5YTc0N2QwMjUwMWI=
9
+ NzBiMDQ2ZmM2MTA2M2RhY2FmNzM3MDEyYmY3MDMzMTIxMTc2ZmZiNzEyZjc5
10
+ MmFjZmJmODZkZjhkNjYzZjIwNjk4YzNhZWRmZGQwN2YyMWVmYWU2MTE3NWQ2
11
+ MWY0YzFjYWQ4N2FiZTNiYmZmMTU1Nzc0M2EyZTNkZDhjN2RlYmM=
12
12
  data.tar.gz: !binary |-
13
- Y2FlYTNkYzQ2ZDU3NTQxZTlhOTdlYTIzY2I1NGQ1NGU4NTNhMjk1ZmYxNjgw
14
- NmJjOWM2MTg1NDNmY2UzZDgzYWE3NmRlYTMzYjAzYTU0ZTFjYjNiZTEwYWU0
15
- OTI4NGU3ZWQ2ZTNjNGVjNjdhZDUwYjIyZmJhMWUxZWQyMzdhYWI=
13
+ ZjE5ZDE2YzAwMzExZGY3YTI0ZmM2NzVmMzBmOGI2NzdhNTM2YjY4MzJiMzQy
14
+ YWRhZDk2OWNlMWY2NmE2YzQyMzMyZWFjZmNiZjU3ZGI5YzU3ZTg4YTAzOGQ2
15
+ MmRkYWMyMDIzODFkMTliMmUwN2VmNjk0ZmViMTkxYmNhNTMzYzQ=
data/.singularityrc CHANGED
@@ -1,14 +1,12 @@
1
1
  # encoding: utf-8
2
2
 
3
-
4
- ENV['COVERALLS_REPO_TOKEN'] = 'AcPyCLj3wGg7aunnmgDTu6Wm9P8Kpy5oA'
5
-
6
3
  batch :build do
7
4
  shelltask { command 'bundle' }
8
5
  end
9
6
 
10
7
  batch :test do
11
8
  rubocop
9
+ bootcoveralls if flag? 'coveralls'
12
10
  rspec
13
11
  end
14
12
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- singularity_dsl (1.6.0)
4
+ singularity_dsl (1.6.1)
5
5
  coveralls (~> 0.7.9)
6
6
  json (~> 1.0)
7
7
  mixlib-shellout (~> 2.0)
@@ -6,6 +6,7 @@ require 'singularity_dsl/cli/utils'
6
6
  require 'singularity_dsl/dsl/dsl'
7
7
  require 'singularity_dsl/errors'
8
8
  require 'singularity_dsl/git_helper'
9
+ require 'singularity_dsl/version'
9
10
  require 'thor'
10
11
 
11
12
  module SingularityDsl
@@ -53,6 +54,12 @@ module SingularityDsl
53
54
  Runtime flags to set for use with flag_set?, formatted as VAR:VAL
54
55
  EOD
55
56
 
57
+ map %w(--version -v) => :__print_version
58
+ desc '--version, -v', 'print the version'
59
+ def __print_version
60
+ puts "Singularity Runner & DSL v#{SingularityDsl::VERSION}"
61
+ end
62
+
56
63
  # TASKS COMMAND
57
64
  desc 'tasks', 'Available tasks.'
58
65
  def tasks
@@ -48,7 +48,7 @@ class BootCoveralls < SingularityDsl::Task
48
48
  cover_all_things!
49
49
  rescue ::StandardError => e
50
50
  info e.to_s
51
- raise e unless no_fail
51
+ raise e unless @no_fail
52
52
  end
53
53
  end
54
54
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  # version const for gem
4
4
  module SingularityDsl
5
- VERSION = '1.6.0'
5
+ VERSION = '1.6.1'
6
6
  end
@@ -5,22 +5,46 @@ require 'singularity_dsl/tasks/boot_coveralls'
5
5
  describe BootCoveralls do
6
6
  let(:coveralls) { BootCoveralls.new }
7
7
 
8
- context '#no_fail' do
8
+ describe '#token' do
9
+ it 'sets COVERALLS_REPO_TOKEN' do
10
+ # cannot actually set var - will overwrite the ACTUAL
11
+ # value ...UGGGGH :(
12
+ expect(ENV).to receive(:[]=)
13
+ .with('COVERALLS_REPO_TOKEN', 'foobar')
14
+ coveralls.token 'foobar'
15
+ end
16
+ end
17
+
18
+ describe '#report_endpoint' do
19
+ after(:each) do
20
+ ENV['COVERALLS_ENDPOINT'] = nil
21
+ end
22
+
23
+ it 'sets COVERALLS_ENDPOINT' do
24
+ coveralls.report_endpoint 'foobar'
25
+
26
+ expect(ENV['COVERALLS_ENDPOINT']).to eql 'foobar'
27
+ end
28
+ end
29
+
30
+ describe '#no_fail' do
9
31
  it 'fails when non-bool given' do
10
32
  expect { coveralls.no_fail [] }.to raise_error
11
33
  end
12
34
  end
13
35
 
14
- context '#execute' do
36
+ describe '#execute' do
15
37
  before(:each) do
16
38
  allow(coveralls).to receive(:info)
17
39
  end
18
40
 
19
41
  context 'environment not correct' do
20
- it 'return if COVERALLS_REPO_TOKEN is not set' do
42
+ before(:each) do
21
43
  allow(ENV).to receive(:key?)
22
44
  .with('COVERALLS_REPO_TOKEN').and_return false
45
+ end
23
46
 
47
+ it 'return if COVERALLS_REPO_TOKEN is not set' do
24
48
  expect(coveralls).to receive(:info)
25
49
  .with('Missing ENV variable: COVERALLS_REPO_TOKEN')
26
50
  expect(coveralls).to receive(:info)
@@ -28,5 +52,25 @@ describe BootCoveralls do
28
52
  expect(coveralls.execute).to eql nil
29
53
  end
30
54
  end
55
+
56
+ context '::Coveralls itself no bueno' do
57
+ before(:each) do
58
+ allow(ENV).to receive(:key?)
59
+ .with('COVERALLS_REPO_TOKEN').and_return true
60
+ allow(::Coveralls).to receive(:wear!)
61
+ .and_raise(::StandardError.new 'NO PANTS FOR YOU')
62
+ end
63
+
64
+ it 'does not fail by default' do
65
+ expect(coveralls).to receive(:info).with(/NO PANTS/)
66
+ expect(coveralls.execute).to eql nil
67
+ end
68
+
69
+ it 'fails when no_fail flipped off' do
70
+ coveralls.no_fail false
71
+
72
+ expect { coveralls.execute }.to raise_error(/NO PANTS/)
73
+ end
74
+ end
31
75
  end
32
76
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: singularity_dsl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - chr0n1x