mirror of
https://github.com/rust-lang/rustlings.git
synced 2024-12-25 15:10:26 +00:00
test_dir is a str anyway
This commit is contained in:
parent
140c4e4812
commit
479f45da9b
1 changed files with 3 additions and 3 deletions
|
@ -1,6 +1,5 @@
|
||||||
use std::{
|
use std::{
|
||||||
env::{self, consts::EXE_SUFFIX},
|
env::{self, consts::EXE_SUFFIX},
|
||||||
fs,
|
|
||||||
process::{Command, Stdio},
|
process::{Command, Stdio},
|
||||||
str::from_utf8,
|
str::from_utf8,
|
||||||
};
|
};
|
||||||
|
@ -156,7 +155,6 @@ fn hint() {
|
||||||
#[test]
|
#[test]
|
||||||
fn init() {
|
fn init() {
|
||||||
let test_dir = tempfile::TempDir::new().unwrap();
|
let test_dir = tempfile::TempDir::new().unwrap();
|
||||||
let initialized_dir = test_dir.path().join("rustlings");
|
|
||||||
let test_dir = test_dir.path().to_str().unwrap();
|
let test_dir = test_dir.path().to_str().unwrap();
|
||||||
|
|
||||||
Cmd::default().current_dir(test_dir).fail();
|
Cmd::default().current_dir(test_dir).fail();
|
||||||
|
@ -173,9 +171,11 @@ fn init() {
|
||||||
.output(PartialStderr("`cd rustlings`"))
|
.output(PartialStderr("`cd rustlings`"))
|
||||||
.fail();
|
.fail();
|
||||||
|
|
||||||
|
let initialized_dir = format!("{test_dir}/rustlings");
|
||||||
|
|
||||||
// Running `init` in the initialized directory.
|
// Running `init` in the initialized directory.
|
||||||
Cmd::default()
|
Cmd::default()
|
||||||
.current_dir(initialized_dir.to_str().unwrap())
|
.current_dir(&initialized_dir)
|
||||||
.args(&["init"])
|
.args(&["init"])
|
||||||
.output(PartialStderr("already initialized"))
|
.output(PartialStderr("already initialized"))
|
||||||
.fail();
|
.fail();
|
||||||
|
|
Loading…
Reference in a new issue