put test repo in current dir instead of root
This commit is contained in:
parent
8d3738af50
commit
26303fc1f8
|
@ -65,10 +65,10 @@ async fn user() {
|
||||||
async fn repo() {
|
async fn repo() {
|
||||||
let api = get_api();
|
let api = get_api();
|
||||||
|
|
||||||
tokio::fs::create_dir("/test_repo").await.unwrap();
|
tokio::fs::create_dir("./test_repo").await.unwrap();
|
||||||
let git = || {
|
let git = || {
|
||||||
let mut cmd = std::process::Command::new("git");
|
let mut cmd = std::process::Command::new("git");
|
||||||
cmd.current_dir("/test_repo");
|
cmd.current_dir("./test_repo");
|
||||||
cmd
|
cmd
|
||||||
};
|
};
|
||||||
let _ = git()
|
let _ = git()
|
||||||
|
@ -84,7 +84,7 @@ async fn repo() {
|
||||||
.args(["config", "user.email", "admin@noreply.example.org"])
|
.args(["config", "user.email", "admin@noreply.example.org"])
|
||||||
.status()
|
.status()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
tokio::fs::write("/test_repo/README.md", "# Test\nThis is a test repo")
|
tokio::fs::write("./test_repo/README.md", "# Test\nThis is a test repo")
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let _ = git().args(["add", "."]).status().unwrap();
|
let _ = git().args(["add", "."]).status().unwrap();
|
||||||
|
@ -135,7 +135,7 @@ async fn repo() {
|
||||||
|
|
||||||
let _ = git().args(["switch", "-c", "test"]).status().unwrap();
|
let _ = git().args(["switch", "-c", "test"]).status().unwrap();
|
||||||
tokio::fs::write(
|
tokio::fs::write(
|
||||||
"/test_repo/example.rs",
|
"./test_repo/example.rs",
|
||||||
"fn add_one(x: u32) -> u32 { x + 1 }",
|
"fn add_one(x: u32) -> u32 { x + 1 }",
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
|
|
Loading…
Reference in a new issue