Skip to content

Commit

Permalink
test(commands): light refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
beeb committed Sep 17, 2024
1 parent 544bb42 commit 4c8614d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/commands/tests/tests-install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,15 +262,16 @@ mylib = "1.1"
"#;
fs::write(dir.join("soldeer.toml"), contents).unwrap();

fs::create_dir(dir.join(".tmp")).unwrap();
// get zip file locally for mock
let zip_file = download_file(
"https://github.com/mario-eth/soldeer/archive/8585a7ec85a29889cec8d08f4770e15ec4795943.zip",
dir.join(".tmp"),
&dir,
"tmp",
)
.await
.unwrap();

// serve the file with mock server
let mut server = mockito::Server::new_async().await;
let mock = server.mock("GET", "/file.zip").with_body_from_file(zip_file).create_async().await;
let mock = mock.expect(1); // download link should be called exactly once
Expand Down

0 comments on commit 4c8614d

Please sign in to comment.