I don't see why not. I'd use a plug instead of a nipple and a cap though. Just keep in mind you may have to repair that pipe someday. I don't know how far you're cementing but you might want to trench and run a spare pipe for future use.
If I can't fix it, it's broken!