Djangoists:

Morelia /viridis/ is a Behavior Driven Development system for Python.
We use Morelia on all our private Django projects here at 
http://github.com/cuker
. (Other than that, Morelia itself does not require Django, but it
works great with django-test-extensions behind it!)

Morelia lets you write business rules in plain English:

  Scenario the customer bought too much
      When the customer bought $999 worth of swag
      Then we send them a free tee-shirt

  Scenario the customer bought too little much
      When the customer bought $800 worth of swag
      Then we don't send them a free tee-shirt

When you run your unit tests, Morelia builds a test case out of each
Scenario, and calls steps in your test suite whose doc-strings match
the step definitions, as regular expressions:

   def step_the_customer_bought_(self, more_than):
        r'the customer bought \$(\d+) worth of swag'

        self.customer = get_some_customer()
        self.customer.total_sales = int(more_than)

    def step_we_might_send_them_a_free_tee_shirt(self, might):
        r'we (don't send|send) them a free tee-shirt'

        qualified = might == 'send'
        assert self.customer.qualifies_for_free('tee-shirt') ==
qualified

Note that you can pass variables between steps using the self handle.

Another write-up for Morelia, for those who already grok BDD, appears
here:

  http://groups.google.com/group/cukes/browse_frm/thread/40facb6998f778cb

The complete user's manual, with illustrations, is here:

  http://c2.com/cgi/wiki?MoreliaViridis

Good hunting!

--
  Phlip
  http://penbird.tumblr.com/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to