zmb3 / spotify

A Go wrapper for the Spotify Web API
Apache License 2.0
1.33k stars 284 forks source link

Make Previous/Next page more mockable #171

Open strideynet opened 2 years ago

strideynet commented 2 years ago

As it stands, the pageable interface is not exported, which makes life more difficult mocking this.

ebreiner commented 1 month ago

Hey there @strideynet! I ran into this while implementing some tests for my current project. Because the pageable interface is not exported but exposed in NextPage(ctx context.Context, p pageable) error, mocking is pretty tough and gets me into weird places (at least with my current go skills, learning it right now). Is there any not so obvious reason for the interface not being exported? I took a quick look, exported it and tested it in my current project. Worked like a charm. Because of this I and the low effort I already opened a PR for this in #260.