Skip to content

Instantly share code, notes, and snippets.

@jedesah
Created June 19, 2013 08:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jedesah/5812481 to your computer and use it in GitHub Desktop.
Save jedesah/5812481 to your computer and use it in GitHub Desktop.
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
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment