Skip to main content

MockScenarioBuilder

Struct MockScenarioBuilder 

Source
pub struct MockScenarioBuilder { /* private fields */ }
Expand description

Builder for creating mock GitHub scenarios

Implementations§

Source§

impl MockScenarioBuilder

Source

pub fn new() -> Self

Source

pub fn gh_available(self) -> Self

gh CLI is available and authenticated

Source

pub fn gh_not_available(self) -> Self

gh CLI is not available

Source

pub fn gh_not_authenticated(self) -> Self

gh CLI is available but not authenticated

Source

pub fn with_pr(self, branch: &str, json: &str) -> Self

Configure a PR response for a branch

Source

pub fn with_no_pr(self, branch: &str) -> Self

Configure no PR found for a branch

Source

pub fn with_auth_error(self, branch: &str) -> Self

Configure PR view to fail with auth error

Source

pub fn with_merge_commit(self, sha: &str, parent_count: usize) -> Self

Configure git cat-file response for merge method detection

Source

pub fn with_remote_delete_success(self, branch: &str) -> Self

Configure successful remote branch deletion

Source

pub fn with_remote_already_deleted(self, branch: &str) -> Self

Configure remote branch already deleted

Source

pub fn with_remote_delete_failure(self, branch: &str, error: &str) -> Self

Configure remote branch deletion failure

Source

pub fn build(self) -> MockCommandExecutor

Build the mock executor

Trait Implementations§

Source§

impl Default for MockScenarioBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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.