Cover some modules with tests

This commit is contained in:
2024-01-10 18:13:45 +01:00
parent 85f1266e82
commit c07e3f57ea
11 changed files with 187 additions and 34 deletions

View File

@ -1,6 +1,6 @@
use log::{info, warn};
use serde::{Deserialize, Serialize};
use std::{fs::File, collections::HashMap};
use std::{collections::HashMap, fs::File};
pub(crate) mod extension;
pub(crate) mod patch;
@ -98,7 +98,7 @@ impl Chart {
Some(mut vars) => {
vars.extend(global_vars);
Some(vars)
},
}
None => Some(global_vars),
}
};

View File

@ -62,7 +62,12 @@ impl PatchInterface for YqPatch {
fn apply(&self, chart_local_path: String) -> Result<(), Box<dyn std::error::Error>> {
let cmd = match self.op {
YqOperations::Add => {
let value = match self.value.clone().unwrap().starts_with(['{', '[', '\"', '\'']) {
let value = match self
.value
.clone()
.unwrap()
.starts_with(['{', '[', '\"', '\''])
{
true => self.value.clone().unwrap(),
false => format!("\"{}\"", self.value.clone().unwrap()),
};