AliSoftware / AliSoftware/OHHTTPStubs

Add path component matching to request testing

Đang mở
#125 8 bình luận 3 reaction 0 người được giao Xem trên GitHub
Enhancement Help Wanted Open Discussion Waiting for input
Ngôn ngữ chính
Objective-C
Star
5.1k
Fork
597
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

[Overcoat](https://github.com/Overcoat/Overcoat) implements service endpoint testing in a neat fashion:

`You don't need to specify the full path, and you can use * and ** to match any text or # to match only digits.`

`If you use * and #, they are strict path matchings, so the number of path components must be equal. The ** just matches any text and has no path components number limitation.`

| Match String | Path | Result |
| --- | --- | --- |
| statuses/* | statuses/user_timeline | Matched |
| statuses/# | statuses/user_timeline | Missed (wrong type, the path component after statuses should be dights only) |
| statuses/* | statuses/retweets/12345 | Missed (wrong number of path components, there should be only one path component after statuses) |
| statuses /\* /* | statuses/retweets/12345 | Matched |
| statuses/** | statuses/retweets/12345 | Matched |
| statuses/** | statuses/retweets/12345/extra | Matched (the number of path components doesn't matter) |
| statuses/retweets/* | statuses/retweets/12345 | Matched |
| statuses/retweets/# | statuses/retweets/12345 | Matched |

It'd be really neat if OHHTTPStubs had a method that implemented similar logic, rather than always having to manually work out this logic on every single test.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.