Skip to content

Commit

Permalink
Update Rust crate mockito to 1.4.0 (#154)
Browse files Browse the repository at this point in the history
* Update Rust crate mockito to 1.4.0

* Switch to async constructor

Mockito, by default, starts its own async runtime for the mock server.
This creates issues in async tests, which are already executed within a
runtime.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jan David <[email protected]>
  • Loading branch information
renovate[bot] and jdno authored Mar 16, 2024
1 parent 0039801 commit 2c6d839
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 8 deletions.
61 changes: 58 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ typed-builder = "0.18.1"
url = "2.5.0"

[dev-dependencies]
mockito = "1.3.0"
mockito = "1.4.0"
serde_json = "1.0.114"
tempfile = "3.10.0"
serde_yaml = { version = "0.9.32" }
Expand Down
8 changes: 4 additions & 4 deletions src/github/library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ mod tests {

#[tokio::test]
async fn workflow() {
let mut server = mockito::Server::new();
let mut server = mockito::Server::new_async().await;
let mock = server
.mock("GET", "/repos/owner/name/contents/test/workflow.yml")
.match_query(mockito::Matcher::Any)
Expand All @@ -198,7 +198,7 @@ mod tests {

#[tokio::test]
async fn job() {
let mut server = mockito::Server::new();
let mut server = mockito::Server::new_async().await;
let mock = server
.mock("GET", "/repos/owner/name/contents/test/job.yml")
.match_query(mockito::Matcher::Any)
Expand Down Expand Up @@ -261,7 +261,7 @@ mod tests {

#[tokio::test]
async fn fetch_from_github() {
let mut server = mockito::Server::new();
let mut server = mockito::Server::new_async().await;
let mock = server
.mock("GET", "/repos/owner/name/contents/test/workflow.yml")
.match_query(mockito::Matcher::Any)
Expand All @@ -284,7 +284,7 @@ mod tests {

#[tokio::test]
async fn fetch_from_github_not_found() {
let mut server = mockito::Server::new();
let mut server = mockito::Server::new_async().await;
let mock = server
.mock("GET", "/repos/owner/name/contents/test/workflow.yml")
.match_query(mockito::Matcher::Any)
Expand Down

0 comments on commit 2c6d839

Please sign in to comment.