Skip to content

Instantly share code, notes, and snippets.

View p3t0r's full-sized avatar

Peter Maas p3t0r

  • Adevinta
  • Hilversum, the Netherlands
View GitHub Profile
package com.log4.methodmissing
import java.io.File
class Path(name: String = "", parent: Option[Path] = None) extends Dynamic {
def applyDynamic(methodName: String)(args: Any*) = new Path(methodName, Option(this))
override def toString = (if(parent.isDefined) parent.get.toString + File.separatorChar else "") + name
}
@p3t0r
p3t0r / Scorer.scala
Created June 30, 2011 08:37
Scala TDD workshop - Implement a Yahtzee scorer
/**
* Results of a 1 hour 'bucketline' exercise @ Marktplaats to test-drive the development
* of a Yahtzee scorer in Scala.
*/
// --- the test --- //
import org.scalatest.FlatSpec
import org.scalatest.matchers.ShouldMatchers
import Scorer._