Although the world is getting smaller and global cooperation and interaction is becoming more common, nations are still sovereign and there is no good, peaceful way to enforce international laws such as a nuclear testing ban. If nations are not given the schematics for nuclear weapons, they will have to go through the same development and testing process that current nuclear nations did to get where they are. The best way to prevent testing would be to provide the information we already have on nuclear weapons, but realistically the best thing to do with nuclear weapons is to destroy them all. Unfortunately that is no more enforceable than a testing ban.
No, a nuclear test ban treaty cannot be effectively enforced, because there is no way to ensure that other countries are abiding by the treaty. In secretive countries, there are ways to conceal activities. All nations will want to be able to continue developing their offense and defense weapons systems, and as such, will go to great measures to continue to develop these weapons, despite the treaty. An agreement would only prevent honest nations from developing nuclear weapons.