We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 093d76c commit eee9104Copy full SHA for eee9104
src/main.rs
@@ -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