knapsack_pro 4.0.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +28 -2
  3. data/lib/knapsack_pro/config/ci/app_veyor.rb +8 -0
  4. data/lib/knapsack_pro/config/ci/base.rb +7 -0
  5. data/lib/knapsack_pro/config/ci/buildkite.rb +8 -0
  6. data/lib/knapsack_pro/config/ci/circle.rb +8 -0
  7. data/lib/knapsack_pro/config/ci/cirrus_ci.rb +8 -0
  8. data/lib/knapsack_pro/config/ci/codefresh.rb +8 -0
  9. data/lib/knapsack_pro/config/ci/codeship.rb +8 -0
  10. data/lib/knapsack_pro/config/ci/github_actions.rb +16 -0
  11. data/lib/knapsack_pro/config/ci/gitlab_ci.rb +8 -0
  12. data/lib/knapsack_pro/config/ci/heroku.rb +8 -0
  13. data/lib/knapsack_pro/config/ci/semaphore.rb +8 -0
  14. data/lib/knapsack_pro/config/ci/semaphore2.rb +9 -0
  15. data/lib/knapsack_pro/config/ci/travis.rb +8 -0
  16. data/lib/knapsack_pro/config/env.rb +20 -11
  17. data/lib/knapsack_pro/version.rb +1 -1
  18. data/lib/tasks/queue/cucumber.rake +5 -0
  19. data/lib/tasks/queue/minitest.rake +5 -0
  20. data/lib/tasks/queue/rspec.rake +5 -0
  21. data/spec/knapsack_pro/config/ci/app_veyor_spec.rb +8 -8
  22. data/spec/knapsack_pro/config/ci/buildkite_spec.rb +14 -14
  23. data/spec/knapsack_pro/config/ci/circle_spec.rb +11 -11
  24. data/spec/knapsack_pro/config/ci/cirrus_ci_spec.rb +12 -12
  25. data/spec/knapsack_pro/config/ci/codefresh_spec.rb +6 -6
  26. data/spec/knapsack_pro/config/ci/codeship_spec.rb +6 -6
  27. data/spec/knapsack_pro/config/ci/github_actions_spec.rb +21 -8
  28. data/spec/knapsack_pro/config/ci/gitlab_ci_spec.rb +9 -9
  29. data/spec/knapsack_pro/config/ci/heroku_spec.rb +12 -12
  30. data/spec/knapsack_pro/config/ci/semaphore2_spec.rb +11 -11
  31. data/spec/knapsack_pro/config/ci/semaphore_spec.rb +12 -12
  32. data/spec/knapsack_pro/config/ci/travis_spec.rb +8 -8
  33. data/spec/knapsack_pro/config/env_spec.rb +102 -87
  34. metadata +3 -3
@@ -10,12 +10,12 @@ describe KnapsackPro::Config::CI::CirrusCI do
10
10
  describe '#node_total' do
11
11
  subject { described_class.new.node_total }
12
12
 
13
- context 'when environment exists' do
13
+ context 'when the environment exists' do
14
14
  let(:env) { { 'CI_NODE_TOTAL' => 4 } }
15
15
  it { should eql 4 }
16
16
  end
17
17
 
18
- context "when environment doesn't exist" do
18
+ context "when the environment doesn't exist" do
19
19
  it { should be nil }
20
20
  end
21
21
  end
@@ -23,12 +23,12 @@ describe KnapsackPro::Config::CI::CirrusCI do
23
23
  describe '#node_index' do
24
24
  subject { described_class.new.node_index }
25
25
 
26
- context 'when environment exists' do
26
+ context 'when the environment exists' do
27
27
  let(:env) { { 'CI_NODE_INDEX' => 3 } }
28
28
  it { should eql 3 }
29
29
  end
30
30
 
31
- context "when environment doesn't exist" do
31
+ context "when the environment doesn't exist" do
32
32
  it { should be nil }
33
33
  end
34
34
  end
@@ -36,12 +36,12 @@ describe KnapsackPro::Config::CI::CirrusCI do
36
36
  describe '#node_build_id' do
37
37
  subject { described_class.new.node_build_id }
38
38
 
39
- context 'when environment exists' do
39
+ context 'when the environment exists' do
40
40
  let(:env) { { 'CIRRUS_BUILD_ID' => 123 } }
