Trait Testable

Source
pub trait Testable {
Show 26 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 ok(&mut self, f: bool) -> &mut Self; fn ko(&mut self, f: bool) -> &mut Self; fn assert(&mut self, test: bool) -> bool; fn eq<T: PartialEq>(&mut self, a: T, b: T) -> &mut Self; fn ne<T: PartialEq>(&mut self, a: T, b: T) -> &mut Self; fn gt<T: PartialOrd>(&mut self, a: T, min: T) -> &mut Self; fn ge<T: PartialOrd>(&mut self, a: T, min: T) -> &mut Self; fn lt<T: PartialOrd>(&mut self, a: T, max: T) -> &mut Self; fn le<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 exe(&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 str_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 start_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; fn it( title: &str, description: &str, sleep_time: u64, callbacks: Vec<&dyn Fn(&mut Self) -> &mut Self>, );
}
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 the x index equals a value listing in values
  • pattern The pattern to match
  • x The index to match
  • values The values
Source

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

§Assert if callback return true
  • f The callback
Source

fn ko(&mut self, f: 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 eq<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 ne<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 gt<T: PartialOrd>(&mut self, a: T, min: T) -> &mut Self

§Check if a is superior to min
  • a The first value
  • min The minimum value
Source

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

§Check if a is superior or equal to min
  • a The first value
  • min The minimum value
Source

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

§Check if a is inferior to max
  • a The first value
  • max The maximum value
Source

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

Source

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

§Check if a is 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 exe(&mut self, p: &str) -> &mut Self

§Check if p is a program
  • p The program path
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 an 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 str_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 path exists
  • p The path to test
Source

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

§Check if a path not exists
  • p The path to check the no existence
Source

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

§Check if a string begins 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
Source

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§