Last Updated: February 25, 2016
·
3.096K
· errm

Expect Exceptions to be raised in rspec

expect { object.some_method("Stupid Monkey") }.to raise_error

expect { object.some_other_method }.to raise_error "Awful exception"

expect { object.method("argparty") }.to raise_error ErrorClass