41
41
  it { should eql 123 }
42
42
  end
43
43
 
44
- context "when environment doesn't exist" do
44
+ context "when the environment doesn't exist" do
45
45
  it { should be nil }
46
46
  end
47
47
  end
@@ -49,12 +49,12 @@ describe KnapsackPro::Config::CI::CirrusCI do
49
49
  describe '#commit_hash' do
50
50
  subject { described_class.new.commit_hash }
51
51
 
52
- context 'when environment exists' do
52
+ context 'when the environment exists' do
53
53
  let(:env) { { 'CIRRUS_CHANGE_IN_REPO' => '2e13512fc230d6f9ebf4923352718e4d' } }
54
54
  it { should eql '2e13512fc230d6f9ebf4923352718e4d' }
55
55
  end
56
56
 
57
- context "when environment doesn't exist" do
57
+ context "when the environment doesn't exist" do
58
58
  it { should be nil }
59
59
  end
60
60
  end
@@ -62,12 +62,12 @@ describe KnapsackPro::Config::CI::CirrusCI do
62
62
  describe '#branch' do
63
63
  subject { described_class.new.branch }
64
64
 
65
- context 'when environment exists' do
65
+ context 'when the environment exists' do
66
66
  let(:env) { { 'CIRRUS_BRANCH' => 'master' } }
67
67
  it { should eql 'master' }
68
68
  end
69
69
 
70
- context "when environment doesn't exist" do
70
+ context "when the environment doesn't exist" do
71
71
  it { should be nil }
72
72
  end
73
73
  end
@@ -75,12 +75,12 @@ describe KnapsackPro::Config::CI::CirrusCI do
75
75
  describe '#project_dir' do
76
76
  subject { described_class.new.project_dir }
77
77
 
78
- context 'when environment exists' do
78
+ context 'when the environment exists' do
79
79
  let(:env) { { 'CIRRUS_WORKING_DIR' => '/tmp/cirrus-ci-build' } }
80
80
  it { should eql '/tmp/cirrus-ci-build' }
81
81
  end
82
82
 
83
- context "when environment doesn't exist" do
83
+ context "when the environment doesn't exist" do
84
84
  it { should be nil }
85
85
  end
86
86
  end
@@ -22,12 +22,12 @@ describe KnapsackPro::Config::CI::Codefresh do
22
22
  describe '#node_build_id' do
23
23
  subject { described_class.new.node_build_id }
24
24
 
25
- context 'when environment exists' do
25
+ context 'when the environment exists' do
26
26
  let(:env) { { 'CF_BUILD_ID' => '1005' } }
27
27
  it { should eql '1005' }
28
28
  end
29
29
 
30
- context "when environment doesn't exist" do
30
+ context "when the environment doesn't exist" do
31
31
  it { should be nil }
32
32
  end
33
33
  end
@@ -35,12 +35,12 @@ describe KnapsackPro::Config::CI::Codefresh do
35
35
  describe '#commit_hash' do
36
36
  subject { described_class.new.commit_hash }
37
37
 
38
- context 'when environment exists' do
38
+ context 'when the environment exists' do
39
39
  let(:env) { { 'CF_REVISION' => 'b624067a61d2134df1db74ebdabb1d8d' } }
40
40
  it { should eql 'b624067a61d2134df1db74ebdabb1d8d' }
41
41
  end
42
42
 
43
- context "when environment doesn't exist" do
43
+ context "when the environment doesn't exist" do
44
44
  it { should be nil }
45
45
  end
46
46
  end
@@ -48,12 +48,12 @@ describe KnapsackPro::Config::CI::Codefresh do
48
48
  describe '#branch' do
49
49
  subject { described_class.new.branch }
50
50
 
51
- context 'when environment exists' do
51
+ context 'when the environment exists' do
52
52
  let(:env) { { 'CF_BRANCH' => 'codefresh-branch' } }
53
53
  it { should eql 'codefresh-branch' }
54
54
  end
55
55
 
56
- context "when environment doesn't exist" do
56
+ context "when the environment doesn't exist" do
57
57
  it { should be nil }
58
58
  end
59
59
  end
@@ -22,12 +22,12 @@ describe KnapsackPro::Config::CI::Codeship do
22
22
  describe '#node_build_id' do
