Skip to content

Commit

Permalink
Remove fail() (moved to bats-support)
Browse files Browse the repository at this point in the history
  • Loading branch information
ztombol committed Mar 22, 2016
1 parent 71e43a4 commit 9175656
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 64 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).


## [Unreleased]

### Removed

- Move `fail()` to `bats-support`


## [0.2.0] - 2016-03-11

### Added
Expand All @@ -28,4 +35,5 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Testing individual lines with `assert_line()` and `refute_line()`


[Unreleased]: https://github.com/ztombol/bats-assert/compare/v0.2.0...HEAD
[0.2.0]: https://github.com/ztombol/bats-assert/compare/v0.1.0...v0.2.0
28 changes: 0 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,34 +26,6 @@ load this library.

## Usage

### `fail`

Display an error message and fail. This function provides a convenient
way to report failure in arbitrary situations. You can use it to
implement your own helpers when the ones available do not meet your
needs. Other functions use it internally as well.

```bash
@test 'fail()' {
fail 'this test always fails'
}
```

The message can also be specified on the standard input.

```bash
@test 'fail() with pipe' {
echo 'this test always fails' | fail
}
```

This function always fails and simply outputs the given message.

```
this test always fails
```


### `assert`

Fail if the given expression evaluates to false.
Expand Down
19 changes: 0 additions & 19 deletions src/assert.bash
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,6 @@
# ASSERTIONS
########################################################################

# Fail and display a message. When no parameters are specified, the
# message is read from the standard input. Other functions use this to
# report failure.
#
# Globals:
# none
# Arguments:
# $@ - [=STDIN] message
# Returns:
# 1 - always
# Inputs:
# STDIN - [=$@] message
# Outputs:
# STDERR - message
fail() {
(( $# == 0 )) && batslib_err || batslib_err "$@"
return 1
}

# Fail and display the expression if it evaluates to false.
#
# NOTE: The expression must be a simple command. Compound commands, such
Expand Down
17 changes: 0 additions & 17 deletions test/50-assert-10-fail.bats

This file was deleted.

0 comments on commit 9175656

Please sign in to comment.