2015-01-13 11:30:24 +00:00
|
|
|
import plugins/fish-spec
|
|
|
|
|
2015-01-17 15:00:07 +00:00
|
|
|
function describe_oh_my_fish
|
2015-01-13 11:30:24 +00:00
|
|
|
function before_all
|
|
|
|
set -g fish_custom_bak $fish_custom
|
|
|
|
set -g fish_plugins_bak $fish_plugins
|
|
|
|
set -g fish_function_path_bak $fish_function_path
|
|
|
|
end
|
|
|
|
|
|
|
|
function after_all
|
|
|
|
set fish_custom $fish_custom_bak
|
|
|
|
set fish_plugins $fish_plugins_bak
|
|
|
|
set fish_function_path $fish_function_path_bak
|
|
|
|
end
|
|
|
|
|
2015-01-17 04:46:44 +00:00
|
|
|
function it_has_a_default_custom_directory
|
2015-01-13 11:30:24 +00:00
|
|
|
set -e fish_custom
|
|
|
|
load_oh_my_fish
|
2015-01-17 15:29:09 +00:00
|
|
|
expect $fish_custom --to-equal "$HOME/.oh-my-fish/custom"
|
2015-01-13 11:30:24 +00:00
|
|
|
end
|
|
|
|
|
2015-01-17 04:46:44 +00:00
|
|
|
function it_allows_the_custom_folder_location_to_be_customized
|
2015-01-13 11:30:24 +00:00
|
|
|
set -g fish_custom /tmp
|
|
|
|
load_oh_my_fish
|
2015-01-17 15:29:09 +00:00
|
|
|
expect $fish_custom --to-equal '/tmp'
|
2015-01-13 11:30:24 +00:00
|
|
|
end
|
|
|
|
|
2015-01-17 04:46:44 +00:00
|
|
|
function it_loads_all_custom_files
|
2015-01-13 11:30:24 +00:00
|
|
|
set -g fish_custom /tmp
|
|
|
|
echo 'set -gx TEST_LOAD_CUSTOM_FILE file_loaded' > $fish_custom/test.load
|
|
|
|
|
|
|
|
load_oh_my_fish
|
2015-01-17 15:29:09 +00:00
|
|
|
expect $TEST_LOAD_CUSTOM_FILE --to-equal 'file_loaded'
|
2015-01-13 11:30:24 +00:00
|
|
|
end
|
|
|
|
|
2015-01-17 04:46:44 +00:00
|
|
|
function it_loads_all_oh_my_fish_functions
|
2015-01-13 11:30:24 +00:00
|
|
|
list.erase "$fish_path/functions/" --from fish_function_path
|
|
|
|
|
|
|
|
load_oh_my_fish
|
2015-01-17 15:10:32 +00:00
|
|
|
expect $fish_function_path --to-contain-all $fish_path/functions/
|
2015-01-13 11:30:24 +00:00
|
|
|
end
|
|
|
|
|
2015-01-17 04:46:44 +00:00
|
|
|
function it_loads_all_selected_plugins
|
2015-01-13 11:30:24 +00:00
|
|
|
list.erase "$fish_path/plugins/bak" \
|
|
|
|
"$fish_path/plugins/z" --from fish_function_path
|
|
|
|
|
|
|
|
set -g fish_plugins bak z
|
|
|
|
load_oh_my_fish
|
2015-01-17 15:10:32 +00:00
|
|
|
expect $fish_function_path --to-contain-all $fish_path/plugins/bak
|
|
|
|
expect $fish_function_path --to-contain-all $fish_path/plugins/z
|
2015-01-13 11:30:24 +00:00
|
|
|
end
|
|
|
|
|
2015-01-17 04:46:44 +00:00
|
|
|
function it_loads_the_selected_theme
|
2015-01-13 11:30:24 +00:00
|
|
|
list.erase "$fish_path/themes/l" --from fish_function_path
|
|
|
|
|
|
|
|
set fish_theme l
|
|
|
|
load_oh_my_fish
|
2015-01-17 15:10:32 +00:00
|
|
|
expect $fish_function_path --to-contain-all $fish_path/themes/l
|
2015-01-13 11:30:24 +00:00
|
|
|
end
|
2015-01-13 19:10:54 +00:00
|
|
|
|
2015-01-17 04:46:44 +00:00
|
|
|
function it_reloads_with_status_of_0
|
2015-01-13 19:10:54 +00:00
|
|
|
load_oh_my_fish
|
|
|
|
expect $status --to-equal 0
|
|
|
|
end
|
2015-01-13 11:30:24 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
function load_oh_my_fish
|
|
|
|
. $fish_path/oh-my-fish.fish
|
|
|
|
end
|
|
|
|
|
|
|
|
spec.run $argv
|