public
Description: cheat sheet repository for chit
Homepage:
Clone URL: git://github.com/robin/chitsheet.git
robin (author)
Wed Jul 09 03:11:05 -0700 2008
commit  4d546432dd5b473dbbb5883f19cacc71b4599483
tree    d2371207000e34eb8ae02337f9e5c2f03ffdd22d
parent  8b2c5772e458466c24b4c2360fcf24e8b3b72468
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', { }
    }