~lifeless/testtools/haslength

« back to all changes in this revision

Viewing changes to doc/for-test-authors.rst

  • Committer: Robert Collins
  • Date: 2013-01-23 20:07:43 UTC
  • Revision ID: robertc@robertcollins.net-20130123200743-0hoe8ny6nzt32liq
* New matcher ``HasLength`` for matching the length of a collection.
  (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
521
521
  self.assertThat('greetings.txt', FileContains(matcher=Contains('!')))
522
522
 
523
523
 
 
524
HasLength
 
525
~~~~~~~~~
 
526
 
 
527
Check the length of a collection.  For example::
 
528
 
 
529
  self.assertThat([1, 2, 3], HasLength(2))
 
530
 
 
531
 
524
532
HasPermissions
525
533
~~~~~~~~~~~~~~
526
534