[PR #117] [MERGED] Reducing boilerplate for tests #254

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

📋 Pull Request Information

Original PR: https://github.com/ramsayleung/rspotify/pull/117
Author: @marioortizmanero
Created: 8/16/2020
Status: Merged
Merged: 8/18/2020
Merged by: @ramsayleung

Base: masterHead: oauth-tests-boilerplate


📝 Commits (7)

  • 33471a6 Initial work on reducing boilerplate for oauth tests
  • d7dd18d Added a macro for the async client
  • 0c3587e Applied to all tests with a vim macro
  • 70b473f cargo fmt
  • cfc8292 Also for test_with_credential
  • 7a9cfb8 Better docs and some improvements
  • 489d2df No need for macros

📊 Changes

3 files changed (+448 additions, -1074 deletions)

View changed files

📝 Cargo.toml (+1 -0)
📝 tests/test_with_credential.rs (+28 -76)
📝 tests/test_with_oauth.rs (+419 -998)

📄 Description

test_device: Not sure what that's for. Can it be removed?
test_with_credential: Just a function to reduce the boilerplate a bit.
test_oauth: This creates a single spotify client so that it can be used from each test. This way, you don't have to open a browser tab for each test, and there's much less copy-pasted code. This is specially useful in case we figure out how to run these tests on Travis, because it'll be very easy to change the authentication process.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ramsayleung/rspotify/pull/117 **Author:** [@marioortizmanero](https://github.com/marioortizmanero) **Created:** 8/16/2020 **Status:** ✅ Merged **Merged:** 8/18/2020 **Merged by:** [@ramsayleung](https://github.com/ramsayleung) **Base:** `master` ← **Head:** `oauth-tests-boilerplate` --- ### 📝 Commits (7) - [`33471a6`](https://github.com/ramsayleung/rspotify/commit/33471a62ebd58d8ff88264d3ce5a83ee16034830) Initial work on reducing boilerplate for oauth tests - [`d7dd18d`](https://github.com/ramsayleung/rspotify/commit/d7dd18d13d5a3523dd28276524002d3f536ee89d) Added a macro for the async client - [`0c3587e`](https://github.com/ramsayleung/rspotify/commit/0c3587e756a41e7e71df5b11cf3bf4616373ff23) Applied to all tests with a vim macro - [`70b473f`](https://github.com/ramsayleung/rspotify/commit/70b473f5730149f77539c632bbcc6191e0aa839b) cargo fmt - [`cfc8292`](https://github.com/ramsayleung/rspotify/commit/cfc82924faee78017ff06a6392681e3ed354407f) Also for test_with_credential - [`7a9cfb8`](https://github.com/ramsayleung/rspotify/commit/7a9cfb8cc77d8b63e5d985c5a55c390e5e964d57) Better docs and some improvements - [`489d2df`](https://github.com/ramsayleung/rspotify/commit/489d2df572e2f9eba65d3d83609e6f446bb2ba80) No need for macros ### 📊 Changes **3 files changed** (+448 additions, -1074 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.toml` (+1 -0) 📝 `tests/test_with_credential.rs` (+28 -76) 📝 `tests/test_with_oauth.rs` (+419 -998) </details> ### 📄 Description **test_device:** Not sure what that's for. Can it be removed? **test_with_credential:** Just a function to reduce the boilerplate a bit. **test_oauth:** This creates a single spotify client so that it can be used from each test. This way, you don't have to open a browser tab for each test, and there's much less copy-pasted code. This is specially useful in case we figure out how to run these tests on Travis, because it'll be very easy to change the authentication process. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:23:58 +03:00
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#254
No description provided.