Skip to content

Commit eee9104

Browse files
committed
chore: Delete code for first Rocket application
1 parent 093d76c commit eee9104

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

src/main.rs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +0,0 @@
1-
#[macro_use]
2-
extern crate rocket;
3-
4-
#[get("/")]
5-
fn hello() -> &'static str {
6-
"Hello, world!"
7-
}
8-
9-
#[launch]
10-
fn rocket() -> _ {
11-
rocket::build().mount("/", routes![hello])
12-
}
13-
14-
#[cfg(test)]
15-
mod test {
16-
use super::rocket;
17-
use rocket::http::Status;
18-
use rocket::local::blocking::Client;
19-
20-
#[test]
21-
fn test_hello() {
22-
let client = Client::tracked(rocket()).expect("valid rocket instance");
23-
let response = client.get(uri!(super::hello)).dispatch();
24-
25-
assert_eq!(response.status(), Status::Ok);
26-
assert_eq!(response.into_string().unwrap(), "Hello, world!");
27-
}
28-
}

0 commit comments

Comments
 (0)