1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-12-30 20:59:13 +00:00
starship/tests/testsuite/singularity.rs
Thomas O'Donnell d91b6b7137
test: Add null tests to modules that don't have them (#1104)
Have added some null tests to modules that don't already have them.
2020-04-15 09:55:32 +02:00

28 lines
674 B
Rust

use ansi_term::Color;
use std::io;
use crate::common;
#[test]
fn no_env_set() -> io::Result<()> {
let output = common::render_module("singularity").output()?;
let actual = String::from_utf8(output.stdout).unwrap();
let expected = "";
assert_eq!(expected, actual);
Ok(())
}
#[test]
fn env_set() -> io::Result<()> {
let output = common::render_module("singularity")
.env_clear()
.env("SINGULARITY_NAME", "centos.img")
.output()?;
let expected = format!("{} ", Color::Blue.bold().dimmed().paint("[centos.img]"));
let actual = String::from_utf8(output.stdout).unwrap();
assert_eq!(expected, actual);
Ok(())
}