Added spec for the legend initation function