Doing it in the spec file is wrong. Spec files should have the least logic possible. This should be included in `make check`/`rake test`, called from `%check`.