summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-02-05 08:23:31 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-02-05 08:23:31 -0800
commitf13d77a3d240719c7a84faaea52e47ad3b49f561 (patch)
treebfc85af8b28bd5d5767763f7deb68c57849b6955 /tests
parente42ed21fe9174291189ab4488207c90578a0afed (diff)
downloadssh2-rs-f13d77a3d240719c7a84faaea52e47ad3b49f561.zip
Update to rust master
Diffstat (limited to 'tests')
-rw-r--r--tests/all.rs6
-rw-r--r--tests/session.rs6
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/all.rs b/tests/all.rs
index 66de542..46c1110 100644
--- a/tests/all.rs
+++ b/tests/all.rs
@@ -1,10 +1,10 @@
#![deny(warnings)]
-#![feature(io, core, path, os, std_misc, libc)]
+#![feature(io, core, path, std_misc, libc, env)]
extern crate ssh2;
extern crate libc;
-use std::os;
+use std::env;
use std::old_io::TcpStream;
mod agent;
@@ -18,7 +18,7 @@ pub fn socket() -> TcpStream {
}
pub fn authed_session() -> (TcpStream, ssh2::Session) {
- let user = os::getenv("USER").unwrap();
+ let user = env::var_string("USER").unwrap();
let socket = socket();
let mut sess = ssh2::Session::new().unwrap();
sess.handshake(&socket).unwrap();
diff --git a/tests/session.rs b/tests/session.rs
index 5814e55..480f761 100644
--- a/tests/session.rs
+++ b/tests/session.rs
@@ -1,4 +1,4 @@
-use std::os;
+use std::env;
use std::old_io::{self, File, TempDir};
use ssh2::{Session, MethodType, HashType};
@@ -23,7 +23,7 @@ fn smoke() {
#[test]
fn smoke_handshake() {
- let user = os::getenv("USER").unwrap();
+ let user = env::var_string("USER").unwrap();
let socket = ::socket();
let mut sess = Session::new().unwrap();
sess.handshake(&socket).unwrap();
@@ -55,7 +55,7 @@ fn scp_recv() {
let (_tcp, sess) = ::authed_session();
let (mut ch, _) = sess.scp_recv(&Path::new(".ssh/authorized_keys")).unwrap();
let data = ch.read_to_string().unwrap();
- let p = Path::new(os::getenv("HOME").unwrap()).join(".ssh/authorized_keys");
+ let p = Path::new(env::var_string("HOME").unwrap()).join(".ssh/authorized_keys");
let expected = File::open(&p).read_to_string().unwrap();
assert!(data == expected);
}