Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
cli: Update examples to use new `fail` decorator
Alexis Sellier committed 3 years ago
commit dd7d86abb0910bf484d3508043ffabde7714fe65
parent 87ae8cfb62bb5d2ddf9b65813f012f08af3c1edf
6 files changed +5 -11
modified radicle-cli-test/src/lib.rs
@@ -8,9 +8,6 @@ use snapbox::cmd::{Command, OutputAssert};
use snapbox::{Assert, Substitutions};
use thiserror::Error;

-
/// Error lines in the CLI are prefixed with this string.
-
const ERROR_PREFIX: &str = "✗";
-

#[derive(Error, Debug)]
pub enum Error {
    #[error("parsing failed")]
@@ -160,9 +157,6 @@ impl TestFormula {
                        },
                    });
                } else if let Some(a) = test.assertions.last_mut() {
-
                    if line.starts_with(ERROR_PREFIX) {
-
                        a.exit = ExitStatus::Failure;
-
                    }
                    a.expected.push_str(line.as_str());
                    a.expected.push('\n');
                } else {
modified radicle-cli/examples/rad-clone-unknown.md
@@ -1,6 +1,6 @@
Trying to clone a repository that is not in our routing table returns an error:

-
```
+
``` (fail)
$ rad clone rad:zVNuptPuk5XauitpCWSNVCXGGfXW
✓ Tracking relationship established for rad:zVNuptPuk5XauitpCWSNVCXGGfXW
✗ Clone failed: no seeds found for rad:zVNuptPuk5XauitpCWSNVCXGGfXW
modified radicle-cli/examples/rad-id-rebase.md
@@ -237,7 +237,7 @@ Note that a warning was emitted:

If we attempt to commit this revision, the command will fail:

-
```
+
``` (fail)
$ rad id commit 3f6ae4f8645c8b0cbcd35ea924df7b13aca52774 --no-confirm
! Warning: Revision is out of date
! Warning: d96f425412c9f8ad5d9a9a05c9831d0728e2338d =/= 475cdfbc8662853dd132ec564e4f5eb0f152dd7f
modified radicle-cli/examples/rad-inspect-noauth.md
@@ -1,6 +1,6 @@
The `rad inspect` command can be run without being authenticated with radicle:

-
```
+
``` (fail)
$ rad self
✗ Self failed: Could not load radicle profile
✗ Hint: To setup your radicle profile, run `rad auth`.
modified radicle-cli/examples/rad-rm.md
@@ -23,7 +23,7 @@ $ rad ls

Attempting to remove a repository that doesn't exist gives us an error message:

-
```
+
``` (fail)
$ rad rm rad:z2Jk1mNqyX7AjT4K83jJW9vQoHn4f
✗ Remove failed: repository rad:z2Jk1mNqyX7AjT4K83jJW9vQoHn4f was not found
```
modified radicle-cli/examples/rad-sync.md
@@ -18,7 +18,7 @@ $ rad sync
If we try to sync again after the nodes have synced, we will get a timeout
after one second, since the nodes will not emit any message:

-
```
+
``` (fail)
$ rad sync --timeout 1
✗ Syncing with 2 node(s)..
! Seed z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk timed out..