1
0
mirror of https://github.com/nushell/nushell.git synced 2024-12-18 21:21:52 +01:00
nushell/crates/nu-cli/tests/commands/prepend.rs
Andrés N. Robalino 96e5fc05a3
Pick->Select rename. Integration tests changes. ()
Pick->Select rename. Integration tests changes.
2020-05-07 06:03:43 -05:00

31 lines
812 B
Rust

use nu_test_support::fs::Stub::FileWithContentToBeTrimmed;
use nu_test_support::playground::Playground;
use nu_test_support::{nu, pipeline};
#[test]
fn adds_a_row_to_the_beginning() {
Playground::setup("prepend_test_1", |dirs, sandbox| {
sandbox.with_files(vec![FileWithContentToBeTrimmed(
"los_tres_caballeros.txt",
r#"
Andrés N. Robalino
Jonathan Turner
Yehuda Katz
"#,
)]);
let actual = nu!(
cwd: dirs.test(), pipeline(
r#"
open los_tres_caballeros.txt
| lines
| prepend "pollo loco"
| nth 0
| echo $it
"#
));
assert_eq!(actual.out, "pollo loco");
})
}