File tree Expand file tree Collapse file tree 2 files changed +31
-9
lines changed Expand file tree Collapse file tree 2 files changed +31
-9
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bats
2
2
3
- load ' test_helper/bats-support/load'
4
- load ' test_helper/bats-assert/load'
5
- load ' test_helper/util'
3
+ # Used by both `setup_file` and `setup`, which are special bats callbacks.
4
+ __load_imports__ () {
5
+ load ' test_helper/bats-support/load'
6
+ load ' test_helper/bats-assert/load'
7
+ load ' test_helper/util'
8
+ }
9
+
10
+ setup_file () {
11
+ __load_imports__
12
+ }
13
+
14
+ setup () {
15
+ __load_imports__
16
+ }
6
17
7
18
# https://github.com/paulirish/dotfiles/commit/6743b907ff586c28cd36e08d1e1c634e2968893e#commitcomment-13459061
8
19
@test " All removed lines are present in diff" {
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bats
2
2
3
- load ' test_helper/bats-support/load'
4
- load ' test_helper/bats-assert/load'
5
- load ' test_helper/util'
3
+ # Helper invoked by `setup_file` and `setup`, which are special bats callbacks.
4
+ __load_imports__ () {
5
+ load ' test_helper/bats-support/load'
6
+ load ' test_helper/bats-assert/load'
7
+ load ' test_helper/util'
8
+ }
9
+
10
+ setup_file () {
11
+ __load_imports__
12
+ }
6
13
7
- set_env
14
+ setup () {
15
+ __load_imports__
8
16
9
- # bats fails to handle our multiline result, so we save to $output ourselves
10
- output=$( load_fixture " ls-function" | $diff_so_fancy )
17
+ set_env
18
+
19
+ # bats fails to handle our multiline result, so we save to $output ourselves
20
+ output=$( load_fixture " ls-function" | $diff_so_fancy )
21
+ }
11
22
12
23
@test " diff-so-fancy runs and exits without error" {
13
24
load_fixture " ls-function" | $diff_so_fancy
You can’t perform that action at this time.
0 commit comments