pub struct IntegrationTest { /* private fields */ }Expand description
Implementations§
Source§impl IntegrationTest
impl IntegrationTest
Sourcepub async fn new() -> Self
pub async fn new() -> Self
Create new test with automatic log capture (spawns server).
Server logs are captured to tmp/test-logs/{test_name}_{timestamp}.log.
This is invaluable for debugging test failures.
§Panics
Panics if server fails to spawn.
Sourcepub async fn with_modules(modules: &[&str]) -> Self
pub async fn with_modules(modules: &[&str]) -> Self
Create new test with extra modules loaded.
Spawns a server with the default modules plus the specified extra modules. Use this for testing functionality that requires modules not in the defaults bundle (e.g., textobjects).
§Example
let result = IntegrationTest::with_modules(&["textobjects"])
.await
.with_buffer("hello world")
.send_keys("diw")
.run()
.await;
result.assert_buffer_eq(" world");§Panics
Panics if server fails to spawn.
Sourcepub async fn with_env(env_vars: &[(&str, &str)]) -> Self
pub async fn with_env(env_vars: &[(&str, &str)]) -> Self
Create new test with custom environment variables.
Passes additional env vars to the server process. Useful for
overriding XDG_DATA_HOME to provide test fixture data.
§Panics
Panics if server fails to spawn.
Sourcepub fn log_path(&self) -> Option<&Path>
pub fn log_path(&self) -> Option<&Path>
Get the path to the server log file for debugging.
Returns None if log capture is not enabled.
Sourcepub fn with_buffer(self, content: &str) -> Self
pub fn with_buffer(self, content: &str) -> Self
Set initial buffer content.
Sourcepub fn with_cursor_at(self, line: u16, col: u16) -> Self
pub fn with_cursor_at(self, line: u16, col: u16) -> Self
Set initial cursor position (line, col) - 0-indexed.
Sourcepub fn with_delay(self, ms: u64) -> Self
pub fn with_delay(self, ms: u64) -> Self
Add delay after last key sequence.
Sourcepub async fn run(self) -> TestResult
pub async fn run(self) -> TestResult
Auto Trait Implementations§
impl Freeze for IntegrationTest
impl !RefUnwindSafe for IntegrationTest
impl Send for IntegrationTest
impl Sync for IntegrationTest
impl Unpin for IntegrationTest
impl UnsafeUnpin for IntegrationTest
impl !UnwindSafe for IntegrationTest
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request