pub trait Testable {
Show 25 methods // Required methods fn new(sleep_time: u64) -> Self; fn matches(&mut self, pattern: &str, values: Vec<String>) -> &mut Self; fn capture( &mut self, pattern: &str, x: &str, key: usize, values: Vec<String> ) -> &mut Self; fn it( describe: &str, sleep_time: u64, callbacks: Vec<&dyn Fn(&mut Self) -> &mut Self> ); fn ok(&mut self, f: &dyn Fn() -> bool) -> &mut Self; fn ko(&mut self, f: &dyn Fn() -> bool) -> &mut Self; fn assert(&mut self, test: bool) -> bool; fn equals<T: PartialEq>(&mut self, a: T, b: T) -> &mut Self; fn unequals<T: PartialEq>(&mut self, a: T, b: T) -> &mut Self; fn superior<T: PartialOrd>(&mut self, a: T, min: T) -> &mut Self; fn inferior<T: PartialOrd>(&mut self, a: T, max: T) -> &mut Self; fn between<T: PartialOrd>(&mut self, a: T, min: T, max: T) -> &mut Self; fn vec_contains<T: PartialEq>(&mut self, a: Vec<T>, b: T) -> &mut Self; fn program(&mut self, p: &str) -> &mut Self; fn not_program(&mut self, p: &str) -> &mut Self; fn vec_no_contains<T: PartialEq>(&mut self, a: Vec<T>, b: T) -> &mut Self; fn option_contains<T: PartialEq>(&mut self, a: Option<T>, b: T) -> &mut Self; fn hash_contains(&mut self, a: &mut HashSet<String>, b: String) -> &mut Self; fn string_contains(&mut self, a: &str, b: &str) -> &mut Self; fn file_contains(&mut self, f: &str, v: &str) -> &mut Self; fn exists(&mut self, p: &str) -> &mut Self; fn not_exists(&mut self, p: &str) -> &mut Self; fn begin_with(&mut self, actual: &str, expected: &str) -> &mut Self; fn end_with(&mut self, actual: &str, expected: &str) -> &mut Self; fn end(&mut self) -> bool;
}
Expand description

§The method to implements for a new struct

Required Methods§

source

fn new(sleep_time: u64) -> Self

  • sleep_time The sleep time
source

fn matches(&mut self, pattern: &str, values: Vec<String>) -> &mut Self

§Check if a pattern matches values
  • pattern The pattern to match
  • values The values to check
source

fn capture( &mut self, pattern: &str, x: &str, key: usize, values: Vec<String> ) -> &mut Self

§check if a pattern a the x index equal a value listing in values
  • pattern The pattern to match
  • x The index to match
  • values The values
source

fn it( describe: &str, sleep_time: u64, callbacks: Vec<&dyn Fn(&mut Self) -> &mut Self> )

§Constructor
  • callbacks The vec list of callback
  • describe The description
source

fn ok(&mut self, f: &dyn Fn() -> bool) -> &mut Self

§Assert if callback return true
  • f The callback
source

fn ko(&mut self, f: &dyn Fn() -> bool) -> &mut Self

§Assert if callback return false
  • f The callback
source

fn assert(&mut self, test: bool) -> bool

§Check if test pass
  • test The test assertion
source

fn equals<T: PartialEq>(&mut self, a: T, b: T) -> &mut Self

§Check if a and b are equals
  • a The first value
  • b The second value
source

fn unequals<T: PartialEq>(&mut self, a: T, b: T) -> &mut Self

§Check if a and b are unequals
  • a The first value
  • b The second value
source

fn superior<T: PartialOrd>(&mut self, a: T, min: T) -> &mut Self

§Check if a are superior to min
  • a The first value
  • min The minimum value
source

fn inferior<T: PartialOrd>(&mut self, a: T, max: T) -> &mut Self

§Check if a are inferior to max
  • a The first value
  • max The maximum value
source

fn between<T: PartialOrd>(&mut self, a: T, min: T, max: T) -> &mut Self

§Check if a are between min and max
  • a The first value
  • min The minimum value
  • max The maximum value
source

fn vec_contains<T: PartialEq>(&mut self, a: Vec<T>, b: T) -> &mut Self

§Check if a vector contains a value
  • a The vector
  • b The value to check
source

fn program(&mut self, p: &str) -> &mut Self

§Check if p is a program
  • p The program path
source

fn not_program(&mut self, p: &str) -> &mut Self

§Check if p is not a program
  • p The program to test
source

fn vec_no_contains<T: PartialEq>(&mut self, a: Vec<T>, b: T) -> &mut Self

§Check if a vector not contains a value
  • a The vector
  • b The value to check
source

fn option_contains<T: PartialEq>(&mut self, a: Option<T>, b: T) -> &mut Self

§Check if a option contains a value
  • a The vector
  • b The value to check
source

fn hash_contains(&mut self, a: &mut HashSet<String>, b: String) -> &mut Self

§Check if a hash contains a string
  • a The hash
  • b The value to find
source

fn string_contains(&mut self, a: &str, b: &str) -> &mut Self

§Check if a sting contains a substring
  • a The string
  • b The substring
source

fn file_contains(&mut self, f: &str, v: &str) -> &mut Self

§Check if a file contains a value
  • f The file
  • v The value to check
source

fn exists(&mut self, p: &str) -> &mut Self

§Check if a paths exists
  • p The path to test
source

fn not_exists(&mut self, p: &str) -> &mut Self

§Check if a path not exist
  • p The path to check the no existence
source

fn begin_with(&mut self, actual: &str, expected: &str) -> &mut Self

§Check if a string begin with the expected value
  • actual The actual value
  • expected The expected value
source

fn end_with(&mut self, actual: &str, expected: &str) -> &mut Self

§Check if a string finnish with the expected value
  • actual The actual value
  • expected The expected value
source

fn end(&mut self) -> bool

§Show assertions

Object Safety§

This trait is not object safe.

Implementors§