feat: add tests for git setup

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2023-07-29 19:23:05 +02:00
parent ff9b61ee4a
commit 5e26707e42
7 changed files with 86 additions and 19 deletions

View File

@@ -1,29 +1,15 @@
pub mod common;
use std::path::PathBuf;
use common::BufferUi;
use cuddle_please::command::Command;
use tracing_test::traced_test;
use crate::common::{assert_output, get_test_data_path};
fn get_base_args<'a>() -> Vec<&'a str> {
vec!["cuddle-please", "config", "list"]
}
fn assert_output(ui: &BufferUi, expected_stdout: &str, expected_stderr: &str) {
let (stdout, stderr) = ui.get_output();
assert_eq!(expected_stdout, &stdout);
assert_eq!(expected_stderr, &stderr);
}
fn get_test_data_path(item: &str) -> PathBuf {
std::env::current_dir()
.ok()
.map(|p| p.join("testdata").join(item))
.unwrap()
}
#[test]
#[traced_test]
fn test_config_from_current_dir() {