23
23
  subject { described_class.new.node_build_id }
24
24
 
25
- context 'when environment exists' do
25
+ context 'when the environment exists' do
26
26
  let(:env) { { 'CI_BUILD_NUMBER' => 2013 } }
27
27
  it { should eql 2013 }
28
28
  end
29
29
 
30
- context "when environment doesn't exist" do
30
+ context "when the environment doesn't exist" do
31
31
  it { should be nil }
32
32
  end
33
33
  end
@@ -35,12 +35,12 @@ describe KnapsackPro::Config::CI::Codeship do
35
35
  describe '#commit_hash' do
36
36
  subject { described_class.new.commit_hash }
37
37
 
38
- context 'when environment exists' do
38
+ context 'when the environment exists' do
39
39
  let(:env) { { 'CI_COMMIT_ID' => 'a22aec3ee5d334fd658da35646b42bc5' } }
40
40
  it { should eql 'a22aec3ee5d334fd658da35646b42bc5' }
41
41
  end
42
42
 
43
- context "when environment doesn't exist" do
43
+ context "when the environment doesn't exist" do
44
44
  it { should be nil }
45
45
  end
46
46
  end
@@ -48,12 +48,12 @@ describe KnapsackPro::Config::CI::Codeship do
48
48
  describe '#branch' do
49
49
  subject { described_class.new.branch }
50
50
 
51
- context 'when environment exists' do
51
+ context 'when the environment exists' do
52
52
  let(:env) { { 'CI_BRANCH' => 'master' } }
53
53
  it { should eql 'master' }
54
54
  end
55
55
 
56
- context "when environment doesn't exist" do
56
+ context "when the environment doesn't exist" do
57
57
  it { should be nil }
58
58
  end
59
59
  end
@@ -22,12 +22,25 @@ describe KnapsackPro::Config::CI::GithubActions do
22
22
  describe '#node_build_id' do
23
23
  subject { described_class.new.node_build_id }
24
24
 
25
- context 'when environment exists' do
25
+ context 'when the environment exists' do
26
26
  let(:env) { { 'GITHUB_RUN_ID' => 2706 } }
27
27
  it { should eql 2706 }
28
28
  end
29
29
 
30
- context "when environment doesn't exist" do
30
+ context "when the environment doesn't exist" do
31
+ it { should be nil }
32
+ end
33
+ end
34
+
35
+ describe '#node_retry_count' do
36
+ subject { described_class.new.node_retry_count }
37
+
38
+ context 'when the environment exists' do
39
+ let(:env) { { 'GITHUB_RUN_ATTEMPT' => 2 } }
40
+ it { should eql 1 }
41
+ end
42
+
43
+ context "when the environment doesn't exist" do
31
44
  it { should be nil }
32
45
  end
33
46
  end
@@ -35,12 +48,12 @@ describe KnapsackPro::Config::CI::GithubActions do
35
48
  describe '#commit_hash' do
36
49
  subject { described_class.new.commit_hash }
37
50
 
38
- context 'when environment exists' do
51
+ context 'when the environment exists' do
39
52
  let(:env) { { 'GITHUB_SHA' => '2e13512fc230d6f9ebf4923352718e4d' } }
40
53
  it { should eql '2e13512fc230d6f9ebf4923352718e4d' }
41
54
  end
42
55
 
43
- context "when environment doesn't exist" do
56
+ context "when the environment doesn't exist" do
44
57
  it { should be nil }
45
58
  end
46
59
  end
@@ -48,7 +61,7 @@ describe KnapsackPro::Config::CI::GithubActions do
48
61
  describe '#branch' do
49
62
  subject { described_class.new.branch }
50
63
 
51
- context 'when environment exists' do
64
+ context 'when the environment exists' do
52
65
  context 'when GITHUB_REF has value' do
53
66
  let(:env) do
