The point is missed

Museum of public mistakes and unfinished projects

Posts Tagged ‘bdd

Phasing over from java to scala pt. 4 – Writing specs with specs

with 7 comments

In the last part I figured out how to make Buildr run specs that are also runnable from Eclipse via JUnit. I started writing my first spec and we are now in the position to make it fail. What we are trying to acomplish is to make directories behave as nodes in a graph, at the moment, only the files show up as nodes.

The spec I wrote currently looks like this:

class PublishSiteGraphSpecTest extends JUnit4(PublishSiteGraphSpec)
object PublishSiteGraphSpec extends Specification {
  "directories are nodes" in {
  }
}

Let us fill in the details about what we actually mean when we say that directories should be nodes:

Read the rest of this entry »

Written by johlrogge

September 14, 2008 at 10:05 pm

Posted in Uncategorized

Tagged with , , ,

Phasing over from java to scala pt. 3 – What about the tests?

with 2 comments

I’ve now spent some time every now and then converting Java-classes into Scala classes. I’m one of those Agile loudmouths so some of you may wonder what I’m doing about the tests. I mentioned that all tests pass in pt. 2 but I have not written about how I test. Well, it probably comes as no surprise that the current code is tested in JUnit and I have simply kept my old test-suite intact when phasing over. This strategy works well since what I’m really doing is refactoring. I move class by class in baby steps, running my tests after each change to make sure that everything is still working as it should. But I’m starting to be done with the move now and a strategy for writing new scala-code seems more and more relevant.

Read the rest of this entry »

Written by johlrogge

September 10, 2008 at 9:44 pm

Posted in Uncategorized

Tagged with , , , ,