mirror of
https://github.com/nushell/nushell
synced 2024-12-27 05:23:11 +00:00
6d3a30772d
More especific "get" command error messages + Test refactoring.
30 lines
808 B
Rust
30 lines
808 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, "pollo loco");
|
|
})
|
|
}
|