[rspec] raise_error matcher
rspecのraise_error matcherは引数に例外クラスを渡すことで検証ができる。
expect { subject }.to raise_error(FooError)
Failure/Error: expect { subject }.to raise_error(FooError) expected FooError, got #<BarError: BarError> with backtrace:
ただしrspec3からto_notで引数渡すのはdeprecatedになっている。 https://www.relishapp.com/rspec/rspec-expectations/docs/changelog
expect { subject }.to_not raise_error(FooError)
DEPRECATION: `expect { }.not_to raise_error(SpecificErrorClass)` is deprecated. Use `expect { }.not_to raise_error` (with no args) instead.