It is narrated from Tawus (may Allah have mercy on him) that the bequest came before inheritance. When the rulings of inheritance were revealed, (the bequest for) whoever became an heir was abrogated, and the bequest remained for whoever was not an heir; it is established. Whoever makes a bequest to someone other than a relative, it is not valid.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الوصايا / 12542