Skip to content

Commit

Permalink
Change antidote sourcing in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmc3 committed Oct 2, 2023
1 parent f984312 commit 852d189
Show file tree
Hide file tree
Showing 21 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ But you probably just want to source setup...
```zsh
% source ./tests/_setup.zsh
% source ./antidote.zsh
%
```
Expand Down
2 changes: 2 additions & 0 deletions tests/functions/t_reset
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/zsh
function t_reset {
0=${(%):-%x}
t_teardown
t_setup
source ${0:A:h:h:h}/antidote.zsh
}
t_reset "$@"
1 change: 0 additions & 1 deletion tests/functions/t_setup
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,5 @@ function t_setup {

# load antidote
typeset -g ANTIDOTE_HOME=$ZDOTDIR/antidote_home
source $prjdir/antidote.zsh
}
t_setup "$@"
4 changes: 4 additions & 0 deletions tests/functions/t_setup_real
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
function t_setup_real {
0=${(%):-%x}
local testdir="${0:A:h:h}"
local prjdir="${0:A:h:h:h}"

# undo setup so we clone for real
zstyle ':antidote:tests' cloning 'on'
Expand All @@ -20,5 +21,8 @@ function t_setup_real {
# clean out antidote home
[[ -d $ANTIDOTE_HOME ]] && rm -rf -- "$ANTIDOTE_HOME"
mkdir -p "$ANTIDOTE_HOME"

# source antidote
source $prjdir/antidote.zsh
}
t_setup_real "$@"
1 change: 1 addition & 0 deletions tests/test_antidote.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ antidote: Expecting zsh. Found 'bash'.
% echo $+functions[antidote]
0
% source ./tests/_setup.zsh
% source ./antidote.zsh
% echo $+functions[antidote]
1
% git --version
Expand Down
1 change: 1 addition & 0 deletions tests/test_bundle_helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
```zsh
% TESTDATA=$PWD/tests/testdata
% source ./tests/_setup.zsh
% source ./antidote.zsh
% antidote-bundle -h &>/dev/null
%
```
Expand Down
1 change: 1 addition & 0 deletions tests/test_cmd_bundle.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

```zsh
% source ./tests/_setup.zsh
% source ./antidote.zsh
%
```

Expand Down
1 change: 1 addition & 0 deletions tests/test_cmd_help.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

```zsh
% source ./tests/_setup.zsh
% source ./antidote.zsh
%
```

Expand Down
1 change: 1 addition & 0 deletions tests/test_cmd_home.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

```zsh
% source ./tests/_setup.zsh
% source ./antidote.zsh
%
```

Expand Down
1 change: 1 addition & 0 deletions tests/test_cmd_init.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

```zsh
% source ./tests/_setup.zsh
% source ./antidote.zsh
%
```

Expand Down
1 change: 1 addition & 0 deletions tests/test_cmd_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

```zsh
% source ./tests/_setup.zsh
% source ./antidote.zsh
%
```

Expand Down
1 change: 1 addition & 0 deletions tests/test_cmd_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

```zsh
% source ./tests/_setup.zsh
% source ./antidote.zsh
%
```

Expand Down
1 change: 1 addition & 0 deletions tests/test_cmd_load.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

```zsh
% source ./tests/_setup.zsh
% source ./antidote.zsh
%
```

Expand Down
1 change: 1 addition & 0 deletions tests/test_cmd_main.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

```zsh
% source ./tests/_setup.zsh
% source ./antidote.zsh
%
```

Expand Down
1 change: 1 addition & 0 deletions tests/test_cmd_path.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

```zsh
% source ./tests/_setup.zsh
% source ./antidote.zsh
%
```

Expand Down
1 change: 1 addition & 0 deletions tests/test_cmd_purge.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

```zsh
% source ./tests/_setup.zsh
% source ./antidote.zsh
%
```

Expand Down
1 change: 1 addition & 0 deletions tests/test_cmd_script.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

```zsh
% source ./tests/_setup.zsh
% source ./antidote.zsh
%
```

Expand Down
1 change: 1 addition & 0 deletions tests/test_cmd_script_use.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

```zsh
% source ./tests/_setup.zsh
% source ./antidote.zsh
%
```

Expand Down
1 change: 1 addition & 0 deletions tests/test_cmd_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

```zsh
% source ./tests/_setup.zsh
% source ./antidote.zsh
%
```

Expand Down
1 change: 1 addition & 0 deletions tests/test_helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

```zsh
% source ./tests/_setup.zsh
% source ./antidote.zsh
%
```

Expand Down
1 change: 1 addition & 0 deletions tests/test_setopts.md → tests/test_zsetopts.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

```zsh
% source ./tests/_setup.zsh
% source ./antidote.zsh
%
```

Expand Down

0 comments on commit 852d189

Please sign in to comment.