Crate galvanic_assert [] [src]

Galvanic-assert: Matcher-based assertions for easier testing

This crate provides a new assertion macro assert_that! based on matching predicates (matchers) to

  • make writing asserts easier
  • make reading asserts comprehendable
  • easily extend the assertion framework
  • provide a large list common matchers
  • integrate with galvanic-test and galvanic-mock (both still in development ... stay tuned!)
  • be used with your favourite test framework

The crate will be part of galvanic---a complete test framework for Rust.

galvanic-assert currently requires nightly until impl trait returns have been stabilized.

Modules

matchers

Macros

all_of

Takes a list of matchers for the same type combines them conjunctively.

any_of

Takes a list of matchers for the same type combines them disjunctively.

assert_that

States that the asserted values satisfies the required properties of the supplied Matcher.

is_variant

Matches if the asserted value's variant matches the expected variant.

Structs

MatchResultBuilder

A builder for creating MatchResults.

Enums

MatchResult

The return type of any Machter

Traits

Matcher

The trait which has to be implemented by all matchers.