1sure
2====
3
4An idiomatic testing library for python with powerful and flexible assertions. Sure
5is heavily inspired in `RSpec Expectations <http://rspec.info/documentation/3.5/rspec-expectations/>`_ and `should.js <https://github.com/shouldjs/should.js>`_
6
7|Build Status| |PyPI package version| |PyPI python versions| |Join the chat at https://gitter.im/gabrielfalcao/sure|
8
9
10Installing
11----------
12
13.. code:: bash
14
15    $ pip install sure
16
17Documentation
18-------------
19
20Available in the `website <https://sure.readthedocs.io/en/latest/>`__ or under the
21``docs`` directory.
22
23You can also build the documentation locally using sphinx:
24
25.. code:: bash
26
27    make docs
28
29Here is a tease
30---------------
31
32Equality
33~~~~~~~~
34
35(number).should.equal(number)
36^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
37
38.. code:: python
39
40    import sure
41
42    (4).should.be.equal(2 + 2)
43    (7.5).should.eql(3.5 + 4)
44
45    (3).shouldnt.be.equal(5)
46
47Assert dictionary and its contents
48^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
49
50.. code:: python
51
52    {'foo': 'bar'}.should.equal({'foo': 'bar'})
53    {'foo': 'bar'}.should.have.key('foo').which.should.equal('bar')
54
55"A string".lower().should.equal("a string") also works
56^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
57
58.. code:: python
59
60    "Awesome ASSERTIONS".lower().split().should.equal(['awesome', 'assertions'])
61
62.. |Build Status| image:: https://travis-ci.org/gabrielfalcao/sure.png?branch=master
63   :target: https://travis-ci.org/gabrielfalcao/sure
64.. |PyPI package version| image:: https://badge.fury.io/py/sure.svg
65   :target: https://badge.fury.io/py/sure
66.. |PyPI python versions| image:: https://img.shields.io/pypi/pyversions/sure.svg
67   :target: https://pypi.python.org/pypi/sure
68.. |Join the chat at https://gitter.im/gabrielfalcao/sure| image:: https://badges.gitter.im/gabrielfalcao/sure.svg
69   :target: https://gitter.im/gabrielfalcao/sure?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
70