adding a test for isFinal
This commit is contained in:
parent
1f85eb6260
commit
c2f2f4fe94
|
@ -77,5 +77,26 @@ class URLAsResourceNameTest extends Specification {
|
||||||
output << ["/users/:id/list_repository/"]
|
output << ["/users/:id/list_repository/"]
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
def "skip others rules if the current is set as final"() {
|
||||||
|
|
||||||
|
setup:
|
||||||
|
def decorator = new URLAsResourceName()
|
||||||
|
def r1 = new URLAsResourceName.Config.Rule(/(\\/users\\/)([^\/]*)/, /$1:id1/)
|
||||||
|
decorator.setPatterns(Arrays.asList(r1, URLAsResourceName.RULE_DIGIT))
|
||||||
|
|
||||||
|
when:
|
||||||
|
r1.setFinal(true)
|
||||||
|
def norm = decorator.norm(input)
|
||||||
|
|
||||||
|
then:
|
||||||
|
norm == output
|
||||||
|
|
||||||
|
where:
|
||||||
|
input << ["/users/guillaume/list_repository/"]
|
||||||
|
output << ["/users/:id1/list_repository/"]
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue