Refactored private/public class method specs into shared example.