Skip to content

Commit

Permalink
docs: adding new matchers, tidying up
Browse files Browse the repository at this point in the history
  • Loading branch information
petereon committed Feb 24, 2022
1 parent b5d968a commit 0c847d3
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,26 @@ expect(10).to.be("10") # This will succeed

Currently available matchers are:

- `equal`
- `be`
- `contain`
- `be_contained_in`
- `be_empty`
- `be_true`
- `be_false`
- `be_truthy`
- `be_falsey`
- `be_of_type`
- `inherit`

:building_construction: __Note__: Numeric matchers are in-progress :building_construction:
- Eqality and similarity
- `equal(self, value)`: equivalent to "`==`"
- `be(self, value)`: will check if string representation of values is same or if two objects have the same attributes or are equal
- Numeric
- `be_greater_than(self, value)`: equivalent to "`>`"
- `be_lesser_than(self, value)`: equivalent to "`<`"
- `be_greater_or_equal_to(self, value)`: equivalent to "`>=`"
- `be_lesser_or_equal_to(self, value)`: equivalent to "`<=`"
- `is_numeric(self)`: checks if `self.value` is a number or string covertible to a number
- Containment and Emptiness
- `contain(self, value)`: equivalent to "`in`"
- `be_contained_in(self, value)`: equivalent to "`in`"
- `be_empty(self)`: checks if `self.value` is iterable and `False`
- Truthiness
- `be_true(self)`: checks if `self.value` is `True`
- `be_false(self)`: checks if `self.value` is `False`
- `be_truthy(self)`: checks if `self.value` behaves _true_ in if statement
- `be_falsey(self)`: checks if `self.value` behaves _false_ in if statement
- Typing
- `be_of_type(self, value)`: checks if `self.value` is of specified type
- `inherit(self, value)`: checks if `self.value` inherits/is a specified type

__Project is currently in its infancy, contributors and issues are welcome__

0 comments on commit 0c847d3

Please sign in to comment.