Replace std::env::temp_dir with tempdir in tests (#8103)
* std::env::temp_dir -> tempdir in test context * fix lifetime issue so tempdir removes tmpfiles
This commit is contained in:
committed by
Marek Kotewicz
parent
7e948a088f
commit
23fc5517b5
@@ -204,11 +204,13 @@ mod tests {
|
||||
use header::Header;
|
||||
use spec::Spec;
|
||||
use engines::Seal;
|
||||
use tempdir::TempDir;
|
||||
|
||||
/// Create a new test chain spec with `BasicAuthority` consensus engine.
|
||||
fn new_test_authority() -> Spec {
|
||||
let bytes: &[u8] = include_bytes!("../../res/basic_authority.json");
|
||||
Spec::load(&::std::env::temp_dir(), bytes).expect("invalid chain spec")
|
||||
let tempdir = TempDir::new("").unwrap();
|
||||
Spec::load(&tempdir.path(), bytes).expect("invalid chain spec")
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user