spec.name fails if spec is still nil

spec.name fails if spec is still nil