mirror of
https://github.com/jimeh/dotify.git
synced 2026-02-19 10:06:39 +00:00
Fix various issues with tests
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
dotify-set-default-action() {
|
dotify-set-default-action() {
|
||||||
DOTIFY_ATTR_DEFAULT_ACTION="$1"
|
DOTIFY_ATTR_DEFAULT_ACTION="$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
dotify-get-default-action() {
|
dotify-get-default-action() {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
dotify-set-root-link() {
|
dotify-set-root-link() {
|
||||||
DOTIFY_ATTR_ROOT_LINK="$1"
|
DOTIFY_ATTR_ROOT_LINK="$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
dotify-get-root-link() {
|
dotify-get-root-link() {
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
default_action() {
|
default_action() {
|
||||||
dotify-set-default-action "$@"
|
dotify-set-default-action $@
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
root_link () {
|
root_link () {
|
||||||
dotify-set-root-link "$@"
|
dotify-set-root-link $@
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
source "../../test-helper.sh"
|
source "../../test-helper.sh"
|
||||||
|
source "../../../src/lib/attributes/default-action.sh"
|
||||||
source "../../../src/lib/dotfile-commands/default_action.sh"
|
source "../../../src/lib/dotfile-commands/default_action.sh"
|
||||||
|
|
||||||
#
|
#
|
||||||
# root_link() tests
|
# default_action() tests
|
||||||
#
|
#
|
||||||
|
|
||||||
# Sets DOTIFY_OPT_DEFAULT_ACTION
|
# Sets DOTIFY_OPT_DEFAULT_ACTION
|
||||||
default_action foo
|
default_action foo
|
||||||
assert 'echo $DOTIFY_OPT_DEFAULT_ACTION' 'foo'
|
assert 'echo $DOTIFY_ATTR_DEFAULT_ACTION' 'foo'
|
||||||
default_action foo bar
|
default_action foo bar
|
||||||
assert 'echo $DOTIFY_OPT_DEFAULT_ACTION' 'foo bar'
|
assert 'echo $DOTIFY_ATTR_DEFAULT_ACTION' 'foo bar'
|
||||||
assert_end "root_link()"
|
assert_end "default_action()"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
source "../../test-helper.sh"
|
source "../../test-helper.sh"
|
||||||
|
source "../../../src/lib/attributes/root-link.sh"
|
||||||
source "../../../src/lib/dotfile-commands/root_link.sh"
|
source "../../../src/lib/dotfile-commands/root_link.sh"
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -8,7 +9,7 @@ source "../../../src/lib/dotfile-commands/root_link.sh"
|
|||||||
|
|
||||||
# Sets DOTIFY_OPT_ROOT_LINK
|
# Sets DOTIFY_OPT_ROOT_LINK
|
||||||
root_link .dots
|
root_link .dots
|
||||||
assert 'echo $DOTIFY_OPT_ROOT_LINK' '.dots'
|
assert 'echo $DOTIFY_ATTR_ROOT_LINK' '.dots'
|
||||||
root_link my dots
|
root_link my dots
|
||||||
assert 'echo $DOTIFY_OPT_ROOT_LINK' 'my dots'
|
assert 'echo $DOTIFY_ATTR_ROOT_LINK' 'my dots'
|
||||||
assert_end "root_link()"
|
assert_end "root_link()"
|
||||||
|
|||||||
@@ -46,5 +46,4 @@ assert 'parse-argument file f -v --file=foo\ bar.txt' "foo bar.txt"
|
|||||||
assert 'parse-argument file f -v --file="foo bar.txt"' "foo bar.txt"
|
assert 'parse-argument file f -v --file="foo bar.txt"' "foo bar.txt"
|
||||||
assert "parse-argument file f -v --file='foo bar.txt'" "foo bar.txt"
|
assert "parse-argument file f -v --file='foo bar.txt'" "foo bar.txt"
|
||||||
|
|
||||||
|
|
||||||
assert_end "parse-argument()"
|
assert_end "parse-argument()"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ source "../../../src/lib/internals/register-action.sh"
|
|||||||
source "../../../src/lib/internals/has-action.sh"
|
source "../../../src/lib/internals/has-action.sh"
|
||||||
|
|
||||||
#
|
#
|
||||||
# dotify-register-action() tests
|
# dotify-has-action() tests
|
||||||
#
|
#
|
||||||
|
|
||||||
# When no actions are registered.
|
# When no actions are registered.
|
||||||
@@ -29,4 +29,4 @@ assert_raises 'dotify-has-action "copy"' 1
|
|||||||
unset DOTIFY_ACTIONS
|
unset DOTIFY_ACTIONS
|
||||||
|
|
||||||
|
|
||||||
assert_end "dotify-register-action() tests"
|
assert_end "dotify-has-action() tests"
|
||||||
|
|||||||
Reference in New Issue
Block a user