aboutsummaryrefslogtreecommitdiff
path: root/kamon-core/src/test/scala/kamon/util/GlobPathFilterSpec.scala
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
commit8af94310494d912c9b09e851601e14cd46890c2a (patch)
treee4d7e54954209439a66ca1d7d4ecaa878eb82ae9 /kamon-core/src/test/scala/kamon/util/GlobPathFilterSpec.scala
parent388dfb27a110e0ea633aa28e930e0e37b62aa597 (diff)
downloadKamon-8af94310494d912c9b09e851601e14cd46890c2a.tar.gz
Kamon-8af94310494d912c9b09e851601e14cd46890c2a.tar.bz2
Kamon-8af94310494d912c9b09e851601e14cd46890c2a.zip
= core: modified version of GlobPathFilter and improve GlobPahFilterSpec
Diffstat (limited to 'kamon-core/src/test/scala/kamon/util/GlobPathFilterSpec.scala')
-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
}
}
}