raise_error matcher - Built in matchers - RSpec Expectations - RSpec - Relish

Should point specific error code out. If not, it will raise warning.