nushell/tests/commands/touch.rs
2020-02-19 09:54:32 +13:00

19 lines
477 B
Rust

use nu_test_support::fs::Stub::EmptyFile;
use nu_test_support::nu;
use nu_test_support::playground::Playground;
#[test]
fn adds_a_file() {
Playground::setup("add_test_1", |dirs, sandbox| {
sandbox.with_files(vec![EmptyFile("i_will_be_created.txt")]);
nu!(
cwd: dirs.root(),
"touch touch_test/i_will_be_created.txt"
);
let path = dirs.test().join("i_will_be_created.txt");
assert!(path.exists());
})
}