Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
O
oh-my-fish
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
oh-my-fish
Commits
13051d01
Commit
13051d01
authored
Jan 09, 2015
by
Bruno Pinto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oh-my-fish.fish tests
parent
63637146
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
87 additions
and
0 deletions
+87
-0
test/helper.fish
test/helper.fish
+7
-0
test/test_oh-my-fish.fish
test/test_oh-my-fish.fish
+80
-0
No files found.
test/helper.fish
0 → 100644
View file @
13051d01
set -l fish_tank /usr/local/share/fish-tank/tank.fish
if not test -e $fish_tank
echo 'error: fish-tank is required to run these tests (https://github.com/terlar/fish-tank)'
exit 1
end
source $fish_tank
test/test_oh-my-fish.fish
0 → 100644
View file @
13051d01
function suite_oh-my-fish
function setup
set -g fish_custom_bak $fish_custom
set -g fish_function_path_bak $fish_function_path
set -g fish_plugins_bak $fish_plugins
end
function teardown
set fish_custom $fish_custom_bak
set fish_function_path $fish_function_path_bak
set fish_plugins $fish_plugins_bak
end
#
# tests
#
function test_default_custom_folder
set -e fish_custom
load_oh_my_fish
assert_equal ~/.oh-my-fish/custom $fish_custom
end
function test_custom_folder
set fish_custom /tmp
load_oh_my_fish
assert_equal /tmp $fish_custom
end
function test_load_custom_files
set fish_custom /tmp
echo 'set -gx TEST_LOAD_CUSTOM_FILE test_load' > $fish_custom/test.load
load_oh_my_fish
assert_equal test_load $TEST_LOAD_CUSTOM_FILE
end
function test_oh_my_fish_functions
remove_from_array "$fish_path/functions/" fish_function_path
load_oh_my_fish
assert_includes $fish_path/functions/ $fish_function_path
end
function test_oh_my_fish_plugins
remove_from_array "$fish_path/plugins/z" fish_function_path
set fish_plugins z
load_oh_my_fish
assert_includes $fish_path/plugins/z $fish_function_path
end
function test_oh_my_fish_themes
remove_from_array "$fish_path/themes/l" fish_function_path
set fish_theme l
load_oh_my_fish
assert_includes $fish_path/themes/l $fish_function_path
end
#
# helper functions
#
function load_oh_my_fish
. $fish_path/oh-my-fish.fish
end
function remove_from_array
set -l element $argv[1]
for i in (seq (count $$argv[2]))
if test $$argv[2][$i] = $element
set -e $argv[2][$i]
break
end
end
end
end
if not set -q tank_running
source (dirname (status -f))/helper.fish
tank_run
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment