Make a small ship. Stick a warhead on it and run it into an asteroid. No boom. Do the same thing to a ship or a planet and it works fine.
Rammed into an asteroid. No BOOM.
Rammed it into another ship I spawned and it exploded.
Admin warped a few systems away and found another asteroid. Still No BOOM.
Spawned and built a station. Exploded on contact.
(Did not explode the other warheads though. System had three when I rammed the station. All following tests exploded all the warheads.)