I’ve been going nuts integrating Behat into Yii because BDD seemed so cool. Behat actually provides a yiiextension, but I’m not proficient with phars (think php jar), so it was annoying to get it integrated with Yii.
PHPUnit_story was cool and convenient, but was deprecated in 3.5 and removed in 3.6 in favor of behat.
Upon further reading though, I made the realization that Behat is unnecessary and very much a waste of time. The developer is the only one who will be dealing directly with the unit tests, so by turning the unit tests into awkward-english is just obfuscation. It will make less sense to the person working with the code and adds a layer of work to the project.
I am not saying anything bad about BDD, but BDD doesn’t need a DSL to be BDD. The test methods can still be written for Behaviors and it will still carry with it all the BDD benefits.
RoR*’s Cucumber should also be mentioned. The RoR community seems to have really embraced the BDD framework Cucumber. It should also be noted that RoR community seems to set the trends for other framework niches. That being the case, maybe cucumbers are in everyone’s future.. but as of now, the practice has not caught on anywhere else. Behat is the least popular PHP lib I’ve ever worked with. JBehave is considered out there. Same with Python’s “Lettuce”.
* Opinion: I consider Ruby to be a hobby language. People don’t make real applications in RoR, they’re more academic with it. Which isn’t bad, I’m glad to see Java displaced as the academic language, but people actually do stuff with Java. Ruby is a fine play language, but people who do Ruby, are probably not doing anything real.
Hm. Github, Twitter, Basecamp and Groupon run on Rails, to name just a few. Seems to me it’s just as ‘real’ as Java. Can you elaborate?
You make a good point. I try to figure out the trends of technologies I use every few months. RoR has an odd presence. I thought I was being generous by calling it the new academic language. I’ve been wondering recently how much of my Ruby prejudice has to simply do with its divergence from C. Maybe I’m just too old and can’t cope with languages ditching curly braces in favor of ends. Makes me compare the language to Basic. So part of it is me, I admit.