aboutsummaryrefslogtreecommitdiff
path: root/kamon-core/src/test/scala/ExtraSpec.scala
blob: b8dc053de24744d513d3f4c90b09b63d486527d6 (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
import akka.actor.ActorSystem
import akka.testkit.TestKit
import org.scalatest.WordSpecLike
import shapeless._

class ExtraSpec extends TestKit(ActorSystem("ExtraSpec")) with WordSpecLike {

  "the Extra pattern helper" should {
    "be constructed from a finite number of types" in {
      Extra.expecting[String :: Int :: HNil].as[Person]
    }
  }

  case class Person(name: String, age: Int)
}

/**
 *    Desired Features:
 *      1. Expect messages of different types, apply a function and forward to some other.
 */

object Extra {
  def expecting[T <: HList] = new Object {
    def as[U <: Product] = ???
  }
}

/*
extra of {
  expect[A] in { actor ! msg}
  expect[A] in { actor ! msg}
} as (A, A) pipeTo (z)*/