diff options
author | Thomas O'Donnell <andytom@users.noreply.github.com> | 2019-09-26 04:55:47 +0200 |
---|---|---|
committer | Kevin Song <chipbuster@users.noreply.github.com> | 2019-09-25 21:55:47 -0500 |
commit | b050c597081967cbe7135d294f0cf43c2ec7608d (patch) | |
tree | f352a022b49ad9fb1b5d5fed1effe549b3e08e2f /tests/testsuite/aws.rs | |
parent | 80a9e7b9a638e4e695be8280a9baff3550037111 (diff) |
feat: Add AWS module (#419)
Adds a module for displaying the current AWS profile based
on the AWS_PROFILE envar.
Diffstat (limited to 'tests/testsuite/aws.rs')
-rw-r--r-- | tests/testsuite/aws.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/testsuite/aws.rs b/tests/testsuite/aws.rs new file mode 100644 index 000000000..d02bccca2 --- /dev/null +++ b/tests/testsuite/aws.rs @@ -0,0 +1,25 @@ +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(()) +} |