Riven/tests/tests2.rs

30 lines
655 B
Rust
Raw Normal View History

2019-10-20 07:54:01 +00:00
#![feature(custom_test_frameworks)]
#![test_runner(my_runner)]
mod async_tests;
use colored::*;
use lazy_static::lazy_static;
use riven::RiotApi;
use tokio::runtime::current_thread::Runtime;
lazy_static! {
2019-10-22 05:43:06 +00:00
static ref RIOT_API: RiotApi = {
2019-10-20 07:54:01 +00:00
let api_key = std::fs::read_to_string("apikey.txt").unwrap(); // TODO don't use unwrap.
2019-10-22 05:43:06 +00:00
RiotApi::with_key(api_key.trim())
2019-10-20 07:54:01 +00:00
};
}
async_tests!{
my_runner {
test_1: async {
rassert_eq!("world", "world");
Ok(())
},
test_2: async {
rassert_eq!("hello", "hello");
Ok(())
},
}
}