@@ -2,14 +2,14 @@ package resource_test
22
33import (
44 "fmt"
5- "io/ioutil "
5+ "io"
66 "net/http"
77 "net/url"
88 "time"
99
1010 . "github.com/concourse/github-release-resource"
1111
12- . "github.com/onsi/ginkgo"
12+ . "github.com/onsi/ginkgo/v2 "
1313 . "github.com/onsi/gomega"
1414
1515 "github.com/google/go-github/v66/github"
@@ -276,9 +276,36 @@ var _ = Describe("GitHub Client", func() {
276276 Expect (releases ).To (HaveLen (3 ))
277277 Expect (server .ReceivedRequests ()).To (HaveLen (2 ))
278278 Expect (releases ).To (Equal ([]* github.RepositoryRelease {
279- {TagName : github .String ("xyz" ), Name : github .String ("xyz" ), Draft : github .Bool (false ), Prerelease : github .Bool (false ), ID : github .Int64 (32095103 ), CreatedAt : & github.Timestamp {time .Date (2010 , time .October , 01 , 00 , 58 , 07 , 0 , time .UTC )}, PublishedAt : & github.Timestamp {time .Date (2010 , time .October , 02 , 15 , 39 , 53 , 0 , time .UTC )}, URL : github .String ("https://github.com/xyz/xyz/releases/tag/xyz" )},
280- {TagName : github .String ("xyz" ), Name : github .String ("xyz" ), Draft : github .Bool (false ), Prerelease : github .Bool (false ), ID : github .Int64 (30230659 ), CreatedAt : & github.Timestamp {time .Date (2010 , time .August , 27 , 13 , 55 , 36 , 0 , time .UTC )}, PublishedAt : & github.Timestamp {time .Date (2010 , time .August , 27 , 17 , 18 , 06 , 0 , time .UTC )}, URL : github .String ("https://github.com/xyz/xyz/releases/tag/xyz" )},
281- {TagName : github .String ("xyq" ), Name : github .String ("xyq" ), Draft : github .Bool (false ), Prerelease : github .Bool (false ), ID : github .Int64 (33222243 ), CreatedAt : & github.Timestamp {time .Date (2010 , time .October , 10 , 01 , 01 , 07 , 0 , time .UTC )}, PublishedAt : & github.Timestamp {time .Date (2010 , time .October , 10 , 15 , 39 , 53 , 0 , time .UTC )}, URL : github .String ("https://github.com/xyq/xyq/releases/tag/xyq" )},
279+ {
280+ TagName : github .String ("xyz" ),
281+ Name : github .String ("xyz" ),
282+ Draft : github .Bool (false ),
283+ Prerelease : github .Bool (false ),
284+ ID : github .Int64 (32095103 ),
285+ CreatedAt : & github.Timestamp {Time : time .Date (2010 , time .October , 01 , 00 , 58 , 07 , 0 , time .UTC )},
286+ PublishedAt : & github.Timestamp {Time : time .Date (2010 , time .October , 02 , 15 , 39 , 53 , 0 , time .UTC )},
287+ URL : github .String ("https://github.com/xyz/xyz/releases/tag/xyz" ),
288+ },
289+ {
290+ TagName : github .String ("xyz" ),
291+ Name : github .String ("xyz" ),
292+ Draft : github .Bool (false ),
293+ Prerelease : github .Bool (false ),
294+ ID : github .Int64 (30230659 ),
295+ CreatedAt : & github.Timestamp {Time : time .Date (2010 , time .August , 27 , 13 , 55 , 36 , 0 , time .UTC )},
296+ PublishedAt : & github.Timestamp {Time : time .Date (2010 , time .August , 27 , 17 , 18 , 06 , 0 , time .UTC )},
297+ URL : github .String ("https://github.com/xyz/xyz/releases/tag/xyz" ),
298+ },
299+ {
300+ TagName : github .String ("xyq" ),
301+ Name : github .String ("xyq" ),
302+ Draft : github .Bool (false ),
303+ Prerelease : github .Bool (false ),
304+ ID : github .Int64 (33222243 ),
305+ CreatedAt : & github.Timestamp {Time : time .Date (2010 , time .October , 10 , 01 , 01 , 07 , 0 , time .UTC )},
306+ PublishedAt : & github.Timestamp {Time : time .Date (2010 , time .October , 10 , 15 , 39 , 53 , 0 , time .UTC )},
307+ URL : github .String ("https://github.com/xyq/xyq/releases/tag/xyq" ),
308+ },
282309 }))
283310 })
284311 })
@@ -574,7 +601,7 @@ var _ = Describe("GitHub Client", func() {
574601 Expect (err ).NotTo (HaveOccurred ())
575602 defer readCloser .Close ()
576603
577- body , err := ioutil .ReadAll (readCloser )
604+ body , err := io .ReadAll (readCloser )
578605 Expect (err ).NotTo (HaveOccurred ())
579606 Expect (string (body )).To (Equal (fileContents ))
580607 })
@@ -613,7 +640,7 @@ var _ = Describe("GitHub Client", func() {
613640 Expect (err ).NotTo (HaveOccurred ())
614641 defer readCloser .Close ()
615642
616- body , err := ioutil .ReadAll (readCloser )
643+ body , err := io .ReadAll (readCloser )
617644 Expect (err ).NotTo (HaveOccurred ())
618645 Expect (string (body )).To (Equal (redirectFileContents ))
619646 })
@@ -635,7 +662,7 @@ var _ = Describe("GitHub Client", func() {
635662 Expect (err ).NotTo (HaveOccurred ())
636663 defer readCloser .Close ()
637664
638- body , err := ioutil .ReadAll (readCloser )
665+ body , err := io .ReadAll (readCloser )
639666 Expect (err ).NotTo (HaveOccurred ())
640667 Expect (string (body )).To (Equal (redirectFileContents ))
641668 })
@@ -663,7 +690,7 @@ var _ = Describe("GitHub Client", func() {
663690 Expect (err ).NotTo (HaveOccurred ())
664691 defer readCloser .Close ()
665692
666- body , err := ioutil .ReadAll (readCloser )
693+ body , err := io .ReadAll (readCloser )
667694 Expect (err ).NotTo (HaveOccurred ())
668695 Expect (string (body )).To (Equal (redirectFileContents ))
669696 })
@@ -745,7 +772,7 @@ var _ = Describe("GitHub Client", func() {
745772 Expect (err ).NotTo (HaveOccurred ())
746773 defer readCloser .Close ()
747774
748- body , err := ioutil .ReadAll (readCloser )
775+ body , err := io .ReadAll (readCloser )
749776 Expect (err ).NotTo (HaveOccurred ())
750777 Expect (string (body )).To (Equal (redirectFileContents ))
751778 })
0 commit comments