mirror of
https://github.com/nushell/nushell.git
synced 2024-11-26 18:33:50 +01:00
f9e1c4ef50
* Use 'table' on scripts and -c commands * Fix tests * Oops, missed a spot
30 lines
785 B
Rust
30 lines
785 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"
|
|
| get 0
|
|
"#
|
|
));
|
|
|
|
assert_eq!(actual.out, "pollo loco");
|
|
})
|
|
}
|