mirror of
https://github.com/starship/starship.git
synced 2024-12-04 14:23:22 +01:00
26 lines
672 B
Rust
26 lines
672 B
Rust
|
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()?;
|
||
|
let expected = format!("on {} ", Color::Yellow.bold().paint("☁️ astronauts"));
|
||
|
let actual = String::from_utf8(output.stdout).unwrap();
|
||
|
assert_eq!(expected, actual);
|
||
|
Ok(())
|
||
|
}
|