Skip to main content

Create and run executable specifications with Pythonic BDD style grammar

Project description



Specit is **no longer actively developed**. It has been replaced by:

**compare**: for the pluggable `expect` syntax

- package:
- source:
- docs:

**checkit**: enables `nose` to detect and run test cases defined using BDD style "describe" and "it"

- package:
- source:


Specit is a minimalistic tool to assist developers in creating
and validating executable specifications for python software. It
aims to:

1. Provide a readable, pythonic syntax for defining expectations in your example specifications.
2. Provide a simple tool for validating your specifications.

To this end, specit provides two components to simplify your
work with specs. The **expect** construct allows you to indicate
verifyable expectations of your software. It is a replacement for
the "self.assert..." syntax. The **specit** command uses
`Nose <>`_ to
validate your specifications.


- uses nose for discovering and running specs
- provides a base set of matchers for defining expectations
- easy to extend with custom matchers


All the requirements for using specit are auto-installed if you
use pip or easy_install. Here they are:

- `Nose <>`_


The easiest way to install specit is with ``pip install spectit``
or with ``easy_install specit``. Alternatively, you may
`download <>`_ the
source package from PyPI, extract it and install it using
``python install``.

What you get

When you install the package, you get two shiny components that
may help you achieve the goals above.

**"expect"**, is the grammar component. It provides a construct with
extensible matchers that enables you to describe the expected
behaviour of your software using a pythonic BDD manner. Again, this
helps you maintain your flow of thought without succumbing to
test-focused non-pythonic distrations like "self.assertEqual(s)...",
"self.assertTrue", etc.

**"specit"**, is the commandline component. It uses nose to discover
and execute specifications using flexible matching rules so that you
are not limited to using distracting unittest (test focused) constructs
like "def test..." or name your files "".

Here is a trivial example of the clarity you gain when you
employ the "expect" construct in your specs::

> cat
def greet():
return 'Hello you'

> cat
from specit import expect
from greeting import greet

expect(greet).to_return('Hello you')

Even more iteresting is the fact that you no longer have to
subject yourself to the unnecessary cruft needed for unittest
test cases. You can now create a spec like this::

> cat
class DescribeCool(object):

def it_is_cool(self):

Or even::

> cat
class MyAwesomeSpecs():

def should_always_smile(self):

Finally, when you want to validate your software against the sepcs,
simply run the commandline tool "specit" in your project
directory like so::

> specit
Ran 2 tests in 0.006s



I welcome any questions or feedback about bugs and suggestions on how to
improve specit. Let me know what you think about specit. I am on twitter
`@RudyLattae <>`_ . I appreciate constructive
criticsms or high fives :)

Do you have suggestions for improvement? Then please create an
`issue <>`_ with details
of what you would like to see. I'll take a look at it and work with you to either kill
the idea or implement it.


0.1.2a (2010-12-08)

* First public release


- Core matchers:
- to_contain
- to_be_truthy
- to_be_falsy

- Provide better documentation and package information

- How to contribute / developer setup

- package url?

- distutils, setuptools or distribute?

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for specit, version 0.2.1z
Filename, size File type Python version Upload date Hashes
Filename, size (17.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page