aboutsummaryrefslogtreecommitdiff
path: root/kamon-core/src/test
diff options
context:
space:
mode:
authorDiego <diegolparra@gmail.com>2014-12-22 17:35:11 -0300
committerDiego <diegolparra@gmail.com>2014-12-24 18:58:12 -0300
commitbcb7f6d4dd86f0c0ff6839c4bc44a8ac7f834419 (patch)
tree60c1ed9c2fde230df32e102a953acbd921a6019d /kamon-core/src/test
parent5635149af76a85b167ca6f6ad45767bc45da31ba (diff)
downloadKamon-bcb7f6d4dd86f0c0ff6839c4bc44a8ac7f834419.tar.gz
Kamon-bcb7f6d4dd86f0c0ff6839c4bc44a8ac7f834419.tar.bz2
Kamon-bcb7f6d4dd86f0c0ff6839c4bc44a8ac7f834419.zip
= core: modified version of GlobPathFilter and improve GlobPahFilterSpec
Diffstat (limited to 'kamon-core/src/test')
-rw-r--r--kamon-core/src/test/scala/kamon/util/GlobPathFilterSpec.scala29
1 files changed, 20 insertions, 9 deletions
diff --git a/kamon-core/src/test/scala/kamon/util/GlobPathFilterSpec.scala b/kamon-core/src/test/scala/kamon/util/GlobPathFilterSpec.scala
index 0611e169..e0b837f3 100644
--- a/kamon-core/src/test/scala/kamon/util/GlobPathFilterSpec.scala
+++ b/kamon-core/src/test/scala/kamon/util/GlobPathFilterSpec.scala
@@ -22,22 +22,33 @@ class GlobPathFilterSpec extends WordSpecLike with Matchers {
"The GlobPathFilter" should {
"match a single expression" in {
- val filter = GlobPathFilter("/user/actor")
+ val filter = new GlobPathFilter("/user/actor")
- filter.accept("/user/actor") should be (true)
+ filter.accept("/user/actor") shouldBe true
- filter.accept("/user/actor/something") should be (false)
- filter.accept("/user/actor/somethingElse") should be (false)
+ filter.accept("/user/actor/something") shouldBe false
+ filter.accept("/user/actor/somethingElse") shouldBe false
}
"match all expressions in the same level" in {
- val filter = GlobPathFilter("/user/*")
+ val filter = new GlobPathFilter("/user/*")
- filter.accept("/user/actor") should be (true)
- filter.accept("/user/otherActor") should be (true)
+ filter.accept("/user/actor") shouldBe true
+ filter.accept("/user/otherActor") shouldBe true
- filter.accept("/user/something/actor") should be (false)
- filter.accept("/user/something/otherActor") should be (false)
+ filter.accept("/user/something/actor") shouldBe false
+ filter.accept("/user/something/otherActor") shouldBe false
+ }
+
+ "match all expressions in all levels" in {
+ val filter = new GlobPathFilter("/user/actor-**")
+
+ filter.accept("/user/actor-") shouldBe true
+ filter.accept("/user/actor-one") shouldBe true
+ filter.accept("/user/actor-one/other") shouldBe true
+
+ filter.accept("/user/something/actor") shouldBe false
+ filter.accept("/user/something/otherActor")shouldBe false
}
}
}