cheat sheets.

$ cheat assert_raise
# 'cheat assertions' for the rest

assert_raise(*args) {|| ...}

Passes if the block raises one of the given exceptions.

Examples:

  assert_raise RuntimeError, LoadError do
    raise 'Boom!!!'
  end


  assert_raise(ActionController::RoutingError) {
    assert_routing 'invalid/url', { }
  }
Version 2, updated 134 days ago.
. o 0 ( edit | previous | history | diff )
( add new | see all )