Annotations to describe examples in object behaviour

23 views
Skip to first unread message

Yosmany García Alfonso

unread,
Jul 6, 2014, 7:47:15 PM7/6/14
to phpsp...@googlegroups.com
I'm getting long function names. I wonder if it would be possible to describe examples in object behaviour using annotations?
```
/**
 * @example("It divide a number by another one")
 */
function runDivideTest1()

/**
 * @example("It throws an exception if divisor is zero")
 */
function runDivideTest2()
```

What do you think about this?

Konstantin Kudryashov

unread,
Jul 10, 2014, 5:07:53 AM7/10/14
to phpsp...@googlegroups.com
I don’t like it. You introduced second thing to worry about in your spec (in addition to method names). There’s nothing wrong with long method names in specs - you will never call them manually.

Konstantin Kudryashov
--- PHP developer, BDD evangelist, Scrum master

a: http://about.me/everzet
b: http://everzet.com
c: https://github.com/everzet
--
You received this message because you are subscribed to the Google Groups "PHPSpec - Behavior Driven Design (BDD) for PHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phpspec-dev...@googlegroups.com.
To post to this group, send email to phpsp...@googlegroups.com.
Visit this group at http://groups.google.com/group/phpspec-dev.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages