External it and nu variable column path fetch support. (#1379)

This commit is contained in:
Andrés N. Robalino
2020-02-11 18:25:56 -05:00
committed by GitHub
parent 24094acee9
commit 2ab8d035e6
6 changed files with 292 additions and 55 deletions

View File

@ -22,7 +22,7 @@ fn shows_error_for_command_not_found() {
mod it_evaluation {
use super::nu;
use nu_test_support::fs::Stub::{EmptyFile, FileWithContentToBeTrimmed};
use nu_test_support::fs::Stub::{EmptyFile, FileWithContent, FileWithContentToBeTrimmed};
use nu_test_support::{pipeline, playground::Playground};
#[test]
@ -76,6 +76,29 @@ mod it_evaluation {
assert_eq!(actual, "AndrásWithKitKat");
})
}
#[test]
fn supports_fetching_given_a_column_path_to_it() {
Playground::setup("it_argument_test_3", |dirs, sandbox| {
sandbox.with_files(vec![FileWithContent(
"sample.toml",
r#"
nu_party_venue = "zion"
"#,
)]);
let actual = nu!(
cwd: dirs.test(), pipeline(
r#"
open sample.toml
| cococo $it.nu_party_venue
| echo $it
"#
));
assert_eq!(actual, "zion");
})
}
}
mod stdin_evaluation {