Skip to content

Commit cd878c2

Browse files
author
Maciek Swiech
committed
added bats
1 parent fe81a40 commit cd878c2

File tree

6 files changed

+24
-0
lines changed

6 files changed

+24
-0
lines changed

.gitmodules

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[submodule "test/libs/bats"]
2+
path = test/libs/bats
3+
url = https://github.com/sstephenson/bats
4+
[submodule "test/libs/bats-assert"]
5+
path = test/libs/bats-assert
6+
url = https://github.com/ztombol/bats-assert
7+
[submodule "test/libs/bats-support"]
8+
path = test/libs/bats-support
9+
url = https://github.com/ztombol/bats-support

bashtop

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4822,6 +4822,10 @@ else
48224822
exec 2>/dev/null
48234823
fi
48244824

4825+
4826+
#* if we have been sourced by another shell, quit. Allows sourcing only function definition.
4827+
[[ "${#BASH_SOURCE[@]}" -gt 1 ]] && { return 0; }
4828+
48254829
#* Call init function
48264830
init_
48274831

test/bats

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bats
2+
3+
source bashtop
4+
5+
@test "im a toy" {
6+
result=$(echo hello)
7+
[ "$result" = "hello" ]
8+
}

test/libs/bats

Submodule bats added at 0360811

test/libs/bats-assert

Submodule bats-assert added at 9f88b42

test/libs/bats-support

Submodule bats-support added at 004e707

0 commit comments

Comments
 (0)