1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-25 22:49:21 +02:00

disable unmigrated crates

This commit is contained in:
Nikolay Kim
2019-11-21 00:52:38 +06:00
parent b510527a9f
commit ff62facc0d
9 changed files with 76 additions and 64 deletions

View File

@ -14,7 +14,7 @@ categories = ["network-programming", "asynchronous",
license = "MIT/Apache-2.0"
exclude = [".gitignore", ".travis.yml", ".cargo/config", "appveyor.yml"]
edition = "2018"
# workspace = ".."
workspace = ".."
[package.metadata.docs.rs]
features = []

View File

@ -23,24 +23,26 @@ pub use actix_testing::*;
///
/// ```rust
/// use actix_http::HttpService;
/// use actix_http_test::TestServer;
/// use actix_web::{web, App, HttpResponse};
/// use actix_http_test::{block_on, TestServer};
/// use actix_web::{web, App, HttpResponse, Error};
///
/// fn my_handler() -> HttpResponse {
/// HttpResponse::Ok().into()
/// async fn my_handler() -> Result<HttpResponse, Error> {
/// Ok(HttpResponse::Ok().into())
/// }
///
/// fn main() {
/// let mut srv = TestServer::new(
/// || HttpService::new(
/// App::new().service(
/// web::resource("/").to(my_handler))
/// )
/// );
/// block_on( async {
/// let mut srv = TestServer::start(
/// || HttpService::new(
/// App::new().service(
/// web::resource("/").to_async(my_handler))
/// )
/// );
///
/// let req = srv.get("/");
/// let response = srv.block_on(req.send()).unwrap();
/// assert!(response.status().is_success());
/// let req = srv.get("/");
/// let response = req.send().await.unwrap();
/// assert!(response.status().is_success());
/// })
/// }
/// ```
pub struct TestServer;