Uncommenting simple Miner tests (#1571)
This commit is contained in:
committed by
Arkadiy Paronyan
parent
5fe14e172e
commit
b304ce5838
@@ -19,9 +19,9 @@
|
||||
|
||||
extern crate rand;
|
||||
|
||||
pub mod random_path;
|
||||
pub mod test_socket;
|
||||
pub mod stop_guard;
|
||||
mod random_path;
|
||||
mod test_socket;
|
||||
mod stop_guard;
|
||||
|
||||
pub use random_path::*;
|
||||
pub use test_socket::*;
|
||||
|
||||
@@ -74,6 +74,25 @@ impl Drop for RandomTempPath {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct GuardedTempResult<T> {
|
||||
pub result: Option<T>,
|
||||
pub _temp: RandomTempPath
|
||||
}
|
||||
|
||||
impl<T> GuardedTempResult<T> {
|
||||
pub fn reference(&self) -> &T {
|
||||
self.result.as_ref().unwrap()
|
||||
}
|
||||
|
||||
pub fn reference_mut(&mut self) -> &mut T {
|
||||
self.result.as_mut().unwrap()
|
||||
}
|
||||
|
||||
pub fn take(&mut self) -> T {
|
||||
self.result.take().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn creates_dir() {
|
||||
let temp = RandomTempPath::create_dir();
|
||||
|
||||
Reference in New Issue
Block a user