Refactor spec helper not to duplicate configuration logic

Signed-off-by: Damien Le Berrigaud <damien@itsdamo.com>