2019-07-02 20:12:53 +00:00
|
|
|
|
use ansi_term::Color;
|
|
|
|
|
use std::io;
|
|
|
|
|
|
|
|
|
|
use crate::common::{self, TestCommand};
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
fn char_symbol_configuration() -> io::Result<()> {
|
|
|
|
|
let expected = format!("{} ", Color::Green.bold().paint("❯"));
|
|
|
|
|
|
2019-07-19 20:18:52 +00:00
|
|
|
|
let output = common::render_module("character")
|
2019-07-02 20:12:53 +00:00
|
|
|
|
.use_config(toml::toml! {
|
2019-07-19 20:18:52 +00:00
|
|
|
|
[character]
|
2019-07-02 20:12:53 +00:00
|
|
|
|
symbol = "❯"
|
|
|
|
|
})
|
|
|
|
|
.output()?;
|
|
|
|
|
let actual = String::from_utf8(output.stdout).unwrap();
|
|
|
|
|
assert_eq!(expected, actual);
|
|
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
fn disabled_module() -> io::Result<()> {
|
|
|
|
|
let output = common::render_module("package")
|
|
|
|
|
.use_config(toml::toml! {
|
|
|
|
|
[package]
|
|
|
|
|
disabled = true
|
|
|
|
|
})
|
|
|
|
|
.output()?;
|
|
|
|
|
let actual = String::from_utf8(output.stdout).unwrap();
|
|
|
|
|
assert_eq!("", actual);
|
|
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
|
}
|