feat: refactor frontend configuration

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2023-08-01 02:31:44 +02:00
parent e235483783
commit 8cd68d569b
22 changed files with 557 additions and 268 deletions

View File

@@ -45,15 +45,19 @@ fn test_config_from_source_dir() {
fn test_config_from_stdin() {
let mut args = get_base_args();
let ui = &BufferUi::default();
let current_dir = get_test_data_path("cuddle-embed");
args.push("--source");
args.push(current_dir.to_str().unwrap());
args.push("--config-stdin");
let config = r#"
project:
owner: kjuulh
repository: cuddle-please
branch: main
settings:
api_url: https://some-example.gitea-instance
"#;
Command::new_from_args_with_stdin(Some(ui), args, || Ok("please".into()))
args.push("--config-stdin");
Command::new_from_args_with_stdin(Some(ui), args, || Ok(config.into()))
.execute(None)
.unwrap();
assert_output(ui, "cuddle-config\n", "");
}