forked from bats-core/bats-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Contrary to setup/teardown this has the bats:: prefix to avoid name collisions due to t he generic name. In the long run, the other functions should be named bats::setup/bats::teardown/bats::... as well.
- Loading branch information
1 parent
b640ec3
commit b9536d7
Showing
6 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
bats::on_failure() { | ||
echo "called failure callback" | ||
} | ||
|
||
@test failure callback is called on failure { | ||
false | ||
} | ||
|
||
@test failure callback is not called on success { | ||
echo passed | ||
} | ||
|
||
@test failure callback can be overriden locally { | ||
bats::on_failure() { | ||
echo "override failure callback" | ||
} | ||
false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
bats::on_failure() { | ||
echo "failure callback" | ||
} | ||
|
||
setup_file() { | ||
false | ||
} | ||
|
||
@test dummy { | ||
true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@test dummy { | ||
true | ||
} |
7 changes: 7 additions & 0 deletions
7
test/fixtures/bats/failure_callback_setup_suite/setup_suite.bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
bats::on_failure() { | ||
echo "failure callback" | ||
} | ||
|
||
setup_suite() { | ||
false | ||
} |