@@ -38,15 +38,15 @@ final class URLMatcherSpec: QuickSpec {
3838 expect ( result) . to ( beNil ( ) )
3939 }
4040
41- fit ( " returns a result for totally matching url " ) {
41+ it ( " returns a result for totally matching url " ) {
4242 let candidates = [ " myapp://hello/<name> " , " myapp://hello/world " ]
4343 let result = matcher. match ( " myapp://hello/world " , from: candidates)
4444 expect ( result) . notTo ( beNil ( ) )
4545 expect ( result? . pattern) == " myapp://hello/world "
4646 expect ( result? . values. count) == 0
4747 }
4848
49- fit ( " returns a result for totally matching url2 " ) {
49+ it ( " returns a result for the longest matching url " ) {
5050 let candidates = [ " myapp://<path:path> " , " myapp://hello/<name> " ]
5151 let result = matcher. match ( " myapp://hello/world " , from: candidates)
5252 expect ( result) . notTo ( beNil ( ) )
@@ -165,5 +165,11 @@ final class URLMatcherSpec: QuickSpec {
165165 let result2 = matcher. match ( " http://host/anything " , from: candidates2)
166166 expect ( result1? . pattern) . to ( equal ( result2? . pattern) )
167167 }
168+
169+ it ( " returns nil when there is anotehr url in the path (#123) " ) {
170+ let candidates = [ " myapp://browser/<url> " ]
171+ let result = matcher. match ( " myapp://browser/http://google.fr " , from: candidates)
172+ expect ( result) . to ( beNil ( ) )
173+ }
168174 }
169175}
0 commit comments