pub struct MockForgeLike { /* private fields */ }
Implementations§
Source§impl MockForgeLike
impl MockForgeLike
Sourcepub fn checkpoint(&mut self)
pub fn checkpoint(&mut self)
Validate that all current expectations for all methods have been satisfied, and discard them.
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new mock object with no expectations.
This method will not be generated if the real struct
already has a new
method. However, it will be
generated if the struct implements a trait with a new
method. The trait’s new
method can still be called
like <MockX as TraitY>::new
Source§impl MockForgeLike
impl MockForgeLike
Sourcepub fn expect_duplicate(&mut self) -> &mut Expectation
pub fn expect_duplicate(&mut self) -> &mut Expectation
Create an Expectation
for mocking the duplicate
method
Sourcepub fn expect_name(&mut self) -> &mut Expectation
pub fn expect_name(&mut self) -> &mut Expectation
Create an Expectation
for mocking the name
method
Create an Expectation
for mocking the is_message_authorised
method
Sourcepub fn expect_should_ignore_message(&mut self) -> &mut Expectation
pub fn expect_should_ignore_message(&mut self) -> &mut Expectation
Create an Expectation
for mocking the should_ignore_message
method
Sourcepub fn expect_parse_webhook_body(&mut self) -> &mut Expectation
pub fn expect_parse_webhook_body(&mut self) -> &mut Expectation
Create an Expectation
for mocking the parse_webhook_body
method
Sourcepub fn expect_commit_status(&mut self) -> &mut Expectation
pub fn expect_commit_status(&mut self) -> &mut Expectation
Create an Expectation
for mocking the commit_status
method
Sourcepub fn expect_list_webhooks(&mut self) -> &mut Expectation
pub fn expect_list_webhooks(&mut self) -> &mut Expectation
Create an Expectation
for mocking the list_webhooks
method
Sourcepub fn expect_unregister_webhook(&mut self) -> &mut Expectation
pub fn expect_unregister_webhook(&mut self) -> &mut Expectation
Create an Expectation
for mocking the unregister_webhook
method
Sourcepub fn expect_register_webhook(&mut self) -> &mut Expectation
pub fn expect_register_webhook(&mut self) -> &mut Expectation
Create an Expectation
for mocking the register_webhook
method
Trait Implementations§
Source§impl Debug for MockForgeLike
impl Debug for MockForgeLike
Source§impl Default for MockForgeLike
impl Default for MockForgeLike
Source§impl ForgeLike for MockForgeLike
impl ForgeLike for MockForgeLike
Checks that the message has a valid authorisation.
Source§fn should_ignore_message(&self, message: &ForgeNotification) -> bool
fn should_ignore_message(&self, message: &ForgeNotification) -> bool
Checks if the message should be ignored.
Default implementation says that no messages should be ignored.
Source§fn parse_webhook_body(&self, body: &Body) -> Result<Push>
fn parse_webhook_body(&self, body: &Body) -> Result<Push>
Parses the webhook body into Some(Push) struct if appropriate, or None if not.
§Errors
Will return an Err
if the body is not a message in the expected format.
Source§fn commit_status<'life0, 'life1, 'async_trait>(
&'life0 self,
commit: &'life1 Commit,
) -> Pin<Box<dyn Future<Output = Result<Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn commit_status<'life0, 'life1, 'async_trait>(
&'life0 self,
commit: &'life1 Commit,
) -> Pin<Box<dyn Future<Output = Result<Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Checks the results of any (e.g. CI) status checks for the commit.