1
0
mirror of https://github.com/zplug/zplug synced 2025-08-31 02:00:38 +02:00
zplug/test/autoload/commands/__check___test.zsh
Naoki Mizuno 878e894e3d Fix tests
2016-03-15 08:42:01 -04:00

52 lines
980 B
Bash

#!/bin/zsh
: before
{
source "$ZPLUG_ROOT/init.zsh"
source "$ZPLUG_ROOT/test/.helpers/mock.zsh"
export ZPLUG_HOME="$ZPLUG_ROOT/test/.fixtures"
unset ZPLUG_LOADFILE
local expect actual
}
describe "__check__"
it "Unknown option"
expect="[zplug] --unknown: Unknown option"
actual="$(zplug check --unknown 2>&1)"
assert.false $status
assert.equals "$expect" "$actual"
end
it "check command returns true"
mock_as_plugin "foo/foo"
zplug check "foo/foo"
assert.true $status
end
it "check command returns true (no args)"
zplug check
assert.true $status
end
# Remove foo
mock_remove "foo/foo"
it "check command returns false"
zplug check "foo/foo"
assert.false $status
end
it "check command returns false (no args)"
zplug check
assert.false $status
end
end
: after
{
zplugs=()
unset expect actual
}