oh-my-fish/test/test_oh-my-fish.fish

65 lines
1.7 KiB
Fish
Raw Normal View History

2015-01-10 12:14:02 +08:00
function describe_oh_my_fish
function before_all
2015-01-10 07:15:19 +08:00
set -g fish_custom_bak $fish_custom
set -g fish_function_path_bak $fish_function_path
set -g fish_plugins_bak $fish_plugins
end
2015-01-10 12:14:02 +08:00
function after_all
2015-01-10 07:15:19 +08:00
set fish_custom $fish_custom_bak
set fish_function_path $fish_function_path_bak
set fish_plugins $fish_plugins_bak
end
2015-01-10 12:14:02 +08:00
function it_has_a_default_custom_folder
2015-01-10 07:15:19 +08:00
set -e fish_custom
load_oh_my_fish
2015-01-10 12:14:02 +08:00
expect $fish_custom to_equal "$HOME/.oh-my-fish/custom"
2015-01-10 07:15:19 +08:00
end
2015-01-10 12:14:02 +08:00
function it_allows_the_custom_folder_location_to_be_customized
2015-01-10 07:15:19 +08:00
set fish_custom /tmp
load_oh_my_fish
2015-01-10 12:14:02 +08:00
expect $fish_custom to_equal '/tmp'
2015-01-10 07:15:19 +08:00
end
2015-01-10 12:14:02 +08:00
function it_loads_all_custom_files
2015-01-10 07:15:19 +08:00
set fish_custom /tmp
2015-01-10 12:14:02 +08:00
echo 'set -gx TEST_LOAD_CUSTOM_FILE file_loaded' > $fish_custom/test.load
2015-01-10 07:15:19 +08:00
load_oh_my_fish
2015-01-10 12:14:02 +08:00
expect $TEST_LOAD_CUSTOM_FILE to_equal 'file_loaded'
2015-01-10 07:15:19 +08:00
end
2015-01-10 12:14:02 +08:00
function it_loads_all_oh_my_fish_functions
2015-01-10 22:18:04 +08:00
array.delete "$fish_path/functions/" fish_function_path
2015-01-10 07:15:19 +08:00
load_oh_my_fish
2015-01-10 12:14:02 +08:00
expect $fish_function_path to_include $fish_path/functions/
2015-01-10 07:15:19 +08:00
end
2015-01-10 12:14:02 +08:00
function it_loads_all_selected_plugins
2015-01-10 22:18:04 +08:00
array.delete "$fish_path/plugins/bak" fish_function_path
array.delete "$fish_path/plugins/z" fish_function_path
2015-01-10 12:14:02 +08:00
set fish_plugins bak z
2015-01-10 07:15:19 +08:00
load_oh_my_fish
2015-01-10 12:14:02 +08:00
expect $fish_function_path to_include $fish_path/plugins/bak and
expect $fish_function_path to_include $fish_path/plugins/z
2015-01-10 07:15:19 +08:00
end
2015-01-10 12:14:02 +08:00
function it_loads_the_selected_theme
2015-01-10 22:18:04 +08:00
array.delete "$fish_path/themes/l" fish_function_path
2015-01-10 07:15:19 +08:00
set fish_theme l
load_oh_my_fish
2015-01-10 12:14:02 +08:00
expect $fish_function_path to_include $fish_path/themes/l
2015-01-10 07:15:19 +08:00
end
2015-01-10 12:14:02 +08:00
end
2015-01-10 07:15:19 +08:00
2015-01-10 12:14:02 +08:00
function load_oh_my_fish
. $fish_path/oh-my-fish.fish
end
2015-01-10 07:15:19 +08:00
2015-01-10 12:14:02 +08:00
import plugins/fish-spec