Hamcrest
Installing
To use Hamcrest, add this to your Cargo.toml
:
[dev-dependencies.hamcrest]
git = "https://github.com/carllerche/hamcrest-rust.git"
And this to your crate root:
extern crate hamcrest;
After a quick cargo build
, you should be good to go!
Usage
Hamcrest supports a number of matchers. You'll have to use
them just like any other Rust library. Alternatively you can also use
all of them at once like this:
use *;
equal_to
assert_that;
close_to
assert_that;
assert_that;
existing_{file,path,dir}
assert_that;
assert_that;
assert_that;
none
assert_that;
assert_that;
contains and contains_exactly
assert_that;
assert_that;
assert_that;
assert_that;
matches_regex
assert_that;
assert_that;
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.