mixxorz / behave-django

Behave BDD integration for Django
https://pythonhosted.org/behave-django/
38 stars 5 forks source link

Support for trailing `:` in steps #49

Closed Goutte closed 9 years ago

Goutte commented 9 years ago

Say I write a step like this :

Given there is this user :
"""
username: Bender
password: (\/) (;,,;) (\/)
email: 2716057@robots.mom
"""

(because yeah, deep down, Bender is rooting for Zoidberg)

And define it like this :

@Given(u"there is this user :")
def there_is_this_user(context):
    # do stuff with context.text in YAML format

The trailing : screws up matching ! I have to define it like this, with a trailing space :

@Given(u"there is this user ")

Maybe it's a behave issue, not a behave-django issue, but I don't know the codebases. Can you help me ?

I know I can easily go around this problem by using the regex parser instead, but I'm trying to teach BDD to people that don't know first thing about regexes and we all need them to learn BDD fast.

mixxorz commented 9 years ago

This is most definitely a behave issue. behave-django just makes the two work well together. It doesn't contain any of the parsing logic.