add Spec#to_h which returns spec as a hash