tracker_deliveries 1.0.0 → 1.0.1

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: a3009563d0b297464d4de9ef7a1bb383ad41eeb8
4
- data.tar.gz: '0729d0990542799323f21c99fdfdf18b0cc26851'
3
+ metadata.gz: c4c714eefc1613bcf2d507d8fa785cd1f29a83a8
4
+ data.tar.gz: 123b8421cc7f07715b85e9974c78c31b0f543175
5
5
  SHA512:
6
- metadata.gz: c14697e7adaf55e8d27e28f13dd5e33317297ac4932d887cce86b2a3f5e52db4dc404015dc3b12b504687cb6cecb9279571b5ac9c4eda13a657bbf5e12c29f49
7
- data.tar.gz: f89d108d9c59a6380ad2a3ee45c0df98c7909dc6acac6d5fc993a9e0b34c15980ed97c8bfed864de678731a51b856d0d82f22f4840176965f004b25267173e8d
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(capture_shell(command)[:stdout]).to eq ''
19
- expect(capture_shell(command)[:stderr]).to include Main::FATAL_MESSAGE_API_TOKEN
20
- expect(capture_shell(command)[:stderr]).to include 'Tracker Deliveries'
21
- expect(capture_shell(command)[:stderr]).to include 'Usage'
22
- expect(capture_shell(command)[:stderr]).to include ''
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(capture_shell(command)[:stdout]).to eq ''
30
- expect(capture_shell(command)[:stderr]).to include Main::FATAL_MESSAGE_PROJECT_ID
31
- expect(capture_shell(command)[:stderr]).to include 'Tracker Deliveries'
32
- expect(capture_shell(command)[:stderr]).to include 'Usage'
33
- expect(capture_shell(command)[:stderr]).to include ''
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(capture_shell(command)[:stdout]).to eq ''
41
- expect(capture_shell(command)[:stderr]).to include Main::FATAL_MESSAGE_PROJECT_ID
42
- expect(capture_shell(command)[:stderr]).to include 'Tracker Deliveries'
43
- expect(capture_shell(command)[:stderr]).to include 'Usage'
44
- expect(capture_shell(command)[:stderr]).to include ''
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(capture_shell(command)[:stdout]).to eq ''
54
- expect(capture_shell(command)[:stderr]).to include Main::FATAL_MESSAGE_API_TOKEN
55
- expect(capture_shell(command)[:stderr]).to include 'Tracker Deliveries'
56
- expect(capture_shell(command)[:stderr]).to include 'Usage'
57
- expect(capture_shell(command)[:stderr]).to include ''
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(capture_shell(command)[:stdout]).to eq ''
66
- expect(capture_shell(command)[:stderr]).to include Main::FATAL_MESSAGE_API_TOKEN
67
- expect(capture_shell(command)[:stderr]).to include 'Tracker Deliveries'
68
- expect(capture_shell(command)[:stderr]).to include 'Usage'
69
- expect(capture_shell(command)[:stderr]).to include ''
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(capture_shell(command)[:stdout]).to eq ''
77
- expect(capture_shell(command)[:stderr]).to include Main::FATAL_MESSAGE_API_TOKEN
78
- expect(capture_shell(command)[:stderr]).to include 'Tracker Deliveries'
79
- expect(capture_shell(command)[:stderr]).to include 'Usage'
80
- expect(capture_shell(command)[:stderr]).to include ''
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((capture_shell(command)[:stderr]).chomp).to eq ''
99
- expect((capture_shell(command)[:stdout]).chomp).to eq "123456 - Story one\n654321 - Story two"
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((capture_shell(command)[:stderr]).chomp).to eq ''
107
- expect((capture_shell(command)[:stdout]).chomp).to eq "123456 - Story one\n654321 - Story two"
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((capture_shell(command)[:stderr]).chomp).to eq 'PivotalTracker responded with: 404 (Not Found) project: 404, api_token: FAKE'
115
- expect((capture_shell(command)[:stdout]).chomp).to eq ''
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((capture_shell(command)[:stderr]).chomp).to eq 'PivotalTracker responded with: 403 (Forbidden) project: 403, api_token: FAKE'
122
- expect((capture_shell(command)[:stdout]).chomp).to eq ''
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
@@ -1,3 +1,3 @@
1
1
  module TrackerDeliveries
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  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.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