Skip to content

Commit

Permalink
Merge pull request #239 from robyoung/refactor-docs-to-promote-user-f…
Browse files Browse the repository at this point in the history
…unctions

Refactor the docs to promote user functions
  • Loading branch information
offbyone committed Aug 30, 2023
2 parents 58254ca + 2eddd43 commit 8f160f8
Show file tree
Hide file tree
Showing 19 changed files with 318 additions and 178 deletions.
1 change: 1 addition & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Contents:
tutorial
custom_matchers
library
internals
integration
core

Expand Down
16 changes: 16 additions & 0 deletions doc/internals.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Matcher Internals
=================

Details of the Matcher internals.

.. toctree::

matcher_internals/object_matchers
matcher_internals/number_matchers
matcher_internals/text_matchers
matcher_internals/logical_matchers
matcher_internals/sequence_matchers
matcher_internals/dictionary_matchers
matcher_internals/decorator_matchers


14 changes: 7 additions & 7 deletions doc/library.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Library of Matcher implementations.

.. toctree::

object_matchers
number_matchers
text_matchers
logical_matchers
sequence_matchers
dictionary_matchers
decorator_matchers
matcher_library/object_matchers
matcher_library/number_matchers
matcher_library/text_matchers
matcher_library/logical_matchers
matcher_library/sequence_matchers
matcher_library/dictionary_matchers
matcher_library/decorator_matchers
31 changes: 0 additions & 31 deletions doc/logical_matchers.rst

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
.. _decorator-matcher-internals:

Decorator Matchers
------------------

Matchers that decorate other matchers for better expression.


described_as
^^^^^^^^^^^^

.. automodule:: hamcrest.core.core.described_as
:exclude-members: described_as
.. autofunction:: described_as(description, matcher[, value1[, ...]])

is\_
^^^^

.. automodule:: hamcrest.core.core.is_
Original file line number Diff line number Diff line change
@@ -1,27 +1,13 @@
.. _dictionary-matcher-internals:

Dictionary Matchers
-------------------

Matchers of dictionaries.


has_entries
^^^^^^^^^^^

.. automodule:: hamcrest.library.collection.isdict_containingentries
:exclude-members: has_entries
.. autofunction:: has_entries(matcher_dict)

has_entry
^^^^^^^^^

.. automodule:: hamcrest.library.collection.isdict_containing

has_key
^^^^^^^

.. automodule:: hamcrest.library.collection.isdict_containingkey

has_value
^^^^^^^^^

.. automodule:: hamcrest.library.collection.isdict_containingvalue
11 changes: 11 additions & 0 deletions doc/matcher_internals/logical_matchers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.. _logical-matcher-internals:

Logical Matchers
----------------

Boolean logic using other matchers.

.. automodule:: hamcrest.core.core.allof
.. automodule:: hamcrest.core.core.anyof
.. automodule:: hamcrest.core.core.isanything
.. automodule:: hamcrest.core.core.isnot
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
.. _number-matcher-internals:

Number Matchers
---------------

Matchers that perform numeric comparisons.


close_to
^^^^^^^^

.. automodule:: hamcrest.library.number.iscloseto

greater_than, greater_than_or_equal_to, less_than, less_than_or_equal_to
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. automodule:: hamcrest.library.number.ordering_comparison
Original file line number Diff line number Diff line change
@@ -1,45 +1,16 @@
.. _object-matcher-internals:

Object Matchers
---------------

Matchers that inspect objects.


equal_to
^^^^^^^^

.. automodule:: hamcrest.core.core.isequal

has_length
^^^^^^^^^^

.. automodule:: hamcrest.library.object.haslength

has_string
^^^^^^^^^^

.. automodule:: hamcrest.library.object.hasstring

has_properties/has_property
^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. automodule:: hamcrest.library.object.hasproperty

instance_of
^^^^^^^^^^^

.. automodule:: hamcrest.core.core.isinstanceof

none, not_none
^^^^^^^^^^^^^^

.. automodule:: hamcrest.core.core.isnone

same_instance
^^^^^^^^^^^^^

.. automodule:: hamcrest.core.core.issame

calling, raises
^^^^^^^^^^^^^^^

.. automodule:: hamcrest.core.core.raises
14 changes: 14 additions & 0 deletions doc/matcher_internals/sequence_matchers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. _sequence-matcher-internals:

Sequence Matchers
-----------------

