2 releases
Uses old Rust 2015
0.1.1 | Aug 7, 2018 |
---|---|
0.1.0 | Aug 7, 2018 |
#303 in Testing
45,146 downloads per month
Used in 21 crates
(20 directly)
7KB
testing_logger
A Rust library to support testing of code that uses log
crate.
Example
#[macro_use]
extern crate log;
use log::Level;
extern crate testing_logger;
#[test]
fn test_something() {
testing_logger::setup();
warn!("Something went wrong with {}", 10);
testing_logger::validate( |captured_logs| {
assert_eq!(captured_logs.len(), 1);
assert_eq!(captured_logs[0].body, "Something went wrong with 10");
assert_eq!(captured_logs[0].level, Level::Warn);
});
}
Dependencies
~87KB