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_julia.test.fish |
Initial commit
Diffstat (limited to '.config/fisher/github.com/matchai/spacefish/tests/__sf_section_julia.test.fish')
-rw-r--r-- | .config/fisher/github.com/matchai/spacefish/tests/__sf_section_julia.test.fish | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/.config/fisher/github.com/matchai/spacefish/tests/__sf_section_julia.test.fish b/.config/fisher/github.com/matchai/spacefish/tests/__sf_section_julia.test.fish new file mode 100644 index 00000000..941212b2 --- /dev/null +++ b/.config/fisher/github.com/matchai/spacefish/tests/__sf_section_julia.test.fish @@ -0,0 +1,93 @@ +source $DIRNAME/spacefish_test_setup.fish + +function setup + spacefish_test_setup + mock julia --version 0 "echo \"julia version 1.0.1\"" + mkdir -p /tmp/tmp-spacefish + cd /tmp/tmp-spacefish +end + +function teardown + rm -rf /tmp/tmp-spacefish +end + +test "Prints section when julia is installed and pwd has *.jl file(s)" + ( + touch some-julia-file.jl + + set_color --bold + echo -n "is " + set_color normal + set_color --bold green + echo -n "ஃ v1.0.1" + set_color normal + set_color --bold + echo -n " " + set_color normal + ) = (__sf_section_julia) +end + +test "Changing SPACEFISH_JULIA_SYMBOL changes the displayed character" + ( + set SPACEFISH_JULIA_SYMBOL "· " + touch some-julia-file.jl + + set_color --bold + echo -n "is " + set_color normal + set_color --bold green + echo -n "· v1.0.1" + set_color normal + set_color --bold + echo -n " " + set_color normal + ) = (__sf_section_julia) +end + +test "Changing SPACEFISH_JULIA_PREFIX changes the character prefix" + ( + set SPACEFISH_JULIA_PREFIX · + touch some-julia-file.jl + + set_color --bold + echo -n "·" + set_color normal + set_color --bold green + echo -n "ஃ v1.0.1" + set_color normal + set_color --bold + echo -n " " + set_color normal + ) = (__sf_section_julia) +end + +test "Changing SPACEFISH_JULIA_SUFFIX changes the character suffix" + ( + set SPACEFISH_JULIA_SUFFIX · + touch some-julia-file.jl + + set_color --bold + echo -n "is " + set_color normal + set_color --bold green + echo -n "ஃ v1.0.1" + set_color normal + set_color --bold + echo -n "·" + set_color normal + ) = (__sf_section_julia) +end + + +# Negative +test "Doesn't display section when SPACEFISH_JULIA_SHOW is set to 'false'" + ( + set -g SPACEFISH_JULIA_SHOW false + touch some-julia-file.jl + + ) = (__sf_section_julia) +end + +test "Doesn't display section when pwd has no *.jl file" + () = (__sf_section_julia) +end |