Macro version_sync::assert_markdown_deps_updated [] [src]

macro_rules! assert_markdown_deps_updated {
    ($path:expr) => { ... };
}

Assert that dependencies on the current package are up to date.

The macro will call check_markdown_deps on the file name given in order to check that the TOML examples found all depend on a current version of your package. The package name is automatically taken from the $CARGO_PKG_NAME environment variable and the version is taken from $CARGO_PKG_VERSION. These environment variables are automatically set by Cargo when compiling your crate.

Usage

The typical way to use this macro is from an integration test:

#[macro_use]
extern crate version_sync;

#[test]
fn test_readme_deps() {
    assert_markdown_deps_updated!("README.md");
}

Tests are run with the current directory set to directory where your Cargo.toml file is, so this will find a README.md file next to your Cargo.toml file.

Panics

If any TOML code block fails the check, panic! will be invoked.