From 6afc4f2f685a2b5c67f41b45fad97bafd559f709 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Wed, 19 Jun 2024 07:02:49 +0100 Subject: [PATCH] WIP: forgejo: ??? --- crates/forge/src/mock_forge.rs | 15 +++++++++------ crates/forge/src/tests.rs | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/crates/forge/src/mock_forge.rs b/crates/forge/src/mock_forge.rs index b0136e5..e32463d 100644 --- a/crates/forge/src/mock_forge.rs +++ b/crates/forge/src/mock_forge.rs @@ -19,38 +19,41 @@ impl git::ForgeLike for MockForge { _msg: &config::WebhookMessage, _expected: &config::WebhookAuth, ) -> bool { - todo!() + todo!("MockForge::is_message_authorised") } fn parse_webhook_body( &self, _body: &config::webhook::message::Body, ) -> git::forge::webhook::Result { - todo!() + todo!("MockForge::parse_webhook_body") } async fn commit_status(&self, _commit: &git::Commit) -> git::forge::commit::Status { - todo!() + todo!("MockForge::commit_status") } async fn list_webhooks( &self, _webhook_url: &config::server::WebhookUrl, ) -> git::forge::webhook::Result> { - todo!() + todo!("MockForge::list_webhooks") } async fn unregister_webhook( &self, _webhook_id: &config::WebhookId, ) -> git::forge::webhook::Result<()> { - todo!() + todo!("MockForge::unregister_webhook") } async fn register_webhook( &self, _webhook_url: &config::server::WebhookUrl, ) -> git::forge::webhook::Result { - todo!() + Ok(config::RegisteredWebhook::new( + config::WebhookId::new(""), + config::WebhookAuth::new(ulid::Ulid::new()), + )) } } diff --git a/crates/forge/src/tests.rs b/crates/forge/src/tests.rs index 49e190c..62f60e1 100644 --- a/crates/forge/src/tests.rs +++ b/crates/forge/src/tests.rs @@ -30,7 +30,7 @@ fn test_github_name() { fn given_fs() -> kxio::fs::FileSystem { kxio::fs::temp().unwrap_or_else(|e| { - eprintln!("{e}"); + println!("{e}"); panic!("fs") }) }