public
Created

  • Download Gist
gistfile1.scala
Scala
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
package com.github.jedesah.codesheet.api
 
import org.specs2.mutable._
 
import scala.tools.reflect.ToolBox
 
class Assumptions extends Specification {
"toolBox.eval()" should {
"use defined variables outside of actual tree being evaled (in my code)" in {
val bigUglyVariable = 1
val toolBox = scala.reflect.runtime.universe.runtimeMirror(getClass.getClassLoader).mkToolBox()
toolBox.eval(toolBox.parse("bigUglyVariable")) ==== 1
}
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.