[GH-ISSUE #350] Make Spotify base URLs configurable for tests #111

Closed
opened 2026-02-27 20:23:11 +03:00 by kerem · 4 comments
Owner

Originally created by @jjmark15 on GitHub (Jul 26, 2022).
Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/350

Is your feature request related to a problem? Please describe.
I want to be able to write tests against a local mock of Spotify. Spotify URLs are hard-coded in the library which makes this impractical.

e.g. github.com/ramsayleung/rspotify@9197a908e9/src/lib.rs (L188)

Describe the solution you'd like
Make target base URLs configurable.

Originally created by @jjmark15 on GitHub (Jul 26, 2022). Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/350 **Is your feature request related to a problem? Please describe.** I want to be able to write tests against a local mock of Spotify. Spotify URLs are hard-coded in the library which makes this impractical. e.g. https://github.com/ramsayleung/rspotify/blob/9197a908e9a61e20b47e22cac6cf9af75c6769b4/src/lib.rs#L188 **Describe the solution you'd like** Make target base URLs configurable.
kerem 2026-02-27 20:23:11 +03:00
Author
Owner

@marioortizmanero commented on GitHub (Jul 26, 2022):

I saw aspotify did something like that but I always wondered why it would be useful. So you've replicated the API? Would you be able to tell me more about it?

<!-- gh-comment-id:1195986231 --> @marioortizmanero commented on GitHub (Jul 26, 2022): I saw `aspotify` did something like that but I always wondered why it would be useful. So you've replicated the API? Would you be able to tell me more about it?
Author
Owner

@jjmark15 commented on GitHub (Jul 26, 2022):

Sure 👍🏻 . I generally prefer black-box functional (or integration depending on terminology) testing of an API. In order to do that I need to be able to make a real HTTP call to a downstream, which usually means using an http mock. Not sure if I've explained myself well enough there 😓

<!-- gh-comment-id:1195989663 --> @jjmark15 commented on GitHub (Jul 26, 2022): Sure 👍🏻 . I generally prefer black-box functional (or integration depending on terminology) testing of an API. In order to do that I need to be able to make a real HTTP call to a downstream, which usually means using an http mock. Not sure if I've explained myself well enough there 😓
Author
Owner

@marioortizmanero commented on GitHub (Jul 29, 2022):

I was wondering whether we should have these fields as a String or as a Box<str> or &'static str. It's not like anyone is going to modify the prefix URL at runtime, right?

<!-- gh-comment-id:1200002580 --> @marioortizmanero commented on GitHub (Jul 29, 2022): I was wondering whether we should have these fields as a `String` or as a `Box<str>` or `&'static str`. It's not like anyone is going to modify the prefix URL at runtime, right?
Author
Owner

@github-actions[bot] commented on GitHub (Jun 25, 2023):

Message to comment on stale issues. If none provided, will not mark issues stale

<!-- gh-comment-id:1605837545 --> @github-actions[bot] commented on GitHub (Jun 25, 2023): Message to comment on stale issues. If none provided, will not mark issues stale
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/rspotify#111
No description provided.