Skip to content

Behavior-driven development library for Python in the spirit of RSpec

Notifications You must be signed in to change notification settings

zacstewart/pyspec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PySpec

Build Status

Documentation

Express expected outcomes with examples.

mug = Mug()
with description(Mug):
    with description('.fill')
        with context('coffee'):
            with specification('fills the mug with coffee'):
                mug.fill('coffee')
                expect(mug.contents).to(eq('coffee'))

Try it out

git clone git@github.com:zacstewart/pyspec.git
cd pyspec
python setup.py install
pyspec example_specs/
F.F.E.F.

3 failures, 1 errors

pyspec.core <class 'pyspec.core.BrokenFizzBuzz'> .convert 15 returns fizzbuzz
Expected fizz to be equal to fizzbuzz

pyspec.core <class 'pyspec.core.BrokenFizzBuzz'> .convert 5 returns buzz
Expected 5 to be equal to buzz

pyspec.core normal assertions are treated as failures and not errors
False wasn't True!

pyspec.core <class 'pyspec.core.BrokenFizzBuzz'> .floop does not exist
'BrokenFizzBuzz' object has no attribute 'floop'

About

Behavior-driven development library for Python in the spirit of RSpec

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages