summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-03-07 11:51:17 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-03-07 11:51:17 -0800
commit80b4350918a236711ed193c06998ddc1af523e17 (patch)
treea30065aece8a6f679c79d430f2465a30e0d97769 /tests
parentc3cdbc762c1b35bd260044870e655e06c75e738c (diff)
downloadssh2-rs-80b4350918a236711ed193c06998ddc1af523e17.zip
Update to rust master
Diffstat (limited to 'tests')
-rw-r--r--tests/all.rs3
-rw-r--r--tests/session.rs3
-rw-r--r--tests/sftp.rs6
3 files changed, 8 insertions, 4 deletions
diff --git a/tests/all.rs b/tests/all.rs
index 3da9813..ed900f0 100644
--- a/tests/all.rs
+++ b/tests/all.rs
@@ -1,8 +1,9 @@
#![deny(warnings)]
-#![feature(io, core, path, net, fs, tempdir)]
+#![feature(io, core, path, net)]
extern crate ssh2;
extern crate libc;
+extern crate tempdir;
use std::env;
use std::net::TcpStream;
diff --git a/tests/session.rs b/tests/session.rs
index fbfadfc..36f8c7c 100644
--- a/tests/session.rs
+++ b/tests/session.rs
@@ -1,7 +1,8 @@
use std::env;
-use std::fs::{File, TempDir};
+use std::fs::File;
use std::io::prelude::*;
use std::path::{Path, PathBuf};
+use tempdir::TempDir;
use ssh2::{Session, MethodType, HashType};
diff --git a/tests/sftp.rs b/tests/sftp.rs
index 774ba86..b28e549 100644
--- a/tests/sftp.rs
+++ b/tests/sftp.rs
@@ -1,5 +1,6 @@
use std::io::prelude::*;
-use std::fs::{self, File, TempDir};
+use std::fs::{self, File};
+use tempdir::TempDir;
#[test]
fn smoke() {
@@ -18,7 +19,8 @@ fn ops() {
sftp.opendir(&td.path().join("bar")).unwrap();
let mut foo = sftp.open(&td.path().join("foo")).unwrap();
sftp.mkdir(&td.path().join("bar2"), 0o755).unwrap();
- assert!(td.path().join("bar2").is_dir());
+ assert_eq!(fs::metadata(&td.path().join("bar2")).map(|m| m.is_dir()),
+ Ok(true));
sftp.rmdir(&td.path().join("bar2")).unwrap();
sftp.create(&td.path().join("foo5")).unwrap().write_all(b"foo").unwrap();