mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2025-01-20 11:43:16 +08:00
3021402525
+ Add fish eval fix See #fish-shell/pull/1892 + New and improved output system with colors, etc. + Support for multiple non-nested describe blocks. + Remove spec.log and favor `msg` plugin and standard echo. + `spec.eval` no longer evaluates multiple functions, acting now as a simplified router between the view `spec.view` and the controller `spec.run`. + Add new `spec.view` to act as a hub for all test output. + Add report with passed/failed tests to `spec.view` + Now test descriptions are used directly from the function name. Description fields are now optional.
72 lines
1.9 KiB
Fish
Executable File
72 lines
1.9 KiB
Fish
Executable File
import plugins/fish-spec
|
|
|
|
function describe_oh_my_fish -d "Oh-My-Fish test spec..."
|
|
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
|
|
|
|
function it_has_a_default_custom_directory
|
|
set -e fish_custom
|
|
load_oh_my_fish
|
|
expect $fish_custom --to-eq "$HOME/.oh-my-fish/custom"
|
|
end
|
|
|
|
function it_allows_the_custom_folder_location_to_be_customized
|
|
set -g fish_custom /tmp
|
|
load_oh_my_fish
|
|
expect $fish_custom --to-eq '/tmp'
|
|
end
|
|
|
|
function it_loads_all_custom_files
|
|
set -g fish_custom /tmp
|
|
echo 'set -gx TEST_LOAD_CUSTOM_FILE file_loaded' > $fish_custom/test.load
|
|
|
|
load_oh_my_fish
|
|
expect $TEST_LOAD_CUSTOM_FILE --to-eq 'file_loaded'
|
|
end
|
|
|
|
function it_loads_all_oh_my_fish_functions
|
|
list.erase "$fish_path/functions/" --from fish_function_path
|
|
|
|
load_oh_my_fish
|
|
expect $fish_function_path --to-contain $fish_path/functions/
|
|
end
|
|
|
|
function it_loads_all_selected_plugins
|
|
list.erase "$fish_path/plugins/bak" \
|
|
"$fish_path/plugins/z" --from fish_function_path
|
|
|
|
set -g fish_plugins bak z
|
|
load_oh_my_fish
|
|
expect $fish_function_path --to-contain $fish_path/plugins/bak
|
|
expect $fish_function_path --to-contain $fish_path/plugins/z
|
|
end
|
|
|
|
function it_loads_the_selected_theme
|
|
list.erase "$fish_path/themes/l" --from fish_function_path
|
|
|
|
set fish_theme l
|
|
load_oh_my_fish
|
|
expect $fish_function_path --to-contain $fish_path/themes/l
|
|
end
|
|
|
|
function it_reloads_with_status_of_0
|
|
load_oh_my_fish
|
|
expect $status --to-equal 0
|
|
end
|
|
end
|
|
|
|
function load_oh_my_fish
|
|
. $fish_path/oh-my-fish.fish
|
|
end
|
|
|
|
spec.run $argv
|