-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
ion template inspect
command (#11)
- Loading branch information
1 parent
a5df9c3
commit 592c434
Showing
4 changed files
with
181 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
use super::*; | ||
use anyhow::{Ok, Result}; | ||
|
||
#[test] | ||
fn test_template() -> Result<()> { | ||
Ion::new().arg("template").arg("list").assert().success(); | ||
|
||
Ion::new().arg("template").arg("update").assert().success(); | ||
|
||
Ion::new() | ||
.arg("template") | ||
.arg("inspect") | ||
.arg("--all") | ||
.assert() | ||
.success(); | ||
|
||
Ion::new() | ||
.arg("template") | ||
.arg("inspect") | ||
.arg("package") | ||
.assert() | ||
.success(); | ||
|
||
// Test escape from input / Ctrl+C behaviour with `ion template inspect` (cf. ask_inspect_input fn) | ||
let mut p = Ion::new() | ||
.arg("template") | ||
.arg("inspect") | ||
.arg("nonce") | ||
.spawn(Some(30_000))?; | ||
|
||
p.send_control('c')?; | ||
p.exp_eof()?; | ||
|
||
Ok(())?; | ||
|
||
// Test nonce input | ||
let mut ps = Ion::new() | ||
.arg("template") | ||
.arg("inspect") | ||
.arg("nonce") | ||
.spawn(Some(5_000))?; | ||
|
||
ps.exp_string("Installed templates are:")?; | ||
|
||
// Send <ENTER> keycode to pty | ||
ps.send_control('j')?; | ||
ps.exp_string("name")?; | ||
ps.exp_eof()?; | ||
|
||
Ok(()) | ||
} |