mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 06:30:08 +02:00
mkdir can take multiple directories or multiple directory hierachies and wil create them as required.
This commit is contained in:
@ -2,7 +2,7 @@ mod helpers;
|
||||
|
||||
use h::{in_directory as cwd, Playground};
|
||||
use helpers as h;
|
||||
use std::path::PathBuf;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
#[test]
|
||||
fn creates_directory() {
|
||||
@ -19,11 +19,25 @@ fn creates_directory() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn creates_intermediary_directories() {
|
||||
fn accepts_and_creates_directories() {
|
||||
let sandbox = Playground::setup_for("mkdir_test_2").test_dir_name();
|
||||
|
||||
let full_path = format!("{}/{}", Playground::root(), sandbox);
|
||||
|
||||
nu!(_output, cwd(&full_path), "mkdir dir_1 dir_2 dir_3");
|
||||
|
||||
assert!(h::files_exist_at(
|
||||
vec![Path::new("dir_1"), Path::new("dir_2"), Path::new("dir_3")],
|
||||
PathBuf::from(&full_path)
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn creates_intermediary_directories() {
|
||||
let sandbox = Playground::setup_for("mkdir_test_3").test_dir_name();
|
||||
|
||||
let full_path = format!("{}/{}", Playground::root(), sandbox);
|
||||
|
||||
nu!(
|
||||
_output,
|
||||
cwd(&full_path),
|
||||
|
Reference in New Issue
Block a user