def METHOD_NAME(mock_packages, mock_archive, mock_fetch, install_mockery):
    """Tests that when a deprecator spec is deprecated, its deprecatee specs
    are updated to point to the new deprecator."""
    install("libelf@0.8.13")
    install("libelf@0.8.12")
    install("libelf@0.8.10")
    first_deprecated_spec = spack.spec.Spec("libelf@0.8.10").concretized()
    second_deprecated_spec = spack.spec.Spec("libelf@0.8.12").concretized()
    final_deprecator = spack.spec.Spec("libelf@0.8.13").concretized()
    deprecate("-y", "libelf@0.8.10", "libelf@0.8.12")
    deprecator = spack.store.STORE.db.deprecator(first_deprecated_spec)
    assert deprecator == second_deprecated_spec
    deprecate("-y", "libelf@0.8.12", "libelf@0.8.13")
    non_deprecated = spack.store.STORE.db.query()
    all_available = spack.store.STORE.db.query(installed=any)
    assert len(non_deprecated) == 1
    assert len(all_available) == 3
    first_deprecator = spack.store.STORE.db.deprecator(first_deprecated_spec)
    assert first_deprecator == final_deprecator
    second_deprecator = spack.store.STORE.db.deprecator(second_deprecated_spec)
    assert second_deprecator == final_deprecator