Weak problem formulation for PDE and boundary conditions Consider the following example:
$$
- \Delta u = f \mbox{ in } \Omega,
$$
$$
u = 0 \mbox{ on } \Gamma,
$$
Here $\Gamma$ is boundary of $\Omega$.
To produce weak formulation we multiply by arbitrary $v$ from $H^1(\Omega)$, integrate over $\Omega$ and apply integration by parts:
$$
\int_{\Omega} \nabla u \nabla v dx - \int_{\Gamma} \frac{\partial u}{\partial n}vds = \int_{\Omega} f v dx.
$$
Because we don't have information about $\partial u /\partial n$ on $\Gamma$ we restrict $v$ to lie in $V = \{ v \in H^1(\Omega): v|_\Gamma = 0 \}$. This new constructed space may not be a complete, so we need to complete it with respect to Sobolev norm (Otherwise we won't be able to apply Lax–Milgram theorem and prove existence of weak solution). But after this procedure we may have functions in $V$ which violate boundary conditions $v|_\Gamma = 0$. Why after completion of $V$ with respect to Sobolev norm we won't run into functions $v|_\Gamma \neq 0$?  All textbooks I've consulted skip this moment, probably because it is obvious. 

It is usual to assume some regularity property for $\Gamma$. For example, in Evan's PDE, if $\Omega$ is bounded and has a $C^1$ boundary, then there is (bounded) trace operator 
$$T : H^1(\Omega) \to L^2(\Gamma)$$
so that $T u  = u|_\Gamma$ if $u \in H^1(\Omega) \cap C(\overline\Omega)$. It is also proved that 
$$\{ H^1(\Omega) : Tu =  0\} = H^1_0(\Omega),$$
thus $\{ H^1(\Omega) : Tu =  0\}$ is already a complete space. 
