@@ -951,14 +951,41 @@ fn test_retiring_older_blessed_version() -> Result<()> {
951951/// see exactly how the user-visible output changes.
952952#[ test]
953953fn test_incompatible_blessed_api_change_render ( ) -> Result < ( ) > {
954+ render_blessed_version_broken_snapshot (
955+ versioned_health_apis ( ) ?,
956+ versioned_health_incompat_apis ( ) ?,
957+ "blessed_version_broken.txt" ,
958+ )
959+ }
960+
961+ /// Companion to `test_incompatible_blessed_api_change_render` that runs the
962+ /// fixtures in reverse: the `versioned_health_incompat` shape is blessed, and
963+ /// the current code regresses to the plain `versioned_health` shape. This
964+ /// exercises endpoint and required-parameter removal, the symmetric counterpart
965+ /// of the addition cases the forward direction covers.
966+ #[ test]
967+ fn test_blessed_api_endpoint_removed_render ( ) -> Result < ( ) > {
968+ render_blessed_version_broken_snapshot (
969+ versioned_health_incompat_apis ( ) ?,
970+ versioned_health_apis ( ) ?,
971+ "blessed_version_endpoint_removed.txt" ,
972+ )
973+ }
974+
975+ /// Shared body for the `BlessedVersionBroken` snapshot tests: commit `blessed`
976+ /// as the upstream shape, then check against `generated` and snapshot the
977+ /// rendered output to `snapshot_name` under `tests/output/integration/`.
978+ fn render_blessed_version_broken_snapshot (
979+ blessed : ManagedApis ,
980+ generated : ManagedApis ,
981+ snapshot_name : & str ,
982+ ) -> Result < ( ) > {
954983 let env = TestEnvironment :: new_git ( ) ?;
955- let original_apis = versioned_health_apis ( ) ?;
956- env. generate_documents ( & original_apis) ?;
984+ env. generate_documents ( & blessed) ?;
957985 env. commit_documents ( ) ?;
958986
959- let incompatible_apis = versioned_health_incompat_apis ( ) ?;
960987 let ( result, _summaries, rendered) =
961- check_apis_with_render ( env. environment ( ) , & incompatible_apis ) ?;
988+ check_apis_with_render ( env. environment ( ) , & generated ) ?;
962989 assert_eq ! ( result, CheckResult :: Failures ) ;
963990
964991 // The "Loading local OpenAPI documents from <abs_dir>" line embeds the
@@ -973,7 +1000,8 @@ fn test_incompatible_blessed_api_change_render() -> Result<()> {
9731000 rendered. replace ( & documents_dir_debug, "\" <documents dir>\" " ) ;
9741001
9751002 let snapshot_path = Utf8PathBuf :: from ( env ! ( "CARGO_MANIFEST_DIR" ) )
976- . join ( "tests/output/integration/blessed_version_broken.txt" ) ;
1003+ . join ( "tests/output/integration" )
1004+ . join ( snapshot_name) ;
9771005 expectorate:: assert_contents ( snapshot_path, & normalized) ;
9781006 Ok ( ( ) )
9791007}
0 commit comments