@@ -64,7 +64,7 @@ func TestCheck(t *testing.T) {
64
64
},
65
65
66
66
{
67
- description : "check returns all open PRs if there is a previous " ,
67
+ description : "check returns the previous version when its still latest " ,
68
68
source : resource.Source {
69
69
Repository : "itsdalmo/test-repository" ,
70
70
AccessToken : "oauthtoken" ,
@@ -73,15 +73,7 @@ func TestCheck(t *testing.T) {
73
73
pullRequests : testPullRequests ,
74
74
files : [][]string {},
75
75
expected : resource.CheckResponse {
76
- resource .NewVersion (testPullRequests [8 ], testPullRequests [8 ].Tip .CommittedDate .Time ),
77
- resource .NewVersion (testPullRequests [7 ], testPullRequests [7 ].Tip .CommittedDate .Time ),
78
- resource .NewVersion (testPullRequests [6 ], testPullRequests [6 ].Tip .CommittedDate .Time ),
79
- resource .NewVersion (testPullRequests [5 ], testPullRequests [5 ].Tip .CommittedDate .Time ),
80
- resource .NewVersion (testPullRequests [4 ], testPullRequests [4 ].Tip .CommittedDate .Time ),
81
- resource .NewVersion (testPullRequests [3 ], testPullRequests [3 ].Tip .CommittedDate .Time ),
82
- resource .NewVersion (testPullRequests [2 ], testPullRequests [2 ].Tip .CommittedDate .Time ),
83
76
resource .NewVersion (testPullRequests [1 ], testPullRequests [1 ].Tip .CommittedDate .Time ),
84
-
85
77
},
86
78
},
87
79
@@ -115,7 +107,6 @@ func TestCheck(t *testing.T) {
115
107
{"terraform/modules/variables.tf" , "travis.yml" },
116
108
},
117
109
expected : resource.CheckResponse {
118
- resource .NewVersion (testPullRequests [3 ], testPullRequests [3 ].Tip .CommittedDate .Time ),
119
110
resource .NewVersion (testPullRequests [2 ], testPullRequests [2 ].Tip .CommittedDate .Time ),
120
111
},
121
112
},
@@ -135,7 +126,6 @@ func TestCheck(t *testing.T) {
135
126
{"terraform/modules/variables.tf" , "travis.yml" },
136
127
},
137
128
expected : resource.CheckResponse {
138
- resource .NewVersion (testPullRequests [3 ], testPullRequests [3 ].Tip .CommittedDate .Time ),
139
129
resource .NewVersion (testPullRequests [2 ], testPullRequests [2 ].Tip .CommittedDate .Time ),
140
130
},
141
131
},
@@ -150,14 +140,6 @@ func TestCheck(t *testing.T) {
150
140
version : resource .NewVersion (testPullRequests [1 ], testPullRequests [1 ].Tip .CommittedDate .Time ),
151
141
pullRequests : testPullRequests ,
152
142
expected : resource.CheckResponse {
153
- resource .NewVersion (testPullRequests [8 ], testPullRequests [8 ].Tip .CommittedDate .Time ),
154
- resource .NewVersion (testPullRequests [7 ], testPullRequests [7 ].Tip .CommittedDate .Time ),
155
- resource .NewVersion (testPullRequests [6 ], testPullRequests [6 ].Tip .CommittedDate .Time ),
156
- resource .NewVersion (testPullRequests [5 ], testPullRequests [5 ].Tip .CommittedDate .Time ),
157
- resource .NewVersion (testPullRequests [4 ], testPullRequests [4 ].Tip .CommittedDate .Time ),
158
- resource .NewVersion (testPullRequests [3 ], testPullRequests [3 ].Tip .CommittedDate .Time ),
159
- resource .NewVersion (testPullRequests [2 ], testPullRequests [2 ].Tip .CommittedDate .Time ),
160
- resource .NewVersion (testPullRequests [1 ], testPullRequests [1 ].Tip .CommittedDate .Time ),
161
143
resource .NewVersion (testPullRequests [0 ], testPullRequests [0 ].Tip .CommittedDate .Time ),
162
144
},
163
145
},
@@ -201,10 +183,6 @@ func TestCheck(t *testing.T) {
201
183
version : resource .NewVersion (testPullRequests [5 ], testPullRequests [5 ].Tip .CommittedDate .Time ),
202
184
pullRequests : testPullRequests ,
203
185
expected : resource.CheckResponse {
204
- resource .NewVersion (testPullRequests [8 ], testPullRequests [8 ].Tip .CommittedDate .Time ),
205
- resource .NewVersion (testPullRequests [7 ], testPullRequests [7 ].Tip .CommittedDate .Time ),
206
- resource .NewVersion (testPullRequests [6 ], testPullRequests [6 ].Tip .CommittedDate .Time ),
207
- resource .NewVersion (testPullRequests [5 ], testPullRequests [5 ].Tip .CommittedDate .Time ),
208
186
resource .NewVersion (testPullRequests [3 ], testPullRequests [3 ].Tip .CommittedDate .Time ),
209
187
resource .NewVersion (testPullRequests [2 ], testPullRequests [2 ].Tip .CommittedDate .Time ),
210
188
resource .NewVersion (testPullRequests [1 ], testPullRequests [1 ].Tip .CommittedDate .Time ),
0 commit comments