oh-my-fish/plugins/dpaste/tests/test_dpaste.fish

29 lines
870 B
Fish
Raw Normal View History

2014-06-12 03:08:51 +08:00
#!/usr/bin/env fish
set -l script_dir (dirname (status -f))
2014-06-12 03:08:51 +08:00
function suite_dpaste
function setup
set -g __dpaste_expires_choises
source $script_dir/../dpaste.fish
2014-06-12 03:08:51 +08:00
__dpaste_set_defaults
end
function test_dpaste_parse_expires
assert_equal text (__dpaste_parse_expires text)
assert_equal "https://dpaste.de/api/?format=url" $__dpaste_send_url
2014-06-12 03:50:29 +08:00
set -g __dpaste_send_url $dpaste_url
2014-06-12 03:08:51 +08:00
assert_equal text (__dpaste_parse_expires -t never text)
assert_equal "https://dpaste.de/api/?format=url&expires=never" $__dpaste_send_url
2014-06-12 03:50:29 +08:00
set -g __dpaste_send_url $dpaste_url
assert_equal text (__dpaste_parse_expires -t hour text)
assert_equal "https://dpaste.de/api/?format=url&expires=3600" $__dpaste_send_url
set -g __dpaste_send_url $dpaste_url
2014-06-12 03:08:51 +08:00
end
end
if not set -q tank_running
source $script_dir/helper.fish
2014-06-12 03:08:51 +08:00
tank_run
end