public
Description: cheat sheet repository for chit
Homepage:
Clone URL: git://github.com/robin/chitsheet.git
chitsheet / assert_raise.yml
100644 19 lines (12 sloc) 0.363 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
---
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', { }
    }