Cover some modules with tests
This commit is contained in:
@ -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),
|
||||
}
|
||||
};
|
||||
|
@ -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()),
|
||||
};
|
||||
|
Reference in New Issue
Block a user