Bump github.com/bradleyjkemp/cupaloy to v2.8.0

This commit is contained in:
Deluan 2022-12-05 22:45:02 -05:00
parent 879992eb33
commit 0cc1db54d4
76 changed files with 15 additions and 13 deletions

2
go.mod
View file

@ -7,7 +7,7 @@ require (
github.com/Masterminds/squirrel v1.5.3
github.com/ReneKroon/ttlcache/v2 v2.11.0
github.com/beego/beego/v2 v2.0.6
github.com/bradleyjkemp/cupaloy v2.3.0+incompatible
github.com/bradleyjkemp/cupaloy/v2 v2.8.0
github.com/cespare/reflex v0.3.1
github.com/deluan/rest v0.0.0-20211101235434-380523c4bb47
github.com/dhowden/tag v0.0.0-20220618230019-adf36e896086

4
go.sum
View file

@ -95,8 +95,8 @@ github.com/blizzy78/varnamelen v0.8.0 h1:oqSblyuQvFsW1hbBHh1zfwrKe3kcSj0rnXkKzsQ
github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k=
github.com/bombsimon/wsl/v3 v3.3.0 h1:Mka/+kRLoQJq7g2rggtgQsjuI/K5Efd87WX96EWFxjM=
github.com/bombsimon/wsl/v3 v3.3.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc=
github.com/bradleyjkemp/cupaloy v2.3.0+incompatible h1:UafIjBvWQmS9i/xRg+CamMrnLTKNzo+bdmT/oH34c2Y=
github.com/bradleyjkemp/cupaloy v2.3.0+incompatible/go.mod h1:Au1Xw1sgaJ5iSFktEhYsS0dbQiS1B0/XMXl+42y9Ilk=
github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M=
github.com/bradleyjkemp/cupaloy/v2 v2.8.0/go.mod h1:bm7JXdkRd4BHJk9HpwqAI8BoAY1lps46Enkdqw6aRX0=
github.com/breml/bidichk v0.2.3 h1:qe6ggxpTfA8E75hdjWPZ581sY3a2lnl0IRxLQFelECI=
github.com/breml/bidichk v0.2.3/go.mod h1:8u2C6DnAy0g2cEq+k/A2+tr9O1s+vHGxWn0LTc70T2A=
github.com/breml/errchkjson v0.3.0 h1:YdDqhfqMT+I1vIxPSas44P+9Z9HzJwCeAzjB8PxP1xw=

View file

@ -0,0 +1 @@
{"status":"ok","version":"1.8.0","type":"navidrome","serverVersion":"v0.0.0","artistInfo":{"biography":"Black Sabbath is an English \u003ca target='_blank' href=\"http://www.last.fm/tag/heavy%20metal\" class=\"bbcode_tag\" rel=\"tag\"\u003eheavy metal\u003c/a\u003e band","musicBrainzId":"5182c1d9-c7d2-4dad-afa0-ccfeada921a8","lastFmUrl":"https://www.last.fm/music/Black+Sabbath","smallImageUrl":"https://userserve-ak.last.fm/serve/64/27904353.jpg","mediumImageUrl":"https://userserve-ak.last.fm/serve/126/27904353.jpg","largeImageUrl":"https://userserve-ak.last.fm/serve/_/27904353/Black+Sabbath+sabbath+1970.jpg","similarArtist":[{"id":"22","name":"Accept"},{"id":"101","name":"Bruce Dickinson"},{"id":"26","name":"Aerosmith"}]}}

View file

@ -0,0 +1 @@
<subsonic-response xmlns="http://subsonic.org/restapi" status="ok" version="1.8.0" type="navidrome" serverVersion="v0.0.0"><artistInfo><biography>Black Sabbath is an English &lt;a target=&#39;_blank&#39; href=&#34;http://www.last.fm/tag/heavy%20metal&#34; class=&#34;bbcode_tag&#34; rel=&#34;tag&#34;&gt;heavy metal&lt;/a&gt; band</biography><musicBrainzId>5182c1d9-c7d2-4dad-afa0-ccfeada921a8</musicBrainzId><lastFmUrl>https://www.last.fm/music/Black+Sabbath</lastFmUrl><smallImageUrl>https://userserve-ak.last.fm/serve/64/27904353.jpg</smallImageUrl><mediumImageUrl>https://userserve-ak.last.fm/serve/126/27904353.jpg</mediumImageUrl><largeImageUrl>https://userserve-ak.last.fm/serve/_/27904353/Black+Sabbath+sabbath+1970.jpg</largeImageUrl><similarArtist id="22" name="Accept"></similarArtist><similarArtist id="101" name="Bruce Dickinson"></similarArtist><similarArtist id="26" name="Aerosmith"></similarArtist></artistInfo></subsonic-response>

View file

@ -1 +0,0 @@
{"status":"ok","version":"1.8.0","type":"navidrome","serverVersion":"v0.0.0","artistInfo":{"biography":"Black Sabbath is an English \u003ca target='_blank' href=\"http://www.last.fm/tag/heavy%20metal\" class=\"bbcode_tag\" rel=\"tag\"\u003eheavy metal\u003c/a\u003e band","musicBrainzId":"5182c1d9-c7d2-4dad-afa0-ccfeada921a8","lastFmUrl":"http://www.last.fm/music/Black+Sabbath","smallImageUrl":"http://userserve-ak.last.fm/serve/64/27904353.jpg","mediumImageUrl":"http://userserve-ak.last.fm/serve/126/27904353.jpg","largeImageUrl":"http://userserve-ak.last.fm/serve/_/27904353/Black+Sabbath+sabbath+1970.jpg","similarArtist":[{"id":"22","name":"Accept"},{"id":"101","name":"Bruce Dickinson"},{"id":"26","name":"Aerosmith"}]}}

View file

@ -1 +0,0 @@
<subsonic-response xmlns="http://subsonic.org/restapi" status="ok" version="1.8.0" type="navidrome" serverVersion="v0.0.0"><artistInfo><biography>Black Sabbath is an English &lt;a target=&#39;_blank&#39; href=&#34;http://www.last.fm/tag/heavy%20metal&#34; class=&#34;bbcode_tag&#34; rel=&#34;tag&#34;&gt;heavy metal&lt;/a&gt; band</biography><musicBrainzId>5182c1d9-c7d2-4dad-afa0-ccfeada921a8</musicBrainzId><lastFmUrl>http://www.last.fm/music/Black+Sabbath</lastFmUrl><smallImageUrl>http://userserve-ak.last.fm/serve/64/27904353.jpg</smallImageUrl><mediumImageUrl>http://userserve-ak.last.fm/serve/126/27904353.jpg</mediumImageUrl><largeImageUrl>http://userserve-ak.last.fm/serve/_/27904353/Black+Sabbath+sabbath+1970.jpg</largeImageUrl><similarArtist id="22" name="Accept"></similarArtist><similarArtist id="101" name="Bruce Dickinson"></similarArtist><similarArtist id="26" name="Aerosmith"></similarArtist></artistInfo></subsonic-response>

View file

@ -1,9 +1,10 @@
package responses
import (
"strings"
"testing"
"github.com/bradleyjkemp/cupaloy"
"github.com/bradleyjkemp/cupaloy/v2"
"github.com/navidrome/navidrome/log"
"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
@ -26,15 +27,16 @@ type snapshotMatcher struct {
}
func (matcher snapshotMatcher) Match(actual interface{}) (success bool, err error) {
err = matcher.c.SnapshotMulti(ginkgo.CurrentSpecReport().FullText(), actual)
actualJson := strings.TrimSpace(string(actual.([]byte)))
err = matcher.c.SnapshotWithName(ginkgo.CurrentSpecReport().FullText(), actualJson)
success = err == nil
return
}
func (matcher snapshotMatcher) FailureMessage(actual interface{}) (message string) {
func (matcher snapshotMatcher) FailureMessage(_ interface{}) (message string) {
return "Expected to match saved snapshot\n"
}
func (matcher snapshotMatcher) NegatedFailureMessage(actual interface{}) (message string) {
func (matcher snapshotMatcher) NegatedFailureMessage(_ interface{}) (message string) {
return "Expected to not match saved snapshot\n"
}

View file

@ -352,10 +352,10 @@ var _ = Describe("Responses", func() {
BeforeEach(func() {
response.ArtistInfo.Biography = `Black Sabbath is an English <a target='_blank' href="http://www.last.fm/tag/heavy%20metal" class="bbcode_tag" rel="tag">heavy metal</a> band`
response.ArtistInfo.MusicBrainzID = "5182c1d9-c7d2-4dad-afa0-ccfeada921a8"
response.ArtistInfo.LastFmUrl = "http://www.last.fm/music/Black+Sabbath"
response.ArtistInfo.SmallImageUrl = "http://userserve-ak.last.fm/serve/64/27904353.jpg"
response.ArtistInfo.MediumImageUrl = "http://userserve-ak.last.fm/serve/126/27904353.jpg"
response.ArtistInfo.LargeImageUrl = "http://userserve-ak.last.fm/serve/_/27904353/Black+Sabbath+sabbath+1970.jpg"
response.ArtistInfo.LastFmUrl = "https://www.last.fm/music/Black+Sabbath"
response.ArtistInfo.SmallImageUrl = "https://userserve-ak.last.fm/serve/64/27904353.jpg"
response.ArtistInfo.MediumImageUrl = "https://userserve-ak.last.fm/serve/126/27904353.jpg"
response.ArtistInfo.LargeImageUrl = "https://userserve-ak.last.fm/serve/_/27904353/Black+Sabbath+sabbath+1970.jpg"
response.ArtistInfo.SimilarArtist = []Artist{
{Id: "22", Name: "Accept"},
{Id: "101", Name: "Bruce Dickinson"},