tracker_deliveries 1.0.0 → 1.0.1
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.
- checksums.yaml +4 -4
- data/integration_spec/run +11 -0
- data/integration_spec/tracker_deliveries_integration_spec.rb +39 -38
- data/lib/tracker_deliveries/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4c714eefc1613bcf2d507d8fa785cd1f29a83a8
|
4
|
+
data.tar.gz: 123b8421cc7f07715b85e9974c78c31b0f543175
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 548cca2637c15fab06567531bb21a5edc92d4b903ca37dbd212a8908d19f5d27e52619e5a96f0d918599806a9a6d4bf77c7071698fd4d03ac87b0bf1ce1e6d44
|
7
|
+
data.tar.gz: e86343cc52b9b20d4849c1505d1dc6b43284f4d8c45227f8154f57ce4c2311170d6f9902b7a351493590317f3f7d52391ca01dc72cd696dd4bb9295b0cffa614
|
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
# -*- mode: sh -*-
|
3
|
+
bundle exec \
|
4
|
+
ruby \
|
5
|
+
integration_spec/fake_pivotal_tracker.rb \
|
6
|
+
-o 127.0.0.1 \
|
7
|
+
-p 4567 \
|
8
|
+
&
|
9
|
+
FAKE_PIVOTAL_TRACKER_PID=$!
|
10
|
+
rspec integration_spec/tracker_deliveries_integration_spec.rb
|
11
|
+
kill $FAKE_PIVOTAL_TRACKER_PID
|
@@ -13,35 +13,36 @@ describe 'tracker_deliveries' do
|
|
13
13
|
let(:env) { '' }
|
14
14
|
let(:options) { '' }
|
15
15
|
let(:command) { "#{env} ruby -Ilib exe/tracker_deliveries #{options}" }
|
16
|
+
let(:output) { capture_shell(command) }
|
16
17
|
|
17
18
|
it 'aborts with an API_TOKEN error and usage notes when no mandatory options or usable environment is provided' do
|
18
|
-
expect(
|
19
|
-
expect(
|
20
|
-
expect(
|
21
|
-
expect(
|
22
|
-
expect(
|
19
|
+
expect(output[:stdout]).to eq ''
|
20
|
+
expect(output[:stderr]).to include Main::FATAL_MESSAGE_API_TOKEN
|
21
|
+
expect(output[:stderr]).to include 'Tracker Deliveries'
|
22
|
+
expect(output[:stderr]).to include 'Usage'
|
23
|
+
expect(output[:stderr]).to include ''
|
23
24
|
end
|
24
25
|
|
25
26
|
context 'only api_token' do
|
26
27
|
context 'in environment' do
|
27
28
|
let(:env) { 'TRACKER_DELIVERIES_API_TOKEN=FAKE_TOKEN' }
|
28
29
|
it 'aborts with a PROJECT_ID error and usage notes when no mandatory options or usable environment is provided' do
|
29
|
-
expect(
|
30
|
-
expect(
|
31
|
-
expect(
|
32
|
-
expect(
|
33
|
-
expect(
|
30
|
+
expect(output[:stdout]).to eq ''
|
31
|
+
expect(output[:stderr]).to include Main::FATAL_MESSAGE_PROJECT_ID
|
32
|
+
expect(output[:stderr]).to include 'Tracker Deliveries'
|
33
|
+
expect(output[:stderr]).to include 'Usage'
|
34
|
+
expect(output[:stderr]).to include ''
|
34
35
|
end
|
35
36
|
end
|
36
37
|
|
37
38
|
context 'in option switch' do
|
38
39
|
let(:options) { '--tracker:token=fake_token' }
|
39
40
|
it 'aborts with a PROJECT_ID error and usage notes when no mandatory options or usable environment is provided' do
|
40
|
-
expect(
|
41
|
-
expect(
|
42
|
-
expect(
|
43
|
-
expect(
|
44
|
-
expect(
|
41
|
+
expect(output[:stdout]).to eq ''
|
42
|
+
expect(output[:stderr]).to include Main::FATAL_MESSAGE_PROJECT_ID
|
43
|
+
expect(output[:stderr]).to include 'Tracker Deliveries'
|
44
|
+
expect(output[:stderr]).to include 'Usage'
|
45
|
+
expect(output[:stderr]).to include ''
|
45
46
|
end
|
46
47
|
end
|
47
48
|
end
|
@@ -50,11 +51,11 @@ describe 'tracker_deliveries' do
|
|
50
51
|
context 'in environment' do
|
51
52
|
let(:env) { 'TRACKER_DELIVERIES_PROJECT_ID=1234' }
|
52
53
|
it 'aborts with a PROJECT_ID error and usage notes when no mandatory options or usable environment is provided' do
|
53
|
-
expect(
|
54
|
-
expect(
|
55
|
-
expect(
|
56
|
-
expect(
|
57
|
-
expect(
|
54
|
+
expect(output[:stdout]).to eq ''
|
55
|
+
expect(output[:stderr]).to include Main::FATAL_MESSAGE_API_TOKEN
|
56
|
+
expect(output[:stderr]).to include 'Tracker Deliveries'
|
57
|
+
expect(output[:stderr]).to include 'Usage'
|
58
|
+
expect(output[:stderr]).to include ''
|
58
59
|
end
|
59
60
|
end
|
60
61
|
|
@@ -62,22 +63,22 @@ describe 'tracker_deliveries' do
|
|
62
63
|
context 'with =' do
|
63
64
|
let(:options) { '--tracker:project=1234' }
|
64
65
|
it 'aborts with a PROJECT_ID error and usage notes when no mandatory options or usable environment is provided' do
|
65
|
-
expect(
|
66
|
-
expect(
|
67
|
-
expect(
|
68
|
-
expect(
|
69
|
-
expect(
|
66
|
+
expect(output[:stdout]).to eq ''
|
67
|
+
expect(output[:stderr]).to include Main::FATAL_MESSAGE_API_TOKEN
|
68
|
+
expect(output[:stderr]).to include 'Tracker Deliveries'
|
69
|
+
expect(output[:stderr]).to include 'Usage'
|
70
|
+
expect(output[:stderr]).to include ''
|
70
71
|
end
|
71
72
|
end
|
72
73
|
|
73
74
|
context 'with space' do
|
74
75
|
let(:options) { '--tracker:project 1234' }
|
75
76
|
it 'aborts with a PROJECT_ID error and usage notes when no mandatory options or usable environment is provided' do
|
76
|
-
expect(
|
77
|
-
expect(
|
78
|
-
expect(
|
79
|
-
expect(
|
80
|
-
expect(
|
77
|
+
expect(output[:stdout]).to eq ''
|
78
|
+
expect(output[:stderr]).to include Main::FATAL_MESSAGE_API_TOKEN
|
79
|
+
expect(output[:stderr]).to include 'Tracker Deliveries'
|
80
|
+
expect(output[:stderr]).to include 'Usage'
|
81
|
+
expect(output[:stderr]).to include ''
|
81
82
|
end
|
82
83
|
end
|
83
84
|
end
|
@@ -95,31 +96,31 @@ describe 'tracker_deliveries' do
|
|
95
96
|
context 'env' do
|
96
97
|
let(:env) { 'TRACKER_DELIVERIES_PROJECT_ID=1234 TRACKER_DELIVERIES_API_TOKEN=FAKE' }
|
97
98
|
it 'Connects to Pivotal Tracker with project and api token' do
|
98
|
-
expect(
|
99
|
-
expect(
|
99
|
+
expect(output[:stderr].chomp).to eq ''
|
100
|
+
expect(output[:stdout].chomp).to eq "123456 - Story one\n654321 - Story two"
|
100
101
|
end
|
101
102
|
end
|
102
103
|
|
103
104
|
context 'options' do
|
104
105
|
let(:options) { '--tracker:project=1234 --tracker:token=FAKE' }
|
105
106
|
it 'Connects to Pivotal Tracker with project and api token' do
|
106
|
-
expect(
|
107
|
-
expect(
|
107
|
+
expect(output[:stderr].chomp).to eq ''
|
108
|
+
expect(output[:stdout].chomp).to eq "123456 - Story one\n654321 - Story two"
|
108
109
|
end
|
109
110
|
end
|
110
111
|
|
111
112
|
context 'project not found' do
|
112
113
|
let(:options) { '--tracker:project=404 --tracker:token=FAKE' }
|
113
114
|
it 'Connects to Pivotal Tracker and passes back a 404 error' do
|
114
|
-
expect(
|
115
|
-
expect(
|
115
|
+
expect(output[:stderr].chomp).to eq 'PivotalTracker responded with: 404 (Not Found) project: 404, api_token: FAKE'
|
116
|
+
expect(output[:stdout].chomp).to eq ''
|
116
117
|
end
|
117
118
|
end
|
118
119
|
context 'no access to project' do
|
119
120
|
let(:options) { '--tracker:project=403 --tracker:token=FAKE' }
|
120
121
|
it 'Connects to Pivotal Tracker and passes back a 403 error' do
|
121
|
-
expect(
|
122
|
-
expect(
|
122
|
+
expect(output[:stderr].chomp).to eq 'PivotalTracker responded with: 403 (Forbidden) project: 403, api_token: FAKE'
|
123
|
+
expect(output[:stdout].chomp).to eq ''
|
123
124
|
end
|
124
125
|
end
|
125
126
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tracker_deliveries
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Milkins
|
@@ -116,6 +116,7 @@ files:
|
|
116
116
|
- bin/setup
|
117
117
|
- exe/tracker_deliveries
|
118
118
|
- integration_spec/fake_pivotal_tracker.rb
|
119
|
+
- integration_spec/run
|
119
120
|
- integration_spec/tracker_deliveries_integration_spec.rb
|
120
121
|
- lib/tracker_deliveries.rb
|
121
122
|
- lib/tracker_deliveries/formatters/format/html.rb
|