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_no_tag.yml
100644 23 lines (14 sloc) 0.697 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
---
assert_no_tag: |
  # 'cheat assertions' for the rest
  
  assert_no_tag(*opts)
  
  Identical to assert_tag, but asserts that a matching tag does not exist. (See assert_tag for a full discussion of the syntax.)
  
  Examples
  
    # Assert that there is not a "div" containing a "p"
    assert_no_tag :tag => "div", :descendant => { :tag => "p" }
  
    # Assert that an unordered list is empty
    assert_no_tag :tag => "ul", :descendant => { :tag => "li" }
  
    # Assert that there is not a "p" tag with between 1 to 3 "img" tags
    # as immediate children
    assert_no_tag :tag => "p",
               :children => { :count => 1..3, :only => { :tag => "img" } }