Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions ohkami/src/testing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@ use std::collections::HashMap;
use std::sync::Arc;
use std::{pin::Pin, future::Future, format as f};

pub trait Testing {
fn test(self) -> TestingOhkami;
pub trait Tester {
fn test(self) -> TestOhkami;
}

pub struct TestingOhkami(Arc<Router>);

impl Testing for Ohkami {
fn test(self) -> TestingOhkami {
impl Tester for Ohkami {
fn test(self) -> TestOhkami {
let (f, _) = self.into_router().finalize();
TestingOhkami(Arc::new(f))
TestOhkami(Arc::new(f))
}
}

impl TestingOhkami {
pub struct TestOhkami(Arc<Router>);

impl TestOhkami {
#[must_use]
pub fn oneshot(&self, test_req: TestRequest) -> Oneshot {
let router = self.0.clone();
Expand Down