54
67
  {
@@ -71,7 +84,7 @@ describe KnapsackPro::Config::CI::GithubActions do
71
84
  end
72
85
  end
73
86
 
74
- context "when environment doesn't exist" do
87
+ context "when the environment doesn't exist" do
75
88
  it { should be nil }
76
89
  end
77
90
  end
@@ -79,12 +92,12 @@ describe KnapsackPro::Config::CI::GithubActions do
79
92
  describe '#project_dir' do
80
93
  subject { described_class.new.project_dir }
81
94
 
82
- context 'when environment exists' do
95
+ context 'when the environment exists' do
83
96
  let(:env) { { 'GITHUB_WORKSPACE' => '/home/runner/work/my-repo-name/my-repo-name' } }
84
97
  it { should eql '/home/runner/work/my-repo-name/my-repo-name' }
85
98
  end
86
99
 
87
- context "when environment doesn't exist" do
100
+ context "when the environment doesn't exist" do
88
101
  it { should be nil }
89
102
  end
90
103
  end
@@ -10,12 +10,12 @@ describe KnapsackPro::Config::CI::GitlabCI do
10
10
  describe '#node_total' do
11
11
  subject { described_class.new.node_total }
12
12
 
13
- context 'when environment exists' do
13
+ context 'when the environment exists' do
14
14
  let(:env) { { 'CI_NODE_TOTAL' => 4 } }
15
15
  it { should eql 4 }
16
16
  end
17
17
 
18
- context "when environment doesn't exist" do
18
+ context "when the environment doesn't exist" do
19
19
  it { should be nil }
20
20
  end
21
21
  end
@@ -23,12 +23,12 @@ describe KnapsackPro::Config::CI::GitlabCI do
23
23
  describe '#node_index' do
24
24
  subject { described_class.new.node_index }
25
25
 
26
- context 'when environment exists and is in GitLab CI' do
26
+ context 'when the environment exists and is in GitLab CI' do
27
27
  let(:env) { { 'CI_NODE_INDEX' => 4, 'GITLAB_CI' => 'true' } }
28
28
  it { should eql 3 }
29
29
  end
30
30
 
31
- context "when environment doesn't exist" do
31
+ context "when the environment doesn't exist" do
32
32
  it { should be nil }
33
33
  end
34
34
  end
@@ -46,7 +46,7 @@ describe KnapsackPro::Config::CI::GitlabCI do
46
46
  it { should eql 7046508 }
47
47
  end
48
48
 
49
- context "when environment doesn't exist" do
49
+ context "when the environment doesn't exist" do
50
50
  it { should be nil }
51
51
  end
52
52
  end
@@ -64,7 +64,7 @@ describe KnapsackPro::Config::CI::GitlabCI do
64
64
  it { should eql 'f76c468e3e1d570f71f5822b1e48bb04' }
65
65
  end
66
66
 
67
- context "when environment doesn't exist" do
67
+ context "when the environment doesn't exist" do
68
68
  it { should be nil }
69
69
  end
70
70
  end
@@ -82,7 +82,7 @@ describe KnapsackPro::Config::CI::GitlabCI do
82
82
  it { should eql 'main' }
83
83
  end
84
84
 
85
- context "when environment doesn't exist" do
85
+ context "when the environment doesn't exist" do
86
86
  it { should be nil }
87
87
  end
88
88
  end
@@ -90,12 +90,12 @@ describe KnapsackPro::Config::CI::GitlabCI do
90
90
  describe '#project_dir' do
91
91
  subject { described_class.new.project_dir }
92
92
 
93
- context 'when environment exists' do
93
+ context 'when the environment exists' do
94
94
  let(:env) { { 'CI_PROJECT_DIR' => '/home/user/knapsack_pro-ruby' } }
95
95
  it { should eql '/home/user/knapsack_pro-ruby' }
96
96
  end
97
97
 
98
- context "when environment doesn't exist" do
98
+ context "when the environment doesn't exist" do
99
99
  it { should be nil }
100
100
  end
101
101
  end
@@ -10,12 +10,12 @@ describe KnapsackPro::Config::CI::Heroku do
10
10
  describe '#node_total' do
11
11
  subject { described_class.new.node_total }
12
12
 
13
- context 'when environment exists' do
13
+ context 'when the environment exists' do
14
14
  let(:env) { { 'CI_NODE_TOTAL' => 4 } }
15
15
  it { should eql 4 }
16
16
  end
17
17
 
18
- context "when environment doesn't exist" do
18
+ context "when the environment doesn't exist" do
19
19
  it { should be nil }
20
20
  end
21
21
  end
@@ -23,12 +23,12 @@ describe KnapsackPro::Config::CI::Heroku do
23
23
  describe '#node_index' do
24
24
  subject { described_class.new.node_index }
25
25
 
26
- context 'when environment exists' do
26
+ context 'when the environment exists' do
27
27
  let(:env) { { 'CI_NODE_INDEX' => 3 } }
28
28
  it { should eql 3 }
29
29
  end
30
30
 
31
- context "when environment doesn't exist" do
31
+ context "when the environment doesn't exist" do
32
32
  it { should be nil }
33
33
  end
34
34
  end
@@ -36,12 +36,12 @@ describe KnapsackPro::Config::CI::Heroku do
36
36
  describe '#node_build_id' do
37
37
  subject { described_class.new.node_build_id }
38
38
 
39
- context 'when environment exists' do
39
+ context 'when the environment exists' do
40
40
  let(:env) { { 'HEROKU_TEST_RUN_ID' => 1234 } }
41
41
  it { should eql 1234 }
42
42
  end
43
43
 
44
- context "when environment doesn't exist" do
44
+ context "when the environment doesn't exist" do
45
45
  it { should be nil }
46
46
  end
47
47
  end
@@ -49,12 +49,12 @@ describe KnapsackPro::Config::CI::Heroku do
49
49
  describe '#commit_hash' do
50
50
  subject { described_class.new.commit_hash }
51
51
 
52
- context 'when environment exists' do
52
+ context 'when the environment exists' do
53
53
  let(:env) { { 'HEROKU_TEST_RUN_COMMIT_VERSION' => 'abbaec3ee5d334fd658da35646b42bc5' } }
54
54
  it { should eql 'abbaec3ee5d334fd658da35646b42bc5' }
55
55
  end
56
56
 
57
- context "when environment doesn't exist" do
57
+ context "when the environment doesn't exist" do
58
58
  it { should be nil }
59
59
  end
60
60
  end
@@ -62,12 +62,12 @@ describe KnapsackPro::Config::CI::Heroku do
62
62
  describe '#branch' do
63
63
  subject { described_class.new.branch }
64
64
 
65
- context 'when environment exists' do
65
+ context 'when the environment exists' do
66
66
  let(:env) { { 'HEROKU_TEST_RUN_BRANCH' => 'master' } }
67
67
  it { should eql 'master' }
68
68
  end
69
69
 
70
- context "when environment doesn't exist" do
70
+ context "when the environment doesn't exist" do
71
71
  it { should be nil }
72
72
  end
73
73
  end
@@ -75,12 +75,12 @@ describe KnapsackPro::Config::CI::Heroku do
75
75
  describe '#project_dir' do
76
76
  subject { described_class.new.project_dir }
77
77
 
78
- context 'when environment exists' do
78
+ context 'when the environment exists' do
79
79
  let(:env) { { 'HEROKU_TEST_RUN_ID' => 1234 } }
80
80
  it { should eq '/app' }
81
81
  end
82
82
 
83
- context "when environment doesn't exist" do
83
+ context "when the environment doesn't exist" do
84
84
  it { should be nil }
85
85
  end
86
86
  end
@@ -10,12 +10,12 @@ describe KnapsackPro::Config::CI::Semaphore2 do
10
10
  describe '#node_total' do
11
11
  subject { described_class.new.node_total }
12
12
 
13
- context 'when environment exists' do
13
+ context 'when the environment exists' do
14
14
  let(:env) { { 'SEMAPHORE_JOB_COUNT' => 4 } }
15
15
  it { should eql 4 }
16
16
  end
17
17
 
18
- context "when environment doesn't exist" do
18
+ context "when the environment doesn't exist" do
19
19
  it { should be nil }
20
20
  end
21
21
  end
@@ -23,12 +23,12 @@ describe KnapsackPro::Config::CI::Semaphore2 do
23
23
  describe '#node_index' do
24
24
  subject { described_class.new.node_index }
25
25
 
26
- context 'when environment exists' do
26
+ context 'when the environment exists' do
27
27
  let(:env) { { 'SEMAPHORE_JOB_INDEX' => 4 } }
28
28
  it { should eql 3 }
29
29
  end
30
30
 
31
- context "when environment doesn't exist" do
31
+ context "when the environment doesn't exist" do
32
32
  it { should be nil }
33
33
  end
34
34
  end
@@ -36,12 +36,12 @@ describe KnapsackPro::Config::CI::Semaphore2 do
36
36
  describe '#node_build_id' do
37
37
  subject { described_class.new.node_build_id }
38
38
 
39
- context 'when environment exists' do
39
+ context 'when the environment exists' do
40
40
  let(:env) { { 'SEMAPHORE_WORKFLOW_ID' => 123 } }
41
41
  it { should eql 123 }
42
42
  end
43
43
 
44
- context "when environment doesn't exist" do
44
+ context "when the environment doesn't exist" do
45
45
  it { should be nil }
46
46
  end
47
47
  end
@@ -49,12 +49,12 @@ describe KnapsackPro::Config::CI::Semaphore2 do
49
49
  describe '#commit_hash' do
50
50
  subject { described_class.new.commit_hash }
51
51
 
52
- context 'when environment exists' do
52
+ context 'when the environment exists' do
53
53
  let(:env) { { 'SEMAPHORE_GIT_SHA' => '4323320992a21b1169e3ac5b7789d379597738e6' } }
54
54
  it { should eql '4323320992a21b1169e3ac5b7789d379597738e6' }
55
55
  end
56
56
 
57
- context "when environment doesn't exist" do
57
+ context "when the environment doesn't exist" do
58
58
  it { should be nil }
59
59
  end
60
60
  end
@@ -62,12 +62,12 @@ describe KnapsackPro::Config::CI::Semaphore2 do
62
62
  describe '#branch' do
63
63
  subject { described_class.new.branch }
64
64
 
65
- context 'when environment exists' do
65
+ context 'when the environment exists' do
66
66
  let(:env) { { 'SEMAPHORE_GIT_BRANCH' => 'master' } }
67
67
  it { should eql 'master' }
68
68
  end
69
69
 
70
- context "when environment doesn't exist" do
70
+ context "when the environment doesn't exist" do
71
71
  it { should be nil }
72
72
  end
73
73
  end
@@ -103,7 +103,7 @@ describe KnapsackPro::Config::CI::Semaphore2 do
103
103
  it { should be nil }
104
104
  end
105
105
 
106
- context "when environments don't exist" do
106
+ context "when the environments don't exist" do
107
107
  it { should be nil }
108
108
  end
109
109
  end
@@ -10,12 +10,12 @@ describe KnapsackPro::Config::CI::Semaphore do
10
10
  describe '#node_total' do
11
11
  subject { described_class.new.node_total }
12
12
 
13
- context 'when environment exists' do
13
+ context 'when the environment exists' do
14
14
  let(:env) { { 'SEMAPHORE_THREAD_COUNT' => 4 } }
15
15
  it { should eql 4 }
16
16
  end
17
17
 
18
- context "when environment doesn't exist" do
18
+ context "when the environment doesn't exist" do
19
19
  it { should be nil }
20
20
  end
21
21
  end
@@ -23,12 +23,12 @@ describe KnapsackPro::Config::CI::Semaphore do
23
23
  describe '#node_index' do
24
24
  subject { described_class.new.node_index }
25
25
 
26
- context 'when environment exists' do
26
+ context 'when the environment exists' do
27
27
  let(:env) { { 'SEMAPHORE_CURRENT_THREAD' => 4 } }
28
28
  it { should eql 3 }
29
29
  end
30
30
 
31
- context "when environment doesn't exist" do
31
+ context "when the environment doesn't exist" do
32
32
  it { should be nil }
33
33
  end
34
34
  end
@@ -36,12 +36,12 @@ describe KnapsackPro::Config::CI::Semaphore do
36
36
  describe '#node_build_id' do
37
37
  subject { described_class.new.node_build_id }
38
38
 
39
- context 'when environment exists' do
39
+ context 'when the environment exists' do
40
40
  let(:env) { { 'SEMAPHORE_BUILD_NUMBER' => 23 } }
41
41
  it { should eql 23 }
42
42
  end
43
43
 
44
- context "when environment doesn't exist" do
44
+ context "when the environment doesn't exist" do
45
45
  it { should be nil }
46
46
  end
47
47
  end
@@ -49,12 +49,12 @@ describe KnapsackPro::Config::CI::Semaphore do
49
49
  describe '#commit_hash' do
50
50
  subject { described_class.new.commit_hash }
51
51
 
52
- context 'when environment exists' do
52
+ context 'when the environment exists' do
53
53
  let(:env) { { 'REVISION' => '3fa64859337f6e56409d49f865d13fd7' } }
54
54
  it { should eql '3fa64859337f6e56409d49f865d13fd7' }
55
55
  end
56
56
 
57
- context "when environment doesn't exist" do
57
+ context "when the environment doesn't exist" do
58
58
  it { should be nil }
59
59
  end
60
60
  end
@@ -62,12 +62,12 @@ describe KnapsackPro::Config::CI::Semaphore do
62
62
  describe '#branch' do
63
63
  subject { described_class.new.branch }
64
64
 
65
- context 'when environment exists' do
65
+ context 'when the environment exists' do
66
66
  let(:env) { { 'BRANCH_NAME' => 'master' } }
67
67
  it { should eql 'master' }
68
68
  end
69
69
 
70
- context "when environment doesn't exist" do
70
+ context "when the environment doesn't exist" do
71
71
  it { should be nil }
72
72
  end
73
73
  end
@@ -75,12 +75,12 @@ describe KnapsackPro::Config::CI::Semaphore do
75
75
  describe '#project_dir' do
76
76
  subject { described_class.new.project_dir }
77
77
 
78
- context 'when environment exists' do
78
+ context 'when the environment exists' do
79
79
  let(:env) { { 'SEMAPHORE_PROJECT_DIR' => '/home/runner/knapsack_pro-ruby' } }
80
80
  it { should eql '/home/runner/knapsack_pro-ruby' }
81
81
  end
82
82
 
83
- context "when environment doesn't exist" do
83
+ context "when the environment doesn't exist" do
84
84
  it { should be nil }
85
85
  end
86
86
  end
@@ -22,12 +22,12 @@ describe KnapsackPro::Config::CI::Travis do
22
22
  describe '#node_build_id' do
23
23
  subject { described_class.new.node_build_id }
24
24
 
25
- context 'when environment exists' do
25
+ context 'when the environment exists' do
26
26
  let(:env) { { 'TRAVIS_BUILD_NUMBER' => 4 } }
27
27
  it { should eql 4 }
28
28
  end
29
29
 
30
- context "when environment doesn't exist" do
30
+ context "when the environment doesn't exist" do
31
31
  it { should be nil }
32
32
  end
33
33
  end
@@ -35,12 +35,12 @@ describe KnapsackPro::Config::CI::Travis do
35
35
  describe '#commit_hash' do
36
36
  subject { described_class.new.commit_hash }
37
37
 
38
- context 'when environment exists' do
38
+ context 'when the environment exists' do
39
39
  let(:env) { { 'TRAVIS_COMMIT' => '3fa64859337f6e56409d49f865d13fd7' } }
40
40
  it { should eql '3fa64859337f6e56409d49f865d13fd7' }
41
41
  end
42
42
 
43
- context "when environment doesn't exist" do
43
+ context "when the environment doesn't exist" do
44
44
  it { should be nil }
45
45
  end
46
46
  end
@@ -48,12 +48,12 @@ describe KnapsackPro::Config::CI::Travis do
48
48
  describe '#branch' do
49
49
  subject { described_class.new.branch }
50
50
 
51
- context 'when environment exists' do
51
+ context 'when the environment exists' do
52
52
  let(:env) { { 'TRAVIS_BRANCH' => 'master' } }
53
53
  it { should eql 'master' }
54
54
  end
55
55
 
56
- context "when environment doesn't exist" do
56
+ context "when the environment doesn't exist" do
57
57
  it { should be nil }
58
58
  end
59
59
  end
@@ -61,12 +61,12 @@ describe KnapsackPro::Config::CI::Travis do
61
61
  describe '#project_dir' do
62
62
  subject { described_class.new.project_dir }
63
63
 
64
- context 'when environment exists' do
64
+ context 'when the environment exists' do
65
65
  let(:env) { { 'TRAVIS_BUILD_DIR' => '/home/travis/build/KnapsackPro/rails-app-with-knapsack_pro' } }
66
66
  it { should eql '/home/travis/build/KnapsackPro/rails-app-with-knapsack_pro' }
67
67
  end
68
68
 
69
- context "when environment doesn't exist" do
69
+ context "when the environment doesn't exist" do
70
70
  it { should be nil }
71
71
  end
72
72
  end