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§
Sourcefn matches(&mut self, pattern: &str, values: Vec<String>) -> &mut Self
fn matches(&mut self, pattern: &str, values: Vec<String>) -> &mut Self
§Check if a pattern matches values
pattern
The pattern to matchvalues
The values to check
Sourcefn capture(
&mut self,
pattern: &str,
x: &str,
key: usize,
values: Vec<String>,
) -> &mut Self
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 matchx
The index to matchvalues
The values
Sourcefn eq<T: PartialEq>(&mut self, a: T, b: T) -> &mut Self
fn eq<T: PartialEq>(&mut self, a: T, b: T) -> &mut Self
§Check if a and b are equals
a
The first valueb
The second value
Sourcefn ne<T: PartialEq>(&mut self, a: T, b: T) -> &mut Self
fn ne<T: PartialEq>(&mut self, a: T, b: T) -> &mut Self
§Check if a and b are unequals
a
The first valueb
The second value
Sourcefn gt<T: PartialOrd>(&mut self, a: T, min: T) -> &mut Self
fn gt<T: PartialOrd>(&mut self, a: T, min: T) -> &mut Self
§Check if a is superior to min
a
The first valuemin
The minimum value
Sourcefn ge<T: PartialOrd>(&mut self, a: T, min: T) -> &mut Self
fn ge<T: PartialOrd>(&mut self, a: T, min: T) -> &mut Self
§Check if a is superior or equal to min
a
The first valuemin
The minimum value
Sourcefn lt<T: PartialOrd>(&mut self, a: T, max: T) -> &mut Self
fn lt<T: PartialOrd>(&mut self, a: T, max: T) -> &mut Self
§Check if a is inferior to max
a
The first valuemax
The maximum value
fn le<T: PartialOrd>(&mut self, a: T, max: T) -> &mut Self
Sourcefn between<T: PartialOrd>(&mut self, a: T, min: T, max: T) -> &mut Self
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 valuemin
The minimum valuemax
The maximum value
Sourcefn vec_contains<T: PartialEq>(&mut self, a: Vec<T>, b: T) -> &mut Self
fn vec_contains<T: PartialEq>(&mut self, a: Vec<T>, b: T) -> &mut Self
§Check if a vector contains a value
a
The vectorb
The value to check
Sourcefn vec_no_contains<T: PartialEq>(&mut self, a: Vec<T>, b: T) -> &mut Self
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 vectorb
The value to check
Sourcefn option_contains<T: PartialEq>(&mut self, a: Option<T>, b: T) -> &mut Self
fn option_contains<T: PartialEq>(&mut self, a: Option<T>, b: T) -> &mut Self
§Check if an option contains a value
a
The vectorb
The value to check
Sourcefn hash_contains(&mut self, a: &mut HashSet<String>, b: String) -> &mut Self
fn hash_contains(&mut self, a: &mut HashSet<String>, b: String) -> &mut Self
§Check if a hash contains a string
a
The hashb
The value to find
Sourcefn str_contains(&mut self, a: &str, b: &str) -> &mut Self
fn str_contains(&mut self, a: &str, b: &str) -> &mut Self
§Check if a sting contains a substring
a
The stringb
The substring
Sourcefn file_contains(&mut self, f: &str, v: &str) -> &mut Self
fn file_contains(&mut self, f: &str, v: &str) -> &mut Self
§Check if a file contains a value
f
The filev
The value to check
Sourcefn not_exists(&mut self, p: &str) -> &mut Self
fn not_exists(&mut self, p: &str) -> &mut Self
§Check if a path not exists
p
The path to check the no existence
Sourcefn start_with(&mut self, actual: &str, expected: &str) -> &mut Self
fn start_with(&mut self, actual: &str, expected: &str) -> &mut Self
§Check if a string begins with the expected value
actual
The actual valueexpected
The expected value
Sourcefn end_with(&mut self, actual: &str, expected: &str) -> &mut Self
fn end_with(&mut self, actual: &str, expected: &str) -> &mut Self
§Check if a string finnish with the expected value
actual
The actual valueexpected
The expected value
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.