From ad0bde3092499e26c819a871065f70d0d8519e0b Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sat, 8 Aug 2015 11:45:53 +0200 Subject: [PATCH] fix(tests): assure tests actually work Previously we simply forgot to run the tests, and published test-code that didn't really work. --- examples/auth.rs | 2 +- src/device.rs | 2 -- src/lib.rs | 1 + src/lib.rs.in | 4 ++-- src/refresh.rs | 2 -- 5 files changed, 4 insertions(+), 7 deletions(-) diff --git a/examples/auth.rs b/examples/auth.rs index 4277d1d1a..f76be92e6 100644 --- a/examples/auth.rs +++ b/examples/auth.rs @@ -78,7 +78,7 @@ fn main() { } let client = hyper::Client::with_connector(mock::TeeConnector { - connector: hyper::net::HttpConnector(None) + connector: hyper::net::HttpConnector }); match oauth2::Authenticator::new(&secret, StdoutHandler, client, diff --git a/src/device.rs b/src/device.rs index b8d49dff3..bcbfde465 100644 --- a/src/device.rs +++ b/src/device.rs @@ -384,8 +384,6 @@ pub mod tests { fn connect(&self, host: &str, port: u16, scheme: &str) -> ::hyper::Result { self.0.connect(host, port, scheme) } - - fn set_ssl_verifier(&mut self, _: hyper::net::ContextVerifier) {} } #[test] diff --git a/src/lib.rs b/src/lib.rs index 7e8f93fd5..80c7eb878 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -18,6 +18,7 @@ //! extern crate hyper; //! extern crate yup_oauth2 as oauth2; //! extern crate serde; +//! extern crate serde_json; //! //! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, PollInformation, ConsoleApplicationSecret, MemoryStorage, GetToken}; //! use serde_json as json; diff --git a/src/lib.rs.in b/src/lib.rs.in index d79840e53..da2294bbd 100644 --- a/src/lib.rs.in +++ b/src/lib.rs.in @@ -4,9 +4,9 @@ extern crate serde_json; extern crate chrono; extern crate hyper; -#[macro_use] #[cfg(test)] +#[cfg(test)] extern crate log; -#[macro_use] #[cfg(test)] +#[cfg(test)] extern crate yup_hyper_mock; extern crate mime; extern crate url; diff --git a/src/refresh.rs b/src/refresh.rs index 179e7dc9e..6c18183b0 100644 --- a/src/refresh.rs +++ b/src/refresh.rs @@ -149,8 +149,6 @@ mod tests { fn connect(&self, host: &str, port: u16, scheme: &str) -> ::hyper::Result { self.0.connect(host, port, scheme) } - - fn set_ssl_verifier(&mut self, _: hyper::net::ContextVerifier) {} } #[test]