aboutsummaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
authormarius a. eriksen <marius@twitter.com>2011-03-31 15:29:52 -0700
committerChristopher Vogt <oss.nsp@cvogt.org>2016-11-07 02:08:37 -0500
commit03f6504352e732c680d234e1124479d8a9e3f0ec (patch)
treed6d65a8fd784e8ccfbc494e56412016f825a4cdc /libraries
parent172cf805f43fcbb9b30d9cb2a47348fa649f19b3 (diff)
downloadcbt-03f6504352e732c680d234e1124479d8a9e3f0ec.tar.gz
cbt-03f6504352e732c680d234e1124479d8a9e3f0ec.tar.bz2
cbt-03f6504352e732c680d234e1124479d8a9e3f0ec.zip
[bc] util: fix EvaluatorSpec to be path indepedent.
Diffstat (limited to 'libraries')
-rw-r--r--libraries/eval/test/EvalTest.scala12
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"
}