File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
crates/stackable-operator/src Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -220,7 +220,11 @@ mod tests {
220220 ] ) ;
221221
222222 let result = overrides. apply ( & base) ;
223- assert ! ( result. is_err( ) , "removing a nonexistent path should fail" ) ;
223+ assert ! (
224+ matches!( result. unwrap_err( ) , Error :: ApplyJsonPatch { source } if source. to_string( )
225+ == "operation '/0' failed at path '/nonexistent': path is invalid" ) ,
226+ "removing a nonexistent path should fail"
227+ ) ;
224228 }
225229
226230 #[ test]
@@ -231,7 +235,8 @@ mod tests {
231235
232236 let result = overrides. apply ( & base) ;
233237 assert ! (
234- result. is_err( ) ,
238+ matches!( result. unwrap_err( ) , Error :: DeserializeJsonPatchOperation { source, index: 0 } if source. to_string( )
239+ == "missing field `op` at line 1 column 19" ) ,
235240 "invalid patch operation should return an error"
236241 ) ;
237242 }
@@ -256,7 +261,11 @@ mod tests {
256261 let overrides = JsonConfigOverrides :: UserProvided ( "not valid json" . to_owned ( ) ) ;
257262
258263 let result = overrides. apply ( & base) ;
259- assert ! ( result. is_err( ) , "invalid JSON should return an error" ) ;
264+ assert ! (
265+ matches!( result. unwrap_err( ) , Error :: ParseUserProvidedJson { source } if source. to_string( )
266+ == "expected ident at line 1 column 2" ) ,
267+ "invalid JSON should return an error"
268+ ) ;
260269 }
261270
262271 #[ test]
You can’t perform that action at this time.
0 commit comments