Refactor specs into shared examples.