Fix various issues with tests

This commit is contained in:
2014-08-21 02:53:48 +01:00
parent 382a174355
commit ad59c37cfb
8 changed files with 14 additions and 13 deletions

View File

@@ -1,5 +1,5 @@
dotify-set-default-action() {
DOTIFY_ATTR_DEFAULT_ACTION="$1"
DOTIFY_ATTR_DEFAULT_ACTION="$@"
}
dotify-get-default-action() {

View File

@@ -1,5 +1,5 @@
dotify-set-root-link() {
DOTIFY_ATTR_ROOT_LINK="$1"
DOTIFY_ATTR_ROOT_LINK="$@"
}
dotify-get-root-link() {

View File

@@ -1,3 +1,3 @@
default_action() {
dotify-set-default-action "$@"
dotify-set-default-action $@
}

View File

@@ -1,3 +1,3 @@
root_link () {
dotify-set-root-link "$@"
dotify-set-root-link $@
}

View File

@@ -1,14 +1,15 @@
#! /usr/bin/env bash
source "../../test-helper.sh"
source "../../../src/lib/attributes/default-action.sh"
source "../../../src/lib/dotfile-commands/default_action.sh"
#
# root_link() tests
# default_action() tests
#
# Sets DOTIFY_OPT_DEFAULT_ACTION
default_action foo
assert 'echo $DOTIFY_OPT_DEFAULT_ACTION' 'foo'
assert 'echo $DOTIFY_ATTR_DEFAULT_ACTION' 'foo'
default_action foo bar
assert 'echo $DOTIFY_OPT_DEFAULT_ACTION' 'foo bar'
assert_end "root_link()"
assert 'echo $DOTIFY_ATTR_DEFAULT_ACTION' 'foo bar'
assert_end "default_action()"

View File

@@ -1,5 +1,6 @@
#! /usr/bin/env bash
source "../../test-helper.sh"
source "../../../src/lib/attributes/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
root_link .dots
assert 'echo $DOTIFY_OPT_ROOT_LINK' '.dots'
assert 'echo $DOTIFY_ATTR_ROOT_LINK' '.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()"

View File

@@ -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_end "parse-argument()"

View File

@@ -4,7 +4,7 @@ source "../../../src/lib/internals/register-action.sh"
source "../../../src/lib/internals/has-action.sh"
#
# dotify-register-action() tests
# dotify-has-action() tests
#
# When no actions are registered.
@@ -29,4 +29,4 @@ assert_raises 'dotify-has-action "copy"' 1
unset DOTIFY_ACTIONS
assert_end "dotify-register-action() tests"
assert_end "dotify-has-action() tests"