2015-03-01 06:06:27 +00:00
|
|
|
import plugins/fish-spec
|
|
|
|
import plugins/balias
|
|
|
|
|
2015-03-17 23:53:36 +00:00
|
|
|
function describe_library -d "balias: better-alias"
|
2015-03-01 06:06:27 +00:00
|
|
|
|
|
|
|
function after_all
|
|
|
|
functions -e changedir
|
2015-03-01 14:20:42 +00:00
|
|
|
functions -e ls_as_root
|
2015-03-01 06:06:27 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
function it_doesnt_fail
|
|
|
|
balias changedir cd
|
2015-03-17 23:53:36 +00:00
|
|
|
expect $status --to-equal 0
|
2015-03-01 06:06:27 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
function it_defines_an_alias
|
2015-03-17 23:53:36 +00:00
|
|
|
balias changedir cd
|
|
|
|
set -l ignore_output (functions changedir)
|
|
|
|
expect $status --to-equal 0
|
2015-03-01 06:06:27 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
function you_can_use_the_alias
|
|
|
|
mkdir testdir
|
|
|
|
changedir testdir
|
|
|
|
expect test $status --to-be-true
|
|
|
|
cd ..
|
|
|
|
rmdir testdir
|
|
|
|
end
|
|
|
|
|
2015-03-01 14:20:42 +00:00
|
|
|
function it_chops_off_sudo
|
|
|
|
balias ls_as_root 'sudo ls'
|
|
|
|
expect test $status --to-be-true
|
|
|
|
end
|
2015-03-01 06:06:27 +00:00
|
|
|
end
|
|
|
|
|
2015-03-17 23:53:36 +00:00
|
|
|
spec.run $argv
|