Compare commits
3 commits
db7d803f25
...
6e1587a159
Author | SHA1 | Date | |
---|---|---|---|
6e1587a159 | |||
8e1af0410c | |||
1443e6dfce |
2 changed files with 5 additions and 7 deletions
|
@ -1,15 +1,16 @@
|
||||||
//! Provides a generic interface for network operations.
|
//! Provides a generic interface for network operations.
|
||||||
//!
|
//!
|
||||||
//!
|
//!
|
||||||
|
|
||||||
mod result;
|
|
||||||
mod system;
|
mod system;
|
||||||
|
mod result;
|
||||||
|
|
||||||
pub use result::{Error, Result};
|
pub use result::{Error, Result};
|
||||||
|
|
||||||
pub use system::{MatchOn, Net};
|
pub use system::{MatchOn, Net};
|
||||||
use system::{Mocked, Unmocked};
|
use system::{Mocked, Unmocked};
|
||||||
|
|
||||||
|
|
||||||
/// Creates a new `Net`.
|
/// Creates a new `Net`.
|
||||||
pub const fn new() -> Net<Unmocked> {
|
pub const fn new() -> Net<Unmocked> {
|
||||||
Net::<Unmocked>::new()
|
Net::<Unmocked>::new()
|
||||||
|
|
|
@ -43,10 +43,7 @@ async fn test_get_wrong_url() {
|
||||||
net.on(request).respond(my_response.into());
|
net.on(request).respond(my_response.into());
|
||||||
|
|
||||||
//when
|
//when
|
||||||
let_assert!(
|
let_assert!(Err(Error::UnexpectedMockRequest(invalid_request)) = net.send(client.get("https://some.other.url/")).await);
|
||||||
Err(Error::UnexpectedMockRequest(invalid_request)) =
|
|
||||||
net.send(client.get("https://some.other.url/")).await
|
|
||||||
);
|
|
||||||
|
|
||||||
//then
|
//then
|
||||||
assert_eq!(invalid_request.url().to_string(), "https://some.other.url/");
|
assert_eq!(invalid_request.url().to_string(), "https://some.other.url/");
|
||||||
|
|
Loading…
Reference in a new issue