def METHOD_NAME(install_mockery, mock_fetch, mock_archive, mock_packages):
    """Test that the '-r' option to the load command prepends dependency prefix
    inspections in post-order"""
    install("mpileaks")
    mpileaks_spec = spack.spec.Spec("mpileaks").concretized()
    sh_out = load("--sh", "mpileaks")
    csh_out = load("--csh", "mpileaks")
    # Test prefix inspections
    prefix_test_replacement = ":".join(
        reversed([s.prefix for s in mpileaks_spec.traverse(order="post")])
    )
    sh_prefix_test = "export CMAKE_PREFIX_PATH=%s" % prefix_test_replacement
    csh_prefix_test = "setenv CMAKE_PREFIX_PATH %s" % prefix_test_replacement
    assert sh_prefix_test in sh_out
    assert csh_prefix_test in csh_out
    # Test spack records loaded hashes properly
    hash_test_replacement = (
        uenv.spack_loaded_hashes_var,
        ":".join(reversed([s.dag_hash() for s in mpileaks_spec.traverse(order="post")])),
    )
    sh_hash_test = "export %s=%s" % hash_test_replacement
    csh_hash_test = "setenv %s %s" % hash_test_replacement
    assert sh_hash_test in sh_out
    assert csh_hash_test in csh_out