package net.ceedubs.ficus
package readers

import com.typesafe.config.ConfigFactory
import scala.concurrent.duration._

class DurationReadersSpec extends Spec with DurationReaders { def is =
  "The finite duration reader should" ^
    "read a millisecond value" ! readMillis ^
    "read a minute value" ! readMinute

  def readMillis = {
    val cfg = ConfigFactory.parseString("myValue = 15")
    finiteDurationReader.get(cfg, "myValue") must beEqualTo(15 millis)
  }

  def readMinute = {
    val cfg = ConfigFactory.parseString("myValue = \"15 minutes\"")
    finiteDurationReader.get(cfg, "myValue") must beEqualTo(15 minutes)
  }

}

package net.ceedubs.ficus
package readers

import com.typesafe.config.ConfigFactory
import scala.concurrent.duration.{FiniteDuration, MILLISECONDS, MINUTES}

class DurationReadersSpec extends Spec with DurationReaders { def is =
  "The finite duration reader should" ^
    "read a millisecond value" ! readMillis ^
    "read a minute value" ! readMinute

  def readMillis = {
    val cfg = ConfigFactory.parseString("myValue = 15")
    finiteDurationReader.get(cfg, "myValue") must beEqualTo(FiniteDuration(15, MILLISECONDS))
  }

  def readMinute = {
    val cfg = ConfigFactory.parseString("myValue = \"15 minutes\"")
    finiteDurationReader.get(cfg, "myValue") must beEqualTo(FiniteDuration(15, MINUTES))
  }

}

--- 
+++ 
@@ -2,7 +2,7 @@
 package readers
 
 import com.typesafe.config.ConfigFactory
-import scala.concurrent.duration.{FiniteDuration, MILLISECONDS, MINUTES}
+import scala.concurrent.duration._
 
 class DurationReadersSpec extends Spec with DurationReaders { def is =
   "The finite duration reader should" ^
@@ -11,12 +11,12 @@
 
   def readMillis = {
     val cfg = ConfigFactory.parseString("myValue = 15")
-    finiteDurationReader.get(cfg, "myValue") must beEqualTo(FiniteDuration(15, MILLISECONDS))
+    finiteDurationReader.get(cfg, "myValue") must beEqualTo(15 millis)
   }
 
   def readMinute = {
     val cfg = ConfigFactory.parseString("myValue = \"15 minutes\"")
-    finiteDurationReader.get(cfg, "myValue") must beEqualTo(FiniteDuration(15, MINUTES))
+    finiteDurationReader.get(cfg, "myValue") must beEqualTo(15 minutes)
   }
 
 }
Use implicit duration conversions in duration reader spec
