Skip to content

Commit

Permalink
Fix examples and add a couple more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jsdw committed Jan 25, 2020
1 parent 5800d75 commit d576ce4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/examples.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ Declare routes that do nothing using \"nothing\" (can be useful for scripted use
# http://localhost:8080/1/2/3/api/foo => ./files/foo.json
# http://localhost:8080/wibble/api/foo => ./files/foo.json
# http://localhost:8080/bar/api/foo => ./files/foo.json
# http://localhost:8080/api/foo => No route matches this".white()
# http://localhost:8080/api/foo => No route matches this".white(),

example9="# Pick a specific status code (only valid HTTP status codes are allowed):
weave 8080 to statuscode://403
# The alias \"nothing\" returns a 404 Not Found status:
weave 8080 to nothing"
weave 8080 to nothing",

example10="weave nothing and 8080 to 9090"

Expand Down
27 changes: 12 additions & 15 deletions src/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,21 +202,18 @@ mod test {
],
0
),
// // "nothing" can take the palce of a destination (it'll return 404):
// (
// vec![
// s("nothing"), s("to"), s("9090"), s("and"),
// s("8081"), s("to"), s("9091"), s("and"),
// s("nothing"), s("and"),
// s("nothing"), s("and"),
// s("8082"), s("to"), s("9092"),
// ],
// vec![
// route("http://localhost:8081/", "http://localhost:9091"),
// route("http://localhost:8082/", "http://localhost:9092"),
// ],
// 0
// ),
// "nothing" can take the place of a destination (it'll return 404):
(
vec![
s("8081"), s("to"), s("nothing"), s("and"),
s("8082"), s("to"), s("statuscode://403")
],
vec![
route("http://localhost:8081/", "statuscode://404"),
route("http://localhost:8082/", "statuscode://403"),
],
0
),
(
vec![s("8080/foo/bar"), s("to"), s("9090/foo"), s("--more"), s("args")],
vec![
Expand Down

0 comments on commit d576ce4

Please sign in to comment.