summaryrefslogtreecommitdiff
path: root/src/test/scala/hbt/StaticContextTests.scala
blob: c7fcdcd7f5819f7180138688a50ec9a531c9dfca (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package hbt
import DefCtx.StaticContext
import utest._
class Helper{
  val static = implicitly[StaticContext]
  object Nested {
    val static = implicitly[StaticContext]
  }
  def method = implicitly[StaticContext]
}
object StaticContextTests extends TestSuite{
  val static = implicitly[StaticContext]
  object Nested{
    val static = implicitly[StaticContext]
    def method = implicitly[StaticContext]
    class Helper{
      val static = implicitly[StaticContext]
    }
  }

  def method = implicitly[StaticContext]
  val tests = Tests{
    val helper = new Helper()
    'inObject - assert(static.value)
    'inClass- assert(!helper.static.value)
    'inMethod - assert(!method.value)

    'inObjectObject - assert(Nested.static.value)
    'inObjectClass- assert(!helper.static.value)
    'inObjectMethod- assert(!Nested.method.value)

    'inClassObject - assert(!helper.Nested.static.value)
    'inClassMethod- assert(!helper.method.value)

  }
}