diff --git a/helpers/pagetop-macros/src/lib.rs b/helpers/pagetop-macros/src/lib.rs index c6de0dd5..923aa922 100644 --- a/helpers/pagetop-macros/src/lib.rs +++ b/helpers/pagetop-macros/src/lib.rs @@ -17,7 +17,7 @@ use syn::{parse_macro_input, parse_str, DeriveInput, ItemFn}; /// /// # Ejemplos /// -/// ``` +/// ```rust#ignore /// #[fn_builder] /// pub fn set_example(&mut self) -> &mut Self { /// // implementación @@ -26,7 +26,7 @@ use syn::{parse_macro_input, parse_str, DeriveInput, ItemFn}; /// /// Añadirá al código el siguiente método: /// -/// ``` +/// ```rust#ignore /// #[inline] /// pub fn with_example(mut self) -> Self { /// self.set_example(); @@ -159,7 +159,7 @@ pub fn derive_component_classes(input: TokenStream) -> TokenStream { /// /// # Ejemplos /// -/// ``` +/// ```rust#ignore /// #[pagetop::main] /// async fn main() { /// async { println!("Hello world!"); }.await @@ -180,7 +180,7 @@ pub fn main(_: TokenStream, item: TokenStream) -> TokenStream { /// /// # Ejemplos /// -/// ``` +/// ```rust#ignore /// #[pagetop::test] /// async fn test() { /// assert_eq!(async { "Hello world" }.await, "Hello world"); diff --git a/pagetop/src/config.rs b/pagetop/src/config.rs index 07924057..3db091db 100644 --- a/pagetop/src/config.rs +++ b/pagetop/src/config.rs @@ -57,7 +57,7 @@ //! Then, use the [`include_config!`](crate::include_config) macro to initialize your settings with //! type-safe structures and predefined values: //! -//! ``` +//! ```rust#ignore //! use pagetop::prelude::*; //! use serde::Deserialize; //! @@ -101,7 +101,7 @@ //! //! Access the settings directly in your code: //! -//! ``` +//! ```rust#ignore //! use pagetop::prelude::*; //! use crate::config; //! diff --git a/pagetop/src/html/maud.rs b/pagetop/src/html/maud.rs index 801895e5..db9308af 100644 --- a/pagetop/src/html/maud.rs +++ b/pagetop/src/html/maud.rs @@ -34,7 +34,7 @@ mod escape; /// /// # Example /// -/// ```rust +/// ```rust#ignore /// use maud::Escaper; /// use std::fmt::Write; /// let mut s = String::new(); @@ -72,7 +72,7 @@ impl<'a> fmt::Write for Escaper<'a> { /// /// # Example /// -/// ```rust +/// ```rust#ignore /// use maud::{html, Markup, Render}; /// /// /// Provides a shorthand for linking to a CSS stylesheet. @@ -188,7 +188,7 @@ impl_render_with_itoa! { /// /// # Example /// -/// ```rust +/// ```rust#ignore /// use maud::html; /// use std::net::Ipv4Addr; /// @@ -259,7 +259,7 @@ impl + Default> Default for PreEscaped { /// /// A minimal web page: /// -/// ```rust +/// ```rust#ignore /// use maud::{DOCTYPE, html}; /// /// let markup = html! { diff --git a/pagetop/src/lib.rs b/pagetop/src/lib.rs index 0a1ea105..664bd7a5 100644 --- a/pagetop/src/lib.rs +++ b/pagetop/src/lib.rs @@ -29,7 +29,7 @@ //! //! # ⚡️ Quick start //! -//! ```rust +//! ```rust#ignore //! use pagetop::prelude::*; //! //! struct HelloWorld; diff --git a/pagetop/src/locale.rs b/pagetop/src/locale.rs index 6cc79c9f..2f96fa49 100644 --- a/pagetop/src/locale.rs +++ b/pagetop/src/locale.rs @@ -70,7 +70,7 @@ //! [`include_locales!`](crate::include_locales) macro to integrate them into your module or //! application. If your resources are located in the `"src/locale"` directory, simply declare: //! -//! ``` +//! ```rust#ignore //! use pagetop::prelude::*; //! //! include_locales!(LOCALES_SAMPLE); @@ -78,7 +78,7 @@ //! //! But if they are in another directory, then you can use: //! -//! ``` +//! ```rust#ignore //! use pagetop::prelude::*; //! //! include_locales!(LOCALES_SAMPLE from "path/to/locale"); diff --git a/pagetop/src/util.rs b/pagetop/src/util.rs index a34ee599..98c2dc9a 100644 --- a/pagetop/src/util.rs +++ b/pagetop/src/util.rs @@ -103,7 +103,7 @@ impl TypeInfo { /// /// # Examples /// -/// ``` +/// ```rust#ignore /// let root = "/home/user"; /// let relative = "documents"; /// let abs_dir = absolute_dir(root, relative).unwrap(); diff --git a/tests/main.rs b/tests/main.rs new file mode 100644 index 00000000..b93d337f --- /dev/null +++ b/tests/main.rs @@ -0,0 +1,2 @@ +#[cfg(test)] +mod server; diff --git a/tests/server/health_check.rs b/tests/server/health_check.rs new file mode 100644 index 00000000..578ffc66 --- /dev/null +++ b/tests/server/health_check.rs @@ -0,0 +1,14 @@ +use pagetop::prelude::*; + +struct HealthCheck; + +impl PackageTrait for HealthCheck {} + +#[pagetop::test] +async fn health_check_works() { + let app = service::test::init_service(Application::prepare(&HealthCheck).test()).await; + let req = service::test::TestRequest::get().uri("/").to_request(); + let _resp = service::test::call_service(&app, req).await; + + // assert_eq!("OK", "OK"); +} diff --git a/tests/server/mod.rs b/tests/server/mod.rs new file mode 100644 index 00000000..f56eeca6 --- /dev/null +++ b/tests/server/mod.rs @@ -0,0 +1 @@ +mod health_check;