Created
February 16, 2010 01:07
-
-
Save garybernhardt/305174 to your computer and use it in GitHub Desktop.
How would you rather write your tests?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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