use expect { subject }.to raise_error (thanks to @r7kamura)