diff options
author | Diego <diegolparra@gmail.com> | 2014-12-22 17:35:11 -0300 |
---|---|---|
committer | Diego <diegolparra@gmail.com> | 2014-12-24 18:58:12 -0300 |
commit | 8af94310494d912c9b09e851601e14cd46890c2a (patch) | |
tree | e4d7e54954209439a66ca1d7d4ecaa878eb82ae9 /kamon-core/src/test/scala | |
parent | 388dfb27a110e0ea633aa28e930e0e37b62aa597 (diff) | |
download | Kamon-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')
-rw-r--r-- | kamon-core/src/test/scala/kamon/util/GlobPathFilterSpec.scala | 29 |
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 } } } |