From 771f944af447c202eba045936a36dee71ab797ac Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Wed, 4 Sep 2024 11:32:05 +0100 Subject: refactor: fix imports, etc based on restructure move some functions out of ngit and into lib/mod and lib/git_events remove MockConnect from binaries so it is only used in the library. this was done: * mainly because automocks were not being imported from lib into each binary * but also because the these functions were being tested with MockConnect --- src/bin/ngit/sub_commands/login.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/bin/ngit/sub_commands/login.rs') diff --git a/src/bin/ngit/sub_commands/login.rs b/src/bin/ngit/sub_commands/login.rs index 8a3788f..df7efa5 100644 --- a/src/bin/ngit/sub_commands/login.rs +++ b/src/bin/ngit/sub_commands/login.rs @@ -1,11 +1,12 @@ use anyhow::{Context, Result}; use clap; -#[cfg(not(test))] -use crate::client::Client; -#[cfg(test)] -use crate::client::MockConnect; -use crate::{cli::Cli, client::Connect, git::Repo, login}; +use crate::{ + cli::Cli, + client::{Client, Connect}, + git::Repo, + login, +}; #[derive(clap::Args)] pub struct SubCommandArgs { @@ -30,10 +31,7 @@ pub async fn launch(args: &Cli, command_args: &SubCommandArgs) -> Result<()> { .await?; Ok(()) } else { - #[cfg(not(test))] let client = Client::default(); - #[cfg(test)] - let client = ::default(); login::launch( &git_repo, -- cgit v1.2.3