Skip to content

Commit

Permalink
Add async fixture test
Browse files Browse the repository at this point in the history
  • Loading branch information
rubdos committed Apr 9, 2020
1 parent 19ff758 commit 23a1b71
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
11 changes: 11 additions & 0 deletions resources/fixture/async_fixture.rs
@@ -0,0 +1,11 @@
use rstest::*;

#[fixture]
async fn async_u32() -> u32 {
42
}

#[rstest]
fn use_async_fixture(async_u32: u32) {
assert_eq!(42, async_u32);
}
7 changes: 7 additions & 0 deletions tests/fixture/mod.rs
Expand Up @@ -81,6 +81,13 @@ mod should {
.ok("test_dyn_ref_resolve")
.assert(output);
}

#[test]
fn async_fixture() {
let (output, _) = run_test("async_fixture.rs");

TestResults::new().ok("use_async_fixture").assert(output);
}
}

#[test]
Expand Down

0 comments on commit 23a1b71

Please sign in to comment.