Struct SuiteContext

Source
pub struct SuiteContext<T> {
Show 14 fields pub state: Rc<RefCell<HashMap<&'static str, T>>>, pub after_all_hook: Option<Rc<dyn Fn(&mut HashMap<&'static str, T>) + 'static>>, pub after_each_hook: Option<Rc<dyn Fn(&mut HashMap<&'static str, T>) + 'static>>, pub before_all_hook: Option<Rc<dyn Fn(&mut HashMap<&'static str, T>) + 'static>>, pub before_each_hook: Option<Rc<dyn Fn(&mut HashMap<&'static str, T>) + 'static>>, pub specs: Vec<Spec<T>>, pub suites: Vec<Suite<T>>, pub retries_: Option<u32>, pub skip_: bool, pub slow_: Option<u128>, pub passed: u32, pub failed: u32, pub ignored: u32, pub fail: bool,
}

Fields§

§state: Rc<RefCell<HashMap<&'static str, T>>>§after_all_hook: Option<Rc<dyn Fn(&mut HashMap<&'static str, T>) + 'static>>§after_each_hook: Option<Rc<dyn Fn(&mut HashMap<&'static str, T>) + 'static>>§before_all_hook: Option<Rc<dyn Fn(&mut HashMap<&'static str, T>) + 'static>>§before_each_hook: Option<Rc<dyn Fn(&mut HashMap<&'static str, T>) + 'static>>§specs: Vec<Spec<T>>§suites: Vec<Suite<T>>§retries_: Option<u32>§skip_: bool§slow_: Option<u128>§passed: u32§failed: u32§ignored: u32§fail: bool

Implementations§

Source§

impl<T> SuiteContext<T>

Source

pub fn new() -> SuiteContext<T>

Source

pub fn before_all<H: Fn(&mut HashMap<&'static str, T>) + 'static>( &mut self, hook: H, ) -> &mut Self

Source

pub fn before_each<H: Fn(&mut HashMap<&'static str, T>) + 'static>( &mut self, hook: H, ) -> &mut Self

Source

pub fn after_all<H: Fn(&mut HashMap<&'static str, T>) + 'static>( &mut self, hook: H, ) -> &mut Self

Source

pub fn after_each<H: Fn(&mut HashMap<&'static str, T>) + 'static>( &mut self, hook: H, ) -> &mut Self

Source

pub fn it<S, H>(&mut self, name: S, hook: H) -> &mut Self
where S: Into<String> + Display, H: Fn(&mut SpecContext<T>) -> Result<(), String> + 'static,

Source

pub fn it_skip<S, H>(&mut self, name: S, hook: H) -> &mut Self
where S: Into<String> + Display, H: Fn(&mut SpecContext<T>) -> Result<(), String> + 'static,

Source

pub fn it_only<S, H>(&mut self, name: S, hook: H) -> &mut Self
where S: Into<String> + Display, H: Fn(&mut SpecContext<T>) -> Result<(), String> + 'static,

Source

pub fn spec<H>(&mut self, cb: H) -> &mut Self
where H: Fn(&mut SpecOptions<T>),

Source

pub fn describe<S, H>(&mut self, name: S, cb: H) -> &mut Self
where S: Into<String> + Display, H: Fn(&mut SuiteContext<T>) + 'static,

Source

pub fn describe_skip<S, H>(&mut self, name: S, cb: H) -> &mut Self
where S: Into<String> + Display, H: Fn(&mut SuiteContext<T>) + 'static,

Source

pub fn describe_only<S, H>(&mut self, name: S, cb: H) -> &mut Self
where S: Into<String> + Display, H: Fn(&mut SuiteContext<T>) + 'static,

Source

pub fn describe_import(&mut self, suite: Suite<T>) -> &mut Self

Source

pub fn describe_import_skip(&mut self, suite: Suite<T>) -> &mut Self

Source

pub fn describe_import_only(&mut self, suite: Suite<T>) -> &mut Self

Source

pub fn skip(&mut self) -> &mut Self

Source

pub fn retries(&mut self, count: u32) -> &mut Self

Source

pub fn slow(&mut self, count: u128) -> &mut Self

Auto Trait Implementations§

§

impl<T> Freeze for SuiteContext<T>

§

impl<T> !RefUnwindSafe for SuiteContext<T>

§

impl<T> !Send for SuiteContext<T>

§

impl<T> !Sync for SuiteContext<T>

§

impl<T> Unpin for SuiteContext<T>

§

impl<T> !UnwindSafe for SuiteContext<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.