From 77752b2d8486fbc6d861b690913c2334ccacba0f Mon Sep 17 00:00:00 2001 From: Avery Harnish Date: Mon, 17 Feb 2020 20:28:21 -0600 Subject: [PATCH] Test examples and add docs to Cargo.toml --- Cargo.toml | 5 ++++- README.md | 3 ++- src/config/border/components.rs | 27 +++++++++++++++++++++------ src/lib.rs | 1 + src/tests/mod.rs | 9 --------- tests/mod.rs | 9 +++++++++ 6 files changed, 37 insertions(+), 17 deletions(-) delete mode 100644 src/tests/mod.rs create mode 100644 tests/mod.rs diff --git a/Cargo.toml b/Cargo.toml index c52d161..8c5c1ba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "boxx" description = "Display informational boxes in the terminal." -version = "0.0.0-alpha" +version = "0.0.1-alpha" repository = "https://github.com/EverlastingBugstopper/boxx" authors = ["Avery Harnish "] categories = ["value-formatting"] @@ -30,3 +30,6 @@ path = "examples/hello_world.rs" console = "0.9" term_size = "0.3" unicode-width = "0.1" + +[dev-dependencies] +version-sync = "0.8" \ No newline at end of file diff --git a/README.md b/README.md index e0d3f83..a951cc7 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,8 @@ Display informational boxes in the terminal. Your `Cargo.toml` should include `boxx` as a dependency ```toml -boxx = "0.0.0-alpha" +[dependencies] +boxx = "0.0.1-alpha" ``` ```rust diff --git a/src/config/border/components.rs b/src/config/border/components.rs index c1c8dcf..8348ae2 100644 --- a/src/config/border/components.rs +++ b/src/config/border/components.rs @@ -4,12 +4,27 @@ use crate::BorderStyle; /// the border of a `Boxx` #[derive(Clone, PartialEq, Debug)] pub struct BorderComponents { - pub(crate) top_left: String, - pub(crate) horizontal: String, - pub(crate) top_right: String, - pub(crate) vertical: String, - pub(crate) bottom_right: String, - pub(crate) bottom_left: String, + /// `String` to display as the top left corner of a `Boxx` border + /// This should be one visual character wide + pub top_left: String, + + /// `String` to repeat as the top and bottom of a `Boxx` border + pub horizontal: String, + + /// `String` to display as the top right corner of a `Boxx` border + /// This should be one visual character wide + pub top_right: String, + + /// `String` to repeat as the left and right of a `Boxx` border + pub vertical: String, + + /// `String` to display as the bottom right corner of a `Boxx` border + /// This should be one visual character wide + pub bottom_right: String, + + /// `String` to display as the bottom left corner of a `Boxx` border + /// This should be one visual character wide + pub bottom_left: String, } impl BorderComponents { diff --git a/src/lib.rs b/src/lib.rs index b7972c1..faa4be8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,6 @@ #![deny(missing_docs)] #![deny(missing_debug_implementations)] +#![doc(html_root_url = "https://docs.rs/boxx/0.0.1-alpha")] //! boxx //! diff --git a/src/tests/mod.rs b/src/tests/mod.rs deleted file mode 100644 index 2720fe9..0000000 --- a/src/tests/mod.rs +++ /dev/null @@ -1,9 +0,0 @@ -#[cfg(test)] -use crate::{BorderStyle, Boxx}; - -#[test] -fn can_display() { - let x = Boxx::default().as_str("Hello, World"); - println!("{}", x); - assert!(true); -} diff --git a/tests/mod.rs b/tests/mod.rs new file mode 100644 index 0000000..288592d --- /dev/null +++ b/tests/mod.rs @@ -0,0 +1,9 @@ +#[test] +fn test_readme_deps() { + version_sync::assert_markdown_deps_updated!("README.md"); +} + +#[test] +fn test_html_root_url() { + version_sync::assert_html_root_url_updated!("src/lib.rs"); +}