We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bb4b3da commit 9a04e50Copy full SHA for 9a04e50
tests/cli.rs
@@ -0,0 +1,24 @@
1
+use assert_cmd::Command;
2
+
3
+#[test]
4
+fn test_stdin_success() {
5
+ let mut cmd = Command::cargo_bin("typos").unwrap();
6
+ cmd.arg("-").write_stdin("Hello world");
7
+ cmd.assert().success();
8
+}
9
10
11
+fn test_stdin_failure() {
12
13
+ cmd.arg("-").write_stdin("Apropriate world");
14
+ cmd.assert().code(2);
15
16
17
18
+fn test_stdin_correct() {
19
20
+ cmd.arg("-")
21
+ .arg("--write-changes")
22
+ .write_stdin("Apropriate world");
23
+ cmd.assert().success().stdout("Appropriate world");
24
0 commit comments