forked from extern/nushell
Refactor shell listing related code (#6262)
* Refactor shell listing related code Signed-off-by: nibon7 <nibon7@163.com> * add test Signed-off-by: nibon7 <nibon7@163.com>
This commit is contained in:
31
crates/nu-command/tests/commands/shells.rs
Normal file
31
crates/nu-command/tests/commands/shells.rs
Normal file
@ -0,0 +1,31 @@
|
||||
use nu_test_support::{nu, pipeline, playground::Playground};
|
||||
|
||||
#[test]
|
||||
fn list_shells_1() {
|
||||
Playground::setup("list_shells_1", |dirs, sandbox| {
|
||||
sandbox.mkdir("foo").mkdir("bar");
|
||||
|
||||
let actual = nu!(
|
||||
cwd: dirs.test(),
|
||||
pipeline(
|
||||
r#"enter foo; enter ../bar; g| get active.2"#
|
||||
));
|
||||
|
||||
assert_eq!(actual.out, "true");
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn list_shells_2() {
|
||||
Playground::setup("list_shells_2", |dirs, sandbox| {
|
||||
sandbox.mkdir("foo").mkdir("bar");
|
||||
|
||||
let actual = nu!(
|
||||
cwd: dirs.test(),
|
||||
pipeline(
|
||||
r#"enter foo; enter ../bar; shells| get active.2"#
|
||||
));
|
||||
|
||||
assert_eq!(actual.out, "true");
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user