Skip to content

Instantly share code, notes, and snippets.

@garybernhardt
Created February 16, 2010 01:07
Show Gist options
  • Save garybernhardt/305174 to your computer and use it in GitHub Desktop.
Save garybernhardt/305174 to your computer and use it in GitHub Desktop.
How would you rather write your tests?
# How would you rather write your tests?
# Tell it to @garybernhardt (or [email protected])
# 1) Hypothetical RSpec-inspired Python library (PSpec?) that does violence to nature
with describe('my class'):
with it('adds numbers'):
sum = MyClass.add(1, 1)
sum.should == 2
# Actually, I think the only acceptable name for the above library would be "withit"
# 2) Mote (minimal violence to nature) + Expecter Gadget (violence free)
# (Both already exist!)
def describe_my_class():
def it_adds_numbers():
sum = MyClass.add(1, 1)
expect(sum) == 2
# 3) Rocking the setUp/tearDown like it's 2000 again.
class KillMeNowTest:
def test_that_it_is_ten_years_ago(self):
assert False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment