RSpec cheatsheetEdit
Expecting an exception
expect do
...
end.to raise_error
expect do
...
end.to raise_error
Arguably, this reads more nicely than the alternative:
lambda {
...
}.should raise_error
expect do
...
end.to raise_error
Arguably, this reads more nicely than the alternative:
lambda {
...
}.should raise_error