nushell/tests/commands/touch.rs

20 lines
477 B
Rust
Raw Normal View History

2020-02-18 21:54:32 +01:00
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());
})
}