0.0.2 |
|
---|---|
0.0.1 |
|
#5 in #rspec
6KB
88 lines
Yotsuba
An RSpec-style test framework for Rust.
Getting started
Yotsuba is a collection of macros and matchers that allow for quicker testing and more readable tests.
#[macro_use] extern crate yotsuba;
fn your_cool_function(num: u64) -> u64 { return num * num }
describe!(your_cool_function, {
it!(does_what_you_think_it_does, {
let cool_result = your_cool_function(5);
expect!(cool_result; to equal 25)
});
it!(does_not_do_what_it_should_not, {
let cool_result = your_cool_function(10);
expect!(cool_result; to not_equal 7)
});
});