summaryrefslogtreecommitdiff
path: root/tests/cli.rs
diff options
context:
space:
mode:
authorJustin Wernick <justin@worthe-it.co.za>2023-02-27 23:12:32 +0200
committerJustin Wernick <justin@worthe-it.co.za>2023-02-27 23:12:32 +0200
commit9f0f47abaa934b66da5b302236bfc89f95a7f329 (patch)
tree37b20fa001c42e61da54ada3a905fda6463fe050 /tests/cli.rs
parent5ac9161b7edabbb95c1f8a5d68af62a567687190 (diff)
Revamp parsing to support more complex commands
Diffstat (limited to 'tests/cli.rs')
-rw-r--r--tests/cli.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/cli.rs b/tests/cli.rs
index 8197a92..672a798 100644
--- a/tests/cli.rs
+++ b/tests/cli.rs
@@ -45,3 +45,22 @@ fn quits_when_exit_command_is_sent() -> Result<()> {
p.exp_eof()?;
Ok(())
}
+
+#[test]
+fn reports_error_with_nonsense_input() -> Result<()> {
+ let mut p = spawn_interactive_process()?;
+ p.send_line("asdfg")?;
+ p.exp_string("Unknown input \"asdfg\"")?;
+ expect_prompt(&mut p)?;
+ Ok(())
+}
+
+#[test]
+fn can_init_a_new_git_repo() -> Result<()> {
+ let mut p = spawn_interactive_process()?;
+ p.send_line("git-init my-new-repo")?;
+ p.exp_string("Successfully created my-new-repo.git")?;
+ expect_prompt(&mut p)?;
+ // TODO: assert that the repo is actually there?
+ Ok(())
+}