pub struct Script { /* private fields */ }fake only.Expand description
A strict script for FakeProcesses: every call the code makes must match one of its
expectations, and every expectation must be met. A call no expectation matches panics (and is
reported again when the fake is dropped, for a call made on a task whose panic was swallowed),
an expectation not met panics when the fake is dropped, and when two expectations match a
call the one naming more arguments answers it (two naming as many panic): the order the script
is written in never matters.
Implementations§
Source§impl Script
impl Script
Sourcepub fn expect(self, call: &str, reply: Reply) -> Script
Available on crate features fake only.
pub fn expect(self, call: &str, reply: Reply) -> Script
fake only.call (program arg…, the leading arguments of the call; * is any one argument) is made
at least once and answered reply.
Sourcepub fn expect_times(self, call: &str, times: usize, reply: Reply) -> Script
Available on crate features fake only.
pub fn expect_times(self, call: &str, times: usize, reply: Reply) -> Script
fake only.call is made exactly times times, each answered reply.
Sourcepub fn allow(self, call: &str, reply: Reply) -> Script
Available on crate features fake only.
pub fn allow(self, call: &str, reply: Reply) -> Script
fake only.call may be made, any number of times, each answered reply.
Sourcepub fn build(self) -> FakeProcesses
Available on crate features fake only.
pub fn build(self) -> FakeProcesses
fake only.The fake processes that answer from this script.