pub struct ItBuilder { /* private fields */ }Expand description
Builder returned by Context::it. Supports chaining decorators and
registers the test node when dropped.
// Simple (drops immediately, registered at semicolon):
ctx.it("simple", || { assert!(true); });
// With decorators:
ctx.it("complex", || { /* ... */ })
.labels(&["integration"])
.retries(3)
.timeout(5000);Implementations§
Source§impl ItBuilder
impl ItBuilder
Sourcepub fn labels(self, labels: &[&str]) -> Self
pub fn labels(self, labels: &[&str]) -> Self
Add labels for filtering via RSSPEC_LABEL_FILTER. Labels accumulate
across multiple calls.
Sourcepub fn timeout(self, ms: u64) -> Self
pub fn timeout(self, ms: u64) -> Self
Fail the test if it exceeds ms milliseconds.
Note: The timeout is checked after the closure returns — the closure cannot be forcibly aborted mid-execution. If your test blocks forever (e.g. an infinite loop or deadlock), the timeout will not fire.
Sourcepub fn must_pass_repeatedly(self, n: u32) -> Self
pub fn must_pass_repeatedly(self, n: u32) -> Self
Require the test to pass n consecutive times.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ItBuilder
impl !RefUnwindSafe for ItBuilder
impl !Send for ItBuilder
impl !Sync for ItBuilder
impl Unpin for ItBuilder
impl UnsafeUnpin for ItBuilder
impl !UnwindSafe for ItBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more