nushell/crates/nu-command/tests/commands/shells.rs
nibon7 2f0cb044a5
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>
2022-08-08 06:31:24 -05:00

31 lines
724 B
Rust

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");
})
}