Skip to content

Instantly share code, notes, and snippets.

@garybernhardt
Created February 16, 2010 01:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • 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 gary.bernhardt@gmail.com)
# 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