@@ -64,7 +64,7 @@ func TestCheck(t *testing.T) {
64
64
},
65
65
66
66
{
67
- description : "check returns the previous version when its still latest " ,
67
+ description : "check returns all open PRs if there is a previous " ,
68
68
source : resource.Source {
69
69
Repository : "itsdalmo/test-repository" ,
70
70
AccessToken : "oauthtoken" ,
@@ -73,6 +73,17 @@ func TestCheck(t *testing.T) {
73
73
pullRequests : testPullRequests ,
74
74
files : [][]string {},
75
75
expected : resource.CheckResponse {
76
+ resource .NewVersion (testPullRequests [14 ], testPullRequests [14 ].Tip .CommittedDate .Time ),
77
+ resource .NewVersion (testPullRequests [13 ], testPullRequests [13 ].Tip .CommittedDate .Time ),
78
+ resource .NewVersion (testPullRequests [12 ], testPullRequests [12 ].Tip .CommittedDate .Time ),
79
+ resource .NewVersion (testPullRequests [11 ], testPullRequests [11 ].Tip .CommittedDate .Time ),
80
+ resource .NewVersion (testPullRequests [8 ], testPullRequests [8 ].Tip .CommittedDate .Time ),
81
+ resource .NewVersion (testPullRequests [7 ], testPullRequests [7 ].Tip .CommittedDate .Time ),
82
+ resource .NewVersion (testPullRequests [6 ], testPullRequests [6 ].Tip .CommittedDate .Time ),
83
+ resource .NewVersion (testPullRequests [5 ], testPullRequests [5 ].Tip .CommittedDate .Time ),
84
+ resource .NewVersion (testPullRequests [4 ], testPullRequests [4 ].Tip .CommittedDate .Time ),
85
+ resource .NewVersion (testPullRequests [3 ], testPullRequests [3 ].Tip .CommittedDate .Time ),
86
+ resource .NewVersion (testPullRequests [2 ], testPullRequests [2 ].Tip .CommittedDate .Time ),
76
87
resource .NewVersion (testPullRequests [1 ], testPullRequests [1 ].Tip .CommittedDate .Time ),
77
88
},
78
89
},
@@ -87,6 +98,16 @@ func TestCheck(t *testing.T) {
87
98
pullRequests : testPullRequests ,
88
99
files : [][]string {},
89
100
expected : resource.CheckResponse {
101
+ resource .NewVersion (testPullRequests [14 ], testPullRequests [14 ].Tip .CommittedDate .Time ),
102
+ resource .NewVersion (testPullRequests [13 ], testPullRequests [13 ].Tip .CommittedDate .Time ),
103
+ resource .NewVersion (testPullRequests [12 ], testPullRequests [12 ].Tip .CommittedDate .Time ),
104
+ resource .NewVersion (testPullRequests [11 ], testPullRequests [11 ].Tip .CommittedDate .Time ),
105
+ resource .NewVersion (testPullRequests [8 ], testPullRequests [8 ].Tip .CommittedDate .Time ),
106
+ resource .NewVersion (testPullRequests [7 ], testPullRequests [7 ].Tip .CommittedDate .Time ),
107
+ resource .NewVersion (testPullRequests [6 ], testPullRequests [6 ].Tip .CommittedDate .Time ),
108
+ resource .NewVersion (testPullRequests [5 ], testPullRequests [5 ].Tip .CommittedDate .Time ),
109
+ resource .NewVersion (testPullRequests [4 ], testPullRequests [4 ].Tip .CommittedDate .Time ),
110
+ resource .NewVersion (testPullRequests [3 ], testPullRequests [3 ].Tip .CommittedDate .Time ),
90
111
resource .NewVersion (testPullRequests [2 ], testPullRequests [2 ].Tip .CommittedDate .Time ),
91
112
resource .NewVersion (testPullRequests [1 ], testPullRequests [1 ].Tip .CommittedDate .Time ),
92
113
},
@@ -107,6 +128,7 @@ func TestCheck(t *testing.T) {
107
128
{"terraform/modules/variables.tf" , "travis.yml" },
108
129
},
109
130
expected : resource.CheckResponse {
131
+ resource .NewVersion (testPullRequests [3 ], testPullRequests [3 ].Tip .CommittedDate .Time ),
110
132
resource .NewVersion (testPullRequests [2 ], testPullRequests [2 ].Tip .CommittedDate .Time ),
111
133
},
112
134
},
@@ -126,6 +148,7 @@ func TestCheck(t *testing.T) {
126
148
{"terraform/modules/variables.tf" , "travis.yml" },
127
149
},
128
150
expected : resource.CheckResponse {
151
+ resource .NewVersion (testPullRequests [3 ], testPullRequests [3 ].Tip .CommittedDate .Time ),
129
152
resource .NewVersion (testPullRequests [2 ], testPullRequests [2 ].Tip .CommittedDate .Time ),
130
153
},
131
154
},
@@ -140,6 +163,18 @@ func TestCheck(t *testing.T) {
140
163
version : resource .NewVersion (testPullRequests [1 ], testPullRequests [1 ].Tip .CommittedDate .Time ),
141
164
pullRequests : testPullRequests ,
142
165
expected : resource.CheckResponse {
166
+ resource .NewVersion (testPullRequests [14 ], testPullRequests [14 ].Tip .CommittedDate .Time ),
167
+ resource .NewVersion (testPullRequests [13 ], testPullRequests [13 ].Tip .CommittedDate .Time ),
168
+ resource .NewVersion (testPullRequests [12 ], testPullRequests [12 ].Tip .CommittedDate .Time ),
169
+ resource .NewVersion (testPullRequests [11 ], testPullRequests [11 ].Tip .CommittedDate .Time ),
170
+ resource .NewVersion (testPullRequests [8 ], testPullRequests [8 ].Tip .CommittedDate .Time ),
171
+ resource .NewVersion (testPullRequests [7 ], testPullRequests [7 ].Tip .CommittedDate .Time ),
172
+ resource .NewVersion (testPullRequests [6 ], testPullRequests [6 ].Tip .CommittedDate .Time ),
173
+ resource .NewVersion (testPullRequests [5 ], testPullRequests [5 ].Tip .CommittedDate .Time ),
174
+ resource .NewVersion (testPullRequests [4 ], testPullRequests [4 ].Tip .CommittedDate .Time ),
175
+ resource .NewVersion (testPullRequests [3 ], testPullRequests [3 ].Tip .CommittedDate .Time ),
176
+ resource .NewVersion (testPullRequests [2 ], testPullRequests [2 ].Tip .CommittedDate .Time ),
177
+ resource .NewVersion (testPullRequests [1 ], testPullRequests [1 ].Tip .CommittedDate .Time ),
143
178
resource .NewVersion (testPullRequests [0 ], testPullRequests [0 ].Tip .CommittedDate .Time ),
144
179
},
145
180
},
@@ -154,6 +189,16 @@ func TestCheck(t *testing.T) {
154
189
version : resource .NewVersion (testPullRequests [3 ], testPullRequests [3 ].Tip .CommittedDate .Time ),
155
190
pullRequests : testPullRequests ,
156
191
expected : resource.CheckResponse {
192
+ resource .NewVersion (testPullRequests [14 ], testPullRequests [14 ].Tip .CommittedDate .Time ),
193
+ resource .NewVersion (testPullRequests [13 ], testPullRequests [13 ].Tip .CommittedDate .Time ),
194
+ resource .NewVersion (testPullRequests [12 ], testPullRequests [12 ].Tip .CommittedDate .Time ),
195
+ resource .NewVersion (testPullRequests [11 ], testPullRequests [11 ].Tip .CommittedDate .Time ),
196
+ resource .NewVersion (testPullRequests [8 ], testPullRequests [8 ].Tip .CommittedDate .Time ),
197
+ resource .NewVersion (testPullRequests [7 ], testPullRequests [7 ].Tip .CommittedDate .Time ),
198
+ resource .NewVersion (testPullRequests [6 ], testPullRequests [6 ].Tip .CommittedDate .Time ),
199
+ resource .NewVersion (testPullRequests [5 ], testPullRequests [5 ].Tip .CommittedDate .Time ),
200
+ resource .NewVersion (testPullRequests [4 ], testPullRequests [4 ].Tip .CommittedDate .Time ),
201
+ resource .NewVersion (testPullRequests [3 ], testPullRequests [3 ].Tip .CommittedDate .Time ),
157
202
resource .NewVersion (testPullRequests [1 ], testPullRequests [1 ].Tip .CommittedDate .Time ),
158
203
},
159
204
},
@@ -168,6 +213,16 @@ func TestCheck(t *testing.T) {
168
213
version : resource .NewVersion (testPullRequests [3 ], testPullRequests [3 ].Tip .CommittedDate .Time ),
169
214
pullRequests : testPullRequests ,
170
215
expected : resource.CheckResponse {
216
+ resource .NewVersion (testPullRequests [14 ], testPullRequests [14 ].Tip .CommittedDate .Time ),
217
+ resource .NewVersion (testPullRequests [13 ], testPullRequests [13 ].Tip .CommittedDate .Time ),
218
+ resource .NewVersion (testPullRequests [12 ], testPullRequests [12 ].Tip .CommittedDate .Time ),
219
+ resource .NewVersion (testPullRequests [11 ], testPullRequests [11 ].Tip .CommittedDate .Time ),
220
+ resource .NewVersion (testPullRequests [8 ], testPullRequests [8 ].Tip .CommittedDate .Time ),
221
+ resource .NewVersion (testPullRequests [7 ], testPullRequests [7 ].Tip .CommittedDate .Time ),
222
+ resource .NewVersion (testPullRequests [6 ], testPullRequests [6 ].Tip .CommittedDate .Time ),
223
+ resource .NewVersion (testPullRequests [5 ], testPullRequests [5 ].Tip .CommittedDate .Time ),
224
+ resource .NewVersion (testPullRequests [4 ], testPullRequests [4 ].Tip .CommittedDate .Time ),
225
+ resource .NewVersion (testPullRequests [3 ], testPullRequests [3 ].Tip .CommittedDate .Time ),
171
226
resource .NewVersion (testPullRequests [2 ], testPullRequests [2 ].Tip .CommittedDate .Time ),
172
227
resource .NewVersion (testPullRequests [1 ], testPullRequests [1 ].Tip .CommittedDate .Time ),
173
228
},
@@ -183,6 +238,14 @@ func TestCheck(t *testing.T) {
183
238
version : resource .NewVersion (testPullRequests [5 ], testPullRequests [5 ].Tip .CommittedDate .Time ),
184
239
pullRequests : testPullRequests ,
185
240
expected : resource.CheckResponse {
241
+ resource .NewVersion (testPullRequests [14 ], testPullRequests [14 ].Tip .CommittedDate .Time ),
242
+ resource .NewVersion (testPullRequests [13 ], testPullRequests [13 ].Tip .CommittedDate .Time ),
243
+ resource .NewVersion (testPullRequests [12 ], testPullRequests [12 ].Tip .CommittedDate .Time ),
244
+ resource .NewVersion (testPullRequests [11 ], testPullRequests [11 ].Tip .CommittedDate .Time ),
245
+ resource .NewVersion (testPullRequests [8 ], testPullRequests [8 ].Tip .CommittedDate .Time ),
246
+ resource .NewVersion (testPullRequests [7 ], testPullRequests [7 ].Tip .CommittedDate .Time ),
247
+ resource .NewVersion (testPullRequests [6 ], testPullRequests [6 ].Tip .CommittedDate .Time ),
248
+ resource .NewVersion (testPullRequests [5 ], testPullRequests [5 ].Tip .CommittedDate .Time ),
186
249
resource .NewVersion (testPullRequests [3 ], testPullRequests [3 ].Tip .CommittedDate .Time ),
187
250
resource .NewVersion (testPullRequests [2 ], testPullRequests [2 ].Tip .CommittedDate .Time ),
188
251
resource .NewVersion (testPullRequests [1 ], testPullRequests [1 ].Tip .CommittedDate .Time ),
0 commit comments