Skip to content

Commit 3f55497

Browse files
authored
Merge pull request #73 from yoshuawuyts/new-test
Test for default status code code cast
2 parents a4d49f5 + 7bf40c3 commit 3f55497

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/error.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ fn can_be_boxed() {
1010
assert!(can_be_boxed().is_err());
1111
}
1212

13+
#[test]
14+
fn internal_server_error_by_default() {
15+
fn run() -> http_types::Result<()> {
16+
Err(io::Error::new(io::ErrorKind::Other, "Oh no"))?;
17+
Ok(())
18+
}
19+
let err = run().unwrap_err();
20+
assert_eq!(err.status(), 500);
21+
}
22+
1323
#[test]
1424
fn ensure() {
1525
fn inner() -> http_types::Result<()> {

0 commit comments

Comments
 (0)