summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMatan Kushner <hello@matchai.me>2019-04-16 07:59:57 -0700
committerGitHub <noreply@github.com>2019-04-16 07:59:57 -0700
commitfd42d8127374afb8eb68dad26e4770ad8b2e36bd (patch)
tree77ae3f4fa68c46070e0f2fa647f436b5293e9968 /tests
parentbd298374d4b85b569320ee8003c7a6121c3b445f (diff)
Replace tempdir with tempfile (#7)
Diffstat (limited to 'tests')
-rw-r--r--tests/directory.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/directory.rs b/tests/directory.rs
index ae8d93736..6b58c2750 100644
--- a/tests/directory.rs
+++ b/tests/directory.rs
@@ -4,7 +4,7 @@ use starship::segment::Segment;
use std::fs;
use std::io;
use std::path::Path;
-use tempdir::TempDir;
+use tempfile::TempDir;
mod common;
@@ -94,8 +94,8 @@ fn truncated_directory_in_root() -> io::Result<()> {
#[test]
fn git_repo_root() -> io::Result<()> {
- let temp_dir = TempDir::new("starship")?;
- let repo_dir = temp_dir.path().join("rocket-controls");
+ let tmp_dir = TempDir::new()?;
+ let repo_dir = tmp_dir.path().join("rocket-controls");
fs::create_dir(&repo_dir)?;
Repository::init(&repo_dir).unwrap();
@@ -112,8 +112,8 @@ fn git_repo_root() -> io::Result<()> {
#[test]
fn directory_in_git_repo() -> io::Result<()> {
- let temp_dir = TempDir::new("starship")?;
- let repo_dir = temp_dir.path().join("rocket-controls");
+ let tmp_dir = TempDir::new()?;
+ let repo_dir = tmp_dir.path().join("rocket-controls");
let dir = repo_dir.join("src");
fs::create_dir_all(&dir)?;
@@ -131,8 +131,8 @@ fn directory_in_git_repo() -> io::Result<()> {
#[test]
fn truncated_directory_in_git_repo() -> io::Result<()> {
- let temp_dir = TempDir::new("starship")?;
- let repo_dir = temp_dir.path().join("rocket-controls");
+ let tmp_dir = TempDir::new()?;
+ let repo_dir = tmp_dir.path().join("rocket-controls");
let dir = repo_dir.join("src/meters/fuel-gauge");
fs::create_dir_all(&dir)?;