diff options
author | marius a. eriksen <marius@twitter.com> | 2011-03-31 15:29:52 -0700 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2016-11-07 02:08:37 -0500 |
commit | 03f6504352e732c680d234e1124479d8a9e3f0ec (patch) | |
tree | d6d65a8fd784e8ccfbc494e56412016f825a4cdc /libraries/eval | |
parent | 172cf805f43fcbb9b30d9cb2a47348fa649f19b3 (diff) | |
download | cbt-03f6504352e732c680d234e1124479d8a9e3f0ec.tar.gz cbt-03f6504352e732c680d234e1124479d8a9e3f0ec.tar.bz2 cbt-03f6504352e732c680d234e1124479d8a9e3f0ec.zip |
[bc] util: fix EvaluatorSpec to be path indepedent.
Diffstat (limited to 'libraries/eval')
-rw-r--r-- | libraries/eval/test/EvalTest.scala | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libraries/eval/test/EvalTest.scala b/libraries/eval/test/EvalTest.scala index 356ef80..a77ed97 100644 --- a/libraries/eval/test/EvalTest.scala +++ b/libraries/eval/test/EvalTest.scala @@ -3,22 +3,22 @@ package com.twitter.util import org.specs.Specification import java.io.{File, FileOutputStream} -object EvaluatorSpec extends Specification { - def file(path: String) = { - new File("util-eval/src/test/resources", path) - } +import com.twitter.io.TempFile +object EvaluatorSpec extends Specification { "Evaluator" should { "apply('expression')" in { Eval[Int]("1 + 1") mustEqual 2 } "apply(new File(...))" in { - Eval[Int](file("OnePlusOne.scala")) mustEqual 2 + Eval[Int](TempFile.fromResourcePath("/OnePlusOne.scala")) mustEqual 2 } "apply(new File(...), new File(...))" in { - val derived = Eval[() => String](file("/Base.scala"), file("/Derived.scala")) + val derived = Eval[() => String]( + TempFile.fromResourcePath("/Base.scala"), + TempFile.fromResourcePath("/Derived.scala")) derived() mustEqual "hello" } |