Sha256: 0bb62fd9b870fd35e5614971a20af0b37a69bcec5a8294f8a0ef99cf84b56a5b

Contents?: true

Size: 1.62 KB

Versions: 268

Compression:

Stored size: 1.62 KB

Contents

Test::More
==========

TAP Testing for Bash

<badge travis ingydotnet/test-more-bash>

= Synopsis

Write a test file like this. Maybe call it `test/test.t`:

  #!/usr/bin/env bash

  TEST_MORE_PATH="/path/to/test-more-bash"
  BASHLIB="`
      find $TEST_MORE_PATH -type d |
      grep -E '/(bin|lib)$' |
      xargs -n1 printf "%s:"`"
  PATH="$BASHLIB$PATH"

  source bash+ :std

  use Test::More

  plan tests 8

  some-command
  ok $? 'some-command is ok'

  # or:
  ok "`some-command`" 'some-command is ok'

  pass 'This will always pass'

  fail 'This will always fail'

  is `echo foo` 'foo' 'foo is foo'

  isnt foo bar "foo isn't bar"

  like food foo 'food is like foo'

  unlike team I "There's no 'I' in 'team'"

  diag "A message for stderr"

  note "A message for stdout"

Run the test with `prove` like this:

  prove test/test.t

Prove knows it's Bash from the first line (the hashbang), and it just works.

= Description

Test::More is the tried and true testing library for Perl. It uses TAP (the
Test Anything Protocol). This is the same thing for Bash.  For the most part it
should work exactly the same.

= Methods

This is the basic usage:

* `plan tests $count`
* `ok $status_code "$label"`
* `pass "$label"`
* `fail "$label"`
* `is "$got" "$want" "label"`
* `isnt "$got" "$unwanted" "$label"`
* `like "$got" "$regex" "$label"`
* `unlike "$got" "$regex" "$label"`
* `diag "$message"`
* `note "$message"`
* `done_testing $count`
* `plan skip_all "$reason"`
* `BAIL_OUT "$reason"`

More detailed info coming soon.

= Author

Ingy döt Net <ingy@bpan.org>

= Copyright & License

Copyright 2013-2016. Ingy döt Net.

The MIT License (MIT)

Version data entries

268 entries across 268 versions & 4 rubygems

Version Path
eac_tools-0.86.5 sub/eac_git/vendor/git-subrepo/ext/test-more-bash/doc/test-more.swim
eac_tools-0.86.4 sub/eac_git/vendor/git-subrepo/ext/test-more-bash/doc/test-more.swim
eac_tools-0.86.3 sub/eac_git/vendor/git-subrepo/ext/test-more-bash/doc/test-more.swim
eac_git-0.16.0 vendor/git-subrepo/ext/test-more-bash/doc/test-more.swim
eac_tools-0.86.2 sub/eac_git/vendor/git-subrepo/ext/test-more-bash/doc/test-more.swim
eac_git-0.15.0 vendor/git-subrepo/ext/test-more-bash/doc/test-more.swim
eac_tools-0.84.2 sub/eac_git/vendor/git-subrepo/ext/test-more-bash/doc/test-more.swim
eac_tools-0.84.1 sub/eac_git/vendor/git-subrepo/ext/test-more-bash/doc/test-more.swim
eac_tools-0.84.0 sub/eac_git/vendor/git-subrepo/ext/test-more-bash/doc/test-more.swim
eac_tools-0.83.0 sub/eac_git/vendor/git-subrepo/ext/test-more-bash/doc/test-more.swim
eac_tools-0.82.0 sub/eac_git/vendor/git-subrepo/ext/test-more-bash/doc/test-more.swim
eac_tools-0.81.0 sub/eac_git/vendor/git-subrepo/ext/test-more-bash/doc/test-more.swim
eac_tools-0.80.0 sub/eac_git/vendor/git-subrepo/ext/test-more-bash/doc/test-more.swim
eac_tools-0.79.0 sub/eac_git/vendor/git-subrepo/ext/test-more-bash/doc/test-more.swim
eac_tools-0.78.0 sub/eac_git/vendor/git-subrepo/ext/test-more-bash/doc/test-more.swim
eac_tools-0.77.1 sub/eac_git/vendor/git-subrepo/ext/test-more-bash/doc/test-more.swim
eac_tools-0.77.0 sub/eac_git/vendor/git-subrepo/ext/test-more-bash/doc/test-more.swim
eac_tools-0.76.1 sub/eac_git/vendor/git-subrepo/ext/test-more-bash/doc/test-more.swim
eac_tools-0.76.0 sub/eac_git/vendor/git-subrepo/ext/test-more-bash/doc/test-more.swim
eac_tools-0.75.2 sub/eac_git/vendor/git-subrepo/ext/test-more-bash/doc/test-more.swim