summaryrefslogtreecommitdiff
path: root/.config/fisher/github.com/matchai/spacefish/tests/__sf_section_julia.test.fish
diff options
context:
space:
mode:
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.fish93
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