diff options
author | Roger Gonzalez <rogergonzalez21@gmail.com> | 2019-12-29 14:58:33 -0300 |
---|---|---|
committer | Roger Gonzalez <rogergonzalez21@gmail.com> | 2019-12-29 14:58:33 -0300 |
commit | efb336a23b65a9a2d56889396b13c1757bdaf354 (patch) | |
tree | 234e40115f79a84c8a755df6fb932cc6797e36e1 /.config/fisher/github.com/matchai/spacefish/tests/__sf_section_aws.test.fish |
Initial commit
Diffstat (limited to '.config/fisher/github.com/matchai/spacefish/tests/__sf_section_aws.test.fish')
-rw-r--r-- | .config/fisher/github.com/matchai/spacefish/tests/__sf_section_aws.test.fish | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/.config/fisher/github.com/matchai/spacefish/tests/__sf_section_aws.test.fish b/.config/fisher/github.com/matchai/spacefish/tests/__sf_section_aws.test.fish new file mode 100644 index 00000000..17c5eb6c --- /dev/null +++ b/.config/fisher/github.com/matchai/spacefish/tests/__sf_section_aws.test.fish @@ -0,0 +1,89 @@ +source $DIRNAME/spacefish_test_setup.fish + +function setup + spacefish_test_setup + mock aws \* 0 + set -g AWS_PROFILE user1 +end + +test "Prints section when AWS_PROFILE is set" + ( + set_color --bold + echo -n "using " + set_color normal + set_color --bold ff8700 + echo -n "☁️ user1" + set_color normal + set_color --bold + echo -n " " + set_color normal + ) = (__sf_section_aws) +end + +test "Doesn't print the section when AWS_PROFILE isn't set" + ( + set --erase AWS_PROFILE + ) = (__sf_section_aws) +end + +test "Doesn't print the section when AWS_PROFILE is set to \"default\"" + ( + set AWS_PROFILE default + ) = (__sf_section_aws) +end + +test "Changing SPACEFISH_AWS_SYMBOL changes the displayed character" + ( + set SPACEFISH_AWS_SYMBOL "· " + + set_color --bold + echo -n "using " + set_color normal + set_color --bold ff8700 + echo -n "· user1" + set_color normal + set_color --bold + echo -n " " + set_color normal + ) = (__sf_section_aws) +end + +test "Changing SPACEFISH_AWS_PREFIX changes the character prefix" + ( + set sf_exit_code 0 + set SPACEFISH_AWS_PREFIX · + + set_color --bold + echo -n "·" + set_color normal + set_color --bold ff8700 + echo -n "☁️ user1" + set_color normal + set_color --bold + echo -n " " + set_color normal + ) = (__sf_section_aws) +end + +test "Changing SPACEFISH_AWS_SUFFIX changes the character suffix" + ( + set sf_exit_code 0 + set SPACEFISH_AWS_SUFFIX · + + set_color --bold + echo -n "using " + set_color normal + set_color --bold ff8700 + echo -n "☁️ user1" + set_color normal + set_color --bold + echo -n "·" + set_color normal + ) = (__sf_section_aws) +end + +test "doesn't display the section when SPACEFISH_AWS_SHOW is set to \"false\"" + ( + set SPACEFISH_AWS_SHOW false + ) = (__sf_section_aws) +end |