Posts

EasyB story fixed

The EasyB forums where helpful, and explained me that you can't mix the "given/when/then" and the "before/it" styles in the same story. That's what was causing the error. With that fixed, I moved the more complex scenarios in their own file, and everything comipiles and runs fine, with one exception: an older scenario fails. I committed anyway, but I'm investigating the original problem. I'm suspecting something is not quite coherent along all the examples, but I can't yet put my finger on it. In the meantime, I've created the equivalent Scala/specs project. It'll be interesting to test how it feels like...

Still no clues...

The code is in the repository, but it still doesn't run all the stories. I don't want to unit test all the stories inputs, though: it will defeat easyb's pourpose. I'm trying a pair of things seen in the forums, and eventually post a question there.

Back to unit tests

One thing that it doesn't seem easy with the easyB+groovy combination is getting a precise indication of what gone wrong. You can get a succesful build with a NPE in a scenario, and the resulting stacktrace is not very informative. So, we're back to unit testing to check basic functionality before passing the classes to behaviour testing. The commit I just made has a new unit test, that unfortunately doesn't pass. I'll work on it later.

Love, finally!

It works! I had to remove the enum (GMaven dies telling just 'enum' as error message), tweak some dependencies, re-read the GMaven docs (those steps should be included in the archetype!), and now the trivial scenario gets run! Now, let's work on it! Maybe, I should prepare an easyb maven archetype out of all this: it doesn't seem to exist...

EasyB+Maven woes

EasyB may make it easier, but not if you're in the maven camp. First, hit a subtle issue with the story naming. Now, easyb doesn't found the main classes. It may be my fault, since I meddled with the Maven builder, and it seems that the classes get compiled in bin-groovy, but CLI maven dies with the same problem, so it doesn't seem Eclipse-related. Now I modified the Groovy project properties so that the classess go in target/classes, but still no love...

First commit

Everything almost set up. Up to now, two great problems: The official and working way to integrate Groovy with maven is gmaven , and not groovy-maven. The group and artifact id are similar, so it's easy to be confused. I have a pesky java.lang.ArrayIndexOutOfBoundsException: 0 at org.easyb.domain.BehaviorFactory.stripPattern (BehaviorFactory.java:114) when I try to run my test scenario. Still unresolved... The solution for point 1 is quite easy: WRONG : groupid : org.codehaus.mojo.groovy artifactid : groovy-maven-plugin version : 1.0-beta-3 CORRECT : groupid : org.codehaus.groovy.maven artifactid : gmaven-plugin version : 1.0-rc-5 I'm still working on 2. I'll commit for now, however.

Eclipse + Groovy + EasyB + Maven...

So, in order to teach my coworkers BDD, I have to try it myself! Let's start with Groovy, that can be easier for them (and me!) than Scala. We'll try Scala later. To be really hip, why must set up the whole toolchain: Eclipse (Galileo M4, of course! it'll release in 5 days!) Groovy (1.6.1, in case we venture in Google AppEngine territory) Maven (you hate or love it. Sometimes both. But it's a consistent way to make you keep your tests honest, so you can compile). EasyB (Let's give it a try!) So, let's choose an interesting problem: http://schuchert.wikispaces.com/Rpn+Calculator+High+Level+Description Set up a BitBucket repo (Mercurial rocks!), just in case: https://michelemauro@bitbucket.org/michelemauro/rpncalc/ And let's start coding...