DESCRIPTION.rst 1.9 KB

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