mirror of https://github.com/chipsenkbeil/distant
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
4.5 KiB
Rust
66 lines
4.5 KiB
Rust
2 years ago
|
use crate::cli::fixtures::*;
|
||
|
use indoc::indoc;
|
||
|
use rstest::*;
|
||
|
|
||
|
const EXPECTED_TABLE: &str = indoc! {"
|
||
|
+------------------+------------------------------------------------------------------+
|
||
|
| kind | description |
|
||
|
+------------------+------------------------------------------------------------------+
|
||
2 years ago
|
| cancel_search | Supports canceling an active search against the filesystem |
|
||
|
+------------------+------------------------------------------------------------------+
|
||
2 years ago
|
| capabilities | Supports retrieving capabilities |
|
||
|
+------------------+------------------------------------------------------------------+
|
||
|
| copy | Supports copying files, directories, and symlinks |
|
||
|
+------------------+------------------------------------------------------------------+
|
||
|
| dir_create | Supports creating directory |
|
||
|
+------------------+------------------------------------------------------------------+
|
||
|
| dir_read | Supports reading directory |
|
||
|
+------------------+------------------------------------------------------------------+
|
||
|
| exists | Supports checking if a path exists |
|
||
|
+------------------+------------------------------------------------------------------+
|
||
|
| file_append | Supports appending to binary file |
|
||
|
+------------------+------------------------------------------------------------------+
|
||
|
| file_append_text | Supports appending to text file |
|
||
|
+------------------+------------------------------------------------------------------+
|
||
|
| file_read | Supports reading binary file |
|
||
|
+------------------+------------------------------------------------------------------+
|
||
|
| file_read_text | Supports reading text file |
|
||
|
+------------------+------------------------------------------------------------------+
|
||
|
| file_write | Supports writing binary file |
|
||
|
+------------------+------------------------------------------------------------------+
|
||
|
| file_write_text | Supports writing text file |
|
||
|
+------------------+------------------------------------------------------------------+
|
||
|
| metadata | Supports retrieving metadata about a file, directory, or symlink |
|
||
|
+------------------+------------------------------------------------------------------+
|
||
|
| proc_kill | Supports killing a spawned process |
|
||
|
+------------------+------------------------------------------------------------------+
|
||
|
| proc_resize_pty | Supports resizing the pty of a spawned process |
|
||
|
+------------------+------------------------------------------------------------------+
|
||
|
| proc_spawn | Supports spawning a process |
|
||
|
+------------------+------------------------------------------------------------------+
|
||
|
| proc_stdin | Supports sending stdin to a spawned process |
|
||
|
+------------------+------------------------------------------------------------------+
|
||
|
| remove | Supports removing files, directories, and symlinks |
|
||
|
+------------------+------------------------------------------------------------------+
|
||
|
| rename | Supports renaming files, directories, and symlinks |
|
||
|
+------------------+------------------------------------------------------------------+
|
||
2 years ago
|
| search | Supports searching filesystem using queries |
|
||
|
+------------------+------------------------------------------------------------------+
|
||
2 years ago
|
| system_info | Supports retrieving system information |
|
||
|
+------------------+------------------------------------------------------------------+
|
||
|
| unwatch | Supports unwatching filesystem for changes |
|
||
|
+------------------+------------------------------------------------------------------+
|
||
|
| watch | Supports watching filesystem for changes |
|
||
|
+------------------+------------------------------------------------------------------+
|
||
|
"};
|
||
|
|
||
|
#[rstest]
|
||
2 years ago
|
#[test_log::test]
|
||
1 year ago
|
fn should_output_capabilities(ctx: DistantManagerCtx) {
|
||
|
ctx.cmd("capabilities")
|
||
2 years ago
|
.assert()
|
||
|
.success()
|
||
|
.stdout(EXPECTED_TABLE)
|
||
|
.stderr("");
|
||
|
}
|