Matchers of sequences.


.. automodule:: hamcrest.library.collection.issequence_containinginorder
.. automodule:: hamcrest.library.collection.issequence_containinginanyorder
.. automodule:: hamcrest.library.collection.issequence_containing
.. automodule:: hamcrest.library.collection.isin
.. automodule:: hamcrest.library.collection.issequence_onlycontaining
.. automodule:: hamcrest.library.collection.is_empty
33 changes: 2 additions & 31 deletions doc/text_matchers.rst → doc/matcher_internals/text_matchers.rst
Original file line number Diff line number Diff line change
@@ -1,43 +1,14 @@
.. _text-matcher-internals:

Text Matchers
-------------

Matchers that perform text comparisons.


contains_string
^^^^^^^^^^^^^^^

.. automodule:: hamcrest.library.text.stringcontains


ends_with
^^^^^^^^^

.. automodule:: hamcrest.library.text.stringendswith

equal_to_ignoring_case
^^^^^^^^^^^^^^^^^^^^^^

.. automodule:: hamcrest.library.text.isequal_ignoring_case

equal_to_ignoring_whitespace
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. automodule:: hamcrest.library.text.isequal_ignoring_whitespace

matches_regexp
^^^^^^^^^^^^^^

.. automodule:: hamcrest.library.text.stringmatches

starts_with
^^^^^^^^^^^

.. automodule:: hamcrest.library.text.stringstartswith

string_contains_in_order
^^^^^^^^^^^^^^^^^^^^^^^^

.. automodule:: hamcrest.library.text.stringcontainsinorder
:exclude-members: string_contains_in_order
.. autofunction:: string_contains_in_order(string1[, string2[, ...]])
20 changes: 20 additions & 0 deletions doc/matcher_library/decorator_matchers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Decorator Matchers
------------------

Matchers that decorate other matchers for better expression.

See also, :ref:`Decorator matcher internals<decorator-matcher-internals>`.


described_as
^^^^^^^^^^^^

.. currentmodule:: hamcrest.core.core.described_as
.. autofunction:: described_as


is\_
^^^^

.. currentmodule:: hamcrest.core.core.is_
.. autofunction:: is_
31 changes: 31 additions & 0 deletions doc/matcher_library/dictionary_matchers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Dictionary Matchers
-------------------

Matchers of dictionaries.

See also, :ref:`Dictionary matcher internals<dictionary-matcher-internals>`


has_entries
^^^^^^^^^^^

.. currentmodule:: hamcrest.library.collection.isdict_containingentries
.. autofunction:: has_entries

has_entry
^^^^^^^^^

.. currentmodule:: hamcrest.library.collection.isdict_containing
.. autofunction:: has_entry

has_key
^^^^^^^

.. currentmodule:: hamcrest.library.collection.isdict_containingkey
.. autofunction:: has_key

has_value
^^^^^^^^^

.. currentmodule:: hamcrest.library.collection.isdict_containingvalue
.. autofunction:: has_value
31 changes: 31 additions & 0 deletions doc/matcher_library/logical_matchers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Logical Matchers
----------------

Boolean logic using other matchers.

See also, :ref:`Logical matcher internals<logical-matcher-internals>`


all_of
^^^^^^

.. currentmodule:: hamcrest.core.core.allof
.. autofunction:: all_of

any_of
^^^^^^

.. currentmodule:: hamcrest.core.core.anyof
.. autofunction:: any_of

anything
^^^^^^^^

.. currentmodule:: hamcrest.core.core.isanything
.. autofunction:: anything

is_not
^^^^^^

.. currentmodule:: hamcrest.core.core.isnot
.. autofunction:: is_not
23 changes: 23 additions & 0 deletions doc/matcher_library/number_matchers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Number Matchers
---------------

Matchers that perform numeric comparisons.

See also, :ref:`Number matcher internals<number-matcher-internals>`


close_to
^^^^^^^^

.. currentmodule:: hamcrest.library.number.iscloseto
.. autofunction:: close_to

greater_than, greater_than_or_equal_to, less_than, less_than_or_equal_to
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. currentmodule:: hamcrest.library.number.ordering_comparison
.. autofunction:: greater_than
.. autofunction:: greater_than_or_equal_to
.. autofunction:: less_than
.. autofunction:: less_than_or_equal_to

Loading

0 comments on commit 8f160f8

Please sign in to comment.