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:
Niklas Adolfsson
2018-03-14 12:26:20 +01:00
committed by Marek Kotewicz
parent 7e948a088f
commit 23fc5517b5
15 changed files with 65 additions and 21 deletions

View File

@@ -59,9 +59,11 @@ mod difficulty_test_byzantium {
mod difficulty_test_foundation {
use super::json_difficulty_test;
use tempdir::TempDir;
fn do_json_test(json_data: &[u8]) -> Vec<String> {
json_difficulty_test(json_data, ::ethereum::new_foundation(&::std::env::temp_dir()))
let tempdir = TempDir::new("").unwrap();
json_difficulty_test(json_data, ::ethereum::new_foundation(&tempdir.path()))
}
declare_test!{DifficultyTests_difficultyMainNetwork, "BasicTests/difficultyMainNetwork.json"}