Add and edit functionality

This commit is contained in:
Jonathan Turner
2019-07-22 15:52:57 +12:00
parent 12a785f2a2
commit ec7d49b0d2
8 changed files with 270 additions and 32 deletions

View File

@ -4,10 +4,12 @@ use helpers::in_directory as cwd;
#[test]
fn external_num() {
nu!(output,
nu!(
output,
cwd("tests/fixtures/formats"),
"open sgml_description.json | get glossary.GlossDiv.GlossList.GlossEntry.Height | echo $it");
"open sgml_description.json | get glossary.GlossDiv.GlossList.GlossEntry.Height | echo $it"
);
assert_eq!(output, "10");
}
@ -19,3 +21,21 @@ fn inc_plugin() {
assert_eq!(output, "11");
}
#[test]
fn add_plugin() {
nu!(output,
cwd("tests/fixtures/formats"),
"open cargo_sample.toml | add dev-dependencies.newdep \"1\" | get dev-dependencies.newdep | echo $it");
assert_eq!(output, "1");
}
#[test]
fn edit_plugin() {
nu!(output,
cwd("tests/fixtures/formats"),
"open cargo_sample.toml | edit dev-dependencies.pretty_assertions \"7\" | get dev-dependencies.pretty_assertions | echo $it");
assert_eq!(output, "7");
}