2019-09-26 02:55:47 +00:00
|
|
|
use ansi_term::Color;
|
|
|
|
use std::io;
|
|
|
|
|
|
|
|
use crate::common;
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn no_profile_set() -> io::Result<()> {
|
|
|
|
let output = common::render_module("aws").env_clear().output()?;
|
|
|
|
let expected = "";
|
|
|
|
let actual = String::from_utf8(output.stdout).unwrap();
|
|
|
|
assert_eq!(expected, actual);
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn profile_set() -> io::Result<()> {
|
|
|
|
let output = common::render_module("aws")
|
|
|
|
.env_clear()
|
|
|
|
.env("AWS_PROFILE", "astronauts")
|
|
|
|
.output()?;
|
2019-10-14 13:56:16 +00:00
|
|
|
let expected = format!("on {} ", Color::Yellow.bold().paint("☁️ astronauts"));
|
2019-09-26 02:55:47 +00:00
|
|
|
let actual = String::from_utf8(output.stdout).unwrap();
|
|
|
|
assert_eq!(expected, actual);
|
|
|
|
Ok(())
|
|
|
|
}
|