cli: Update examples to use new `fail` decorator

This commit is contained in:
Alexis Sellier 2023-05-12 12:54:21 +02:00
parent 87ae8cfb62
commit dd7d86abb0
No known key found for this signature in database
6 changed files with 5 additions and 11 deletions

View File

@ -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 {

View File

@ -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

View File

@ -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

View File

@ -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`.

View File

@ -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
```

View File

@ -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..