pub struct RecordingAppleScript { /* private fields */ }Expand description
Test driver: records every script it’s asked to run without spawning
osascript. Tests assert on scripts() and seed push_response() to
control return values.
Implementations§
Source§impl RecordingAppleScript
impl RecordingAppleScript
pub fn new() -> Self
Sourcepub fn scripts(&self) -> Vec<String>
pub fn scripts(&self) -> Vec<String>
Returns every script that has been passed to run(), in call order.
Sourcepub fn push_response(&self, response: Result<String, ThingsError>)
pub fn push_response(&self, response: Result<String, ThingsError>)
Queue a response that the next call to run() will return. If no
response has been queued, run() returns Ok(String::new()).
Trait Implementations§
Source§impl AppleScriptDriver for RecordingAppleScript
impl AppleScriptDriver for RecordingAppleScript
Source§fn run<'life0, 'life1, 'async_trait>(
&'life0 self,
script: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<String, ThingsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn run<'life0, 'life1, 'async_trait>(
&'life0 self,
script: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<String, ThingsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Run the given AppleScript source. Returns stdout on success; returns
ThingsError::AppleScriptFailed { stderr, exit } on non-zero exit.Source§impl Debug for RecordingAppleScript
impl Debug for RecordingAppleScript
Source§impl Default for RecordingAppleScript
impl Default for RecordingAppleScript
Source§fn default() -> RecordingAppleScript
fn default() -> RecordingAppleScript
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for RecordingAppleScript
impl RefUnwindSafe for RecordingAppleScript
impl Send for RecordingAppleScript
impl Sync for RecordingAppleScript
impl Unpin for RecordingAppleScript
impl UnsafeUnpin for RecordingAppleScript
impl UnwindSafe for RecordingAppleScript
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