spec for valid and invalid methods