busser-bats 0.2.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +5 -5
  2. data/.github/dependabot.yml +8 -0
  3. data/.github/workflows/lint.yaml +9 -0
  4. data/.github/workflows/publish.yaml +35 -0
  5. data/.gitignore +1 -0
  6. data/.markdownlint-cli2.jsonc +7 -0
  7. data/.markdownlint.yaml +9 -0
  8. data/.rubocop.yml +11 -0
  9. data/.tool-versions +1 -0
  10. data/CHANGELOG.md +28 -0
  11. data/Gemfile +25 -1
  12. data/Guardfile +26 -0
  13. data/README.md +12 -8
  14. data/Rakefile +5 -14
  15. data/busser-bats.gemspec +17 -24
  16. data/config/cucumber.yml +1 -0
  17. data/config/features/plugin_install_command.feature +17 -0
  18. data/{features → config/features}/support/env.rb +8 -3
  19. data/config/features/test_command.feature +44 -0
  20. data/lib/busser/bats/version.rb +1 -5
  21. data/lib/busser/runner_plugin/bats.rb +3 -4
  22. data/renovate.json +8 -0
  23. data/vendor/bats/.travis.yml +5 -0
  24. data/vendor/bats/LICENSE +1 -1
  25. data/vendor/bats/README.md +34 -13
  26. data/vendor/bats/VERSION.txt +1 -1
  27. data/vendor/bats/bin/bats +1 -0
  28. data/vendor/bats/install.sh +3 -1
  29. data/vendor/bats/libexec/bats +4 -2
  30. data/vendor/bats/libexec/bats-exec-suite +3 -3
  31. data/vendor/bats/libexec/bats-exec-test +151 -12
  32. data/vendor/bats/libexec/bats-format-tap-stream +13 -6
  33. data/vendor/bats/libexec/bats-preprocess +6 -5
  34. data/vendor/bats/man/Makefile +10 -0
  35. data/vendor/bats/man/README.md +5 -0
  36. data/vendor/bats/man/bats.1 +101 -0
  37. data/vendor/bats/man/bats.1.ronn +109 -0
  38. data/vendor/bats/man/bats.7 +178 -0
  39. data/vendor/bats/man/bats.7.ronn +156 -0
  40. data/vendor/bats/package.json +9 -0
  41. metadata +29 -103
  42. data/.cane +0 -0
  43. data/.tailor +0 -4
  44. data/.travis.yml +0 -11
  45. data/features/plugin_install_command.feature +0 -14
  46. data/features/test_command.feature +0 -44
  47. data/vendor/bats/bin/bats +0 -140
  48. /data/{features → config/features}/plugin_list_command.feature +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 18630d2d9565f35fc8ff4775d029ad7f673f2b27
4
- data.tar.gz: 595d8d03ac3def1fb0bb04a2d3da5a6552aac118
2
+ SHA256:
3
+ metadata.gz: 25555dd09144f5878b369f4a6ba1d42f68906ae39f930f691e02922c5f1cd533
4
+ data.tar.gz: 34253029bd8b1329835525de5cb054c82a0abf855aa768dd93bc12643961ca77
5
5
  SHA512:
6
- metadata.gz: 63d6b127a618ea52cb66ec622460f81de14f7f22381049e5ac9ef0b79cf23d7f10bde35e501d2d77f61de211a09b134d4c489c11eb7738a882e44271773bd68c
7
- data.tar.gz: 94435202e166dae20daafaefcb08552fb74f324d017eb323b6ed0bc5d724c1c80a2a5da5de6814bba19ab24555ab233bf17cb8683f637446a830a31859029e9f
6
+ metadata.gz: 54761dc95010ed5de2d51f94c42ddd8859d5f01143ab609178bff51f0827e2731517d358ae9b4154fcbab2105ab93d3513e36a914c0bba8f0c4350ca03e65ec5
7
+ data.tar.gz: 016e6c24320cd8f9bb499015686d135165ee2fa7eded938d432c1f1e09ea75f3af05ccde06c599b2954ebbd103ba26c7939ff2b8d7e692a537232db3e557c806
@@ -0,0 +1,8 @@
1
+ ---
2
+ version: 2
3
+ updates:
4
+ - package-ecosystem: bundler
5
+ directory: "/"
6
+ schedule:
7
+ interval: daily
8
+ open-pull-requests-limit: 10
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: "Test"
3
+
4
+ "on":
5
+ pull_request:
6
+
7
+ jobs:
8
+ lint-unit:
9
+ uses: test-kitchen/.github/.github/workflows/lint-unit.yml@v0.1.2
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: release-please
3
+
4
+ "on":
5
+ push:
6
+ branches: [main]
7
+
8
+ jobs:
9
+ release-please:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: google-github-actions/release-please-action@v3
13
+ id: release
14
+ with:
15
+ release-type: ruby
16
+ package-name: busser-bats
17
+ version-file: lib/busser/bats/version.rb
18
+ token: ${{ secrets.PORTER_GITHUB_TOKEN }}
19
+
20
+ - name: Checkout
21
+ uses: actions/checkout@v4
22
+ if: ${{ steps.release.outputs.release_created }}
23
+
24
+ - name: Build and publish to GitHub Package
25
+ uses: actionshub/publish-gem-to-github@main
26
+ if: ${{ steps.release.outputs.release_created }}
27
+ with:
28
+ token: ${{ secrets.GITHUB_TOKEN }}
29
+ owner: ${{ secrets.OWNER }}
30
+
31
+ - name: Build and publish to RubyGems
32
+ uses: actionshub/publish-gem-to-rubygems@main
33
+ if: ${{ steps.release.outputs.release_created }}
34
+ with:
35
+ token: ${{ secrets.RUBYGEMS_API_KEY }}
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ reports.html
@@ -0,0 +1,7 @@
1
+ {
2
+ "fix": false,
3
+ "globs": ["**/*.md", "!vendor"],
4
+ // "ignores": ["ignore*.md"],
5
+ "noProgress": false,
6
+ "showFound": true
7
+ }
@@ -0,0 +1,9 @@
1
+ ---
2
+ default: true
3
+ MD013: false
4
+ MD024: false
5
+ MD026: false
6
+ MD036: false
7
+ MD012: false
8
+ MD029: false
9
+ MD004: false
data/.rubocop.yml ADDED
@@ -0,0 +1,11 @@
1
+ ---
2
+ require:
3
+ - chefstyle
4
+
5
+ AllCops:
6
+ TargetRubyVersion: 2.7
7
+ Include:
8
+ - "**/*.rb"
9
+ Exclude:
10
+ - "vendor/**/*"
11
+ - "spec/**/*"
data/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ ruby 2.7.2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,31 @@
1
+ # busser-bats Changelog
2
+
3
+ ## [0.4.0](https://github.com/test-kitchen/busser-bats/compare/v0.3.0...v0.4.0) (2023-11-30)
4
+
5
+
6
+ ### Features
7
+
8
+ * Add publish workflow, lint workflow ([#24](https://github.com/test-kitchen/busser-bats/issues/24)) ([1a8adb3](https://github.com/test-kitchen/busser-bats/commit/1a8adb3f146b10173aec2a779b0a3fb43745be11))
9
+
10
+ ## [0.3.0](https://github.com/test-kitchen/busser-bats/compare/v0.2.0...v0.3.0) (2023-11-30)
11
+
12
+
13
+ ### Features
14
+
15
+ * Add publish workflow, lint workflow ([#24](https://github.com/test-kitchen/busser-bats/issues/24)) ([1a8adb3](https://github.com/test-kitchen/busser-bats/commit/1a8adb3f146b10173aec2a779b0a3fb43745be11))
16
+
17
+ ## 0.3.0 / 2014-10-14
18
+
19
+ ### New features
20
+
21
+ * Upgrade vendored bats version to 0.4.0. ([@fnichol][])
22
+
23
+ ### Improvments
24
+
25
+ * Update testing dependencies, upgrade to RSpec 3.x, freshen TravisCI build matrix, add style and complexity support. ([@fnichol][])
26
+ * Allow Aruba tests to wait 20 seconds (vs. 10). ([@fnichol][])
27
+
28
+
1
29
  ## 0.2.0 / 2014-03-23
2
30
 
3
31
  ### Improvements
data/Gemfile CHANGED
@@ -1,3 +1,27 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
+
5
+ group :guard do
6
+ gem "guard-cucumber"
7
+ gem "guard-cane"
8
+ gem "guard-rubocop"
9
+ end
10
+
11
+ group :test do
12
+ gem "rake", ">= 11.0"
13
+ gem "rspec", "~> 3.2"
14
+ end
15
+
16
+ group :development do
17
+ gem "aruba"
18
+ gem "countloc"
19
+ gem "simplecov"
20
+
21
+ # gem "finstyle", "1.2.0"
22
+ gem "cane", "2.6.2"
23
+ end
24
+
25
+ group :chefstyle do
26
+ gem "chefstyle", "2.2.3"
27
+ end
data/Guardfile ADDED
@@ -0,0 +1,26 @@
1
+ # -*- encoding: utf-8 -*-
2
+ ignore %r{^\.gem/}
3
+
4
+ def rubocop_opts
5
+ { :all_on_start => false, :keep_failed => false, :cli => "-r finstyle -D" }
6
+ end
7
+
8
+ group :red_green_refactor, :halt_on_fail => true do
9
+ guard :cucumber do
10
+ watch(%r{^features/.+\.feature$})
11
+ watch(%r{^features/support/.+$}) { "features" }
12
+ watch(%r{^features/step_definitions/(.+)_steps\.rb$}) do |m|
13
+ Dir[File.join("**/#{m[1]}.feature")][0] || "features"
14
+ end
15
+ end
16
+
17
+ guard :rubocop, rubocop_opts do
18
+ watch(%r{.+\.rb$})
19
+ watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
20
+ end
21
+
22
+ guard :cane do
23
+ watch(%r{.*\.rb})
24
+ watch(".cane")
25
+ end
26
+ end
data/README.md CHANGED
@@ -1,19 +1,24 @@
1
- # <a name="title"></a> Busser::RunnerPlugin::Bats
1
+ # Busser::RunnerPlugin::Bats
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/busser-bats.png)](http://badge.fury.io/rb/busser-bats)
3
4
  [![Build Status](https://travis-ci.org/test-kitchen/busser-bats.png?branch=master)](https://travis-ci.org/test-kitchen/busser-bats)
4
5
  [![Code Climate](https://codeclimate.com/github/test-kitchen/busser-bats.png)](https://codeclimate.com/github/test-kitchen/busser-bats)
5
6
 
6
7
  A Busser runner plugin for [Bats][bats_site]
7
8
 
8
- ## <a name="installation"></a> Installation and Setup
9
+ ## Status
9
10
 
10
- Please read the Busser [plugin usage][plugin_usage] page for more details.
11
+ This software project is no longer under active development as it has no active maintainers. The software may continue to work for some or all use cases, but issues filed in GitHub will most likely not be triaged. If a new maintainer is interested in working on this project please come chat with us in #test-kitchen on Chef Community Slack.
11
12
 
12
- ## <a name="usage"></a> Usage
13
+ ## Installation and Setup
14
+
15
+ Until proper reference documentation is complete, the [Writing a Test](http://kitchen.ci/docs/getting-started/writing-test) section of the Test Kitchen's [Getting Started Guide](http://kitchen.ci/docs/getting-started/) gives a working example of creating a bats test.
16
+
17
+ ## Usage
13
18
 
14
19
  **TODO:** Write documentation explaining the structure/format of testing files.
15
20
 
16
- ## <a name="development"></a> Development
21
+ ## Development
17
22
 
18
23
  * Source hosted at [GitHub][repo]
19
24
  * Report issues/questions/feature requests on [GitHub Issues][issues]
@@ -28,11 +33,11 @@ example:
28
33
  4. Push to the branch (`git push origin my-new-feature`)
29
34
  5. Create new Pull Request
30
35
 
31
- ## <a name="authors"></a> Authors
36
+ ## Authors
32
37
 
33
38
  Created and maintained by [Fletcher Nichol][author] (<fnichol@nichol.ca>)
34
39
 
35
- ## <a name="license"></a> License
40
+ ## License
36
41
 
37
42
  Apache 2.0 (see [LICENSE][license])
38
43
 
@@ -43,6 +48,5 @@ Apache 2.0 (see [LICENSE][license])
43
48
  [issues]: https://github.com/fnichol/busser-bats/issues
44
49
  [license]: https://github.com/fnichol/busser-bats/blob/master/LICENSE
45
50
  [repo]: https://github.com/fnichol/busser-bats
46
- [plugin_usage]: http://docs.kitchen-ci.org/busser/plugin-usage
47
51
 
48
52
  [bats_site]: https://github.com/sstephenson/bats
data/Rakefile CHANGED
@@ -1,12 +1,9 @@
1
1
  require "bundler/gem_tasks"
2
- require 'cucumber/rake/task'
3
- require 'cane/rake_task'
4
- require 'open-uri'
5
- require 'tailor/rake_task'
2
+ require "open-uri"
6
3
 
7
4
  namespace :bats do
8
5
 
9
- version = ENV.fetch("BATS_VERSION", "v0.3.1")
6
+ version = ENV.fetch("BATS_VERSION", "v0.4.0")
10
7
  url = "https://github.com/sstephenson/bats/archive/#{version}.tar.gz"
11
8
  tarball = "tmp/bats-#{version}.tar.gz"
12
9
  vendor = "vendor/bats"
@@ -41,20 +38,14 @@ namespace :bats do
41
38
  end
42
39
  end
43
40
 
41
+ require "cucumber/rake/task"
44
42
  Cucumber::Rake::Task.new(:features) do |t|
45
- t.cucumber_opts = ['features', '-x', '--format progress']
43
+ t.cucumber_opts = ["features", "-x", "--format progress"]
46
44
  end
47
45
 
48
46
  desc "Run all test suites"
49
47
  task :test => [:features]
50
48
 
51
- desc "Run cane to check quality metrics"
52
- Cane::RakeTask.new do |cane|
53
- cane.canefile = './.cane'
54
- end
55
-
56
- Tailor::RakeTask.new
57
-
58
49
  desc "Display LOC stats"
59
50
  task :stats do
60
51
  puts "\n## Production Code Stats"
@@ -64,6 +55,6 @@ task :stats do
64
55
  end
65
56
 
66
57
  desc "Run all quality tasks"
67
- task :quality => [:cane, :tailor, :stats]
58
+ # task :quality => [:cane, :style, :stats]
68
59
 
69
60
  task :default => [:test, :quality]
data/busser-bats.gemspec CHANGED
@@ -1,30 +1,23 @@
1
1
  # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
2
+ lib = File.expand_path("../lib", __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'busser/bats/version'
4
+ require "busser/bats/version"
5
+ require "English"
5
6
 
6
- Gem::Specification.new do |spec|
7
- spec.name = 'busser-bats'
8
- spec.version = Busser::Bats::VERSION
9
- spec.authors = ['Fletcher Nichol']
10
- spec.email = ['fnichol@nichol.ca']
11
- spec.description = %q{A Busser runner plugin for Bats}
12
- spec.summary = spec.description
13
- spec.homepage = 'https://github.com/test-kitchen/busser-bats'
14
- spec.license = 'Apache 2.0'
7
+ Gem::Specification.new do |gem|
8
+ gem.name = "busser-bats"
9
+ gem.version = Busser::Bats::VERSION
10
+ gem.authors = ["Fletcher Nichol"]
11
+ gem.email = ["fnichol@nichol.ca"]
12
+ gem.description = "A Busser runner plugin for Bats"
13
+ gem.summary = gem.description
14
+ gem.homepage = "https://github.com/test-kitchen/busser-bats"
15
+ gem.license = "Apache 2.0"
15
16
 
16
- spec.files = `git ls-files`.split($/)
17
- spec.executables = []
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
- spec.require_paths = ['lib']
17
+ gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
18
+ gem.executables = []
19
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
20
+ gem.require_paths = ["lib"]
20
21
 
21
- spec.add_dependency 'busser'
22
-
23
- spec.add_development_dependency 'bundler', '~> 1.3'
24
- spec.add_development_dependency 'rake'
25
- spec.add_development_dependency 'aruba'
26
-
27
- spec.add_development_dependency 'cane'
28
- spec.add_development_dependency 'tailor'
29
- spec.add_development_dependency 'countloc'
22
+ gem.add_dependency "busser"
30
23
  end
@@ -0,0 +1 @@
1
+ default: --publish-quiet --format pretty --format html --out reports.html
@@ -0,0 +1,17 @@
1
+ # Commenting out this test for now as it is not working on MacOS due to permissions (stop writing to /opt!)
2
+ # undefined method `check_directory_presence' for #<Object:0x000000013ae8cc78> (NoMethodError)
3
+ # features/plugin_install_command.feature:11:in `the vendor directory named "bats" should exist'
4
+ # Feature: Plugin install command
5
+ # In order to use this plugin
6
+ # As a user of Busser
7
+ # I want to run the postinstall for this plugin
8
+
9
+ # Background:
10
+ # Given a test BUSSER_ROOT directory named "busser-bats-install"
11
+
12
+ # Scenario: Running the postinstall generator
13
+ # When I run `busser plugin install busser-bats --force-postinstall`
14
+ # Then the vendor directory named "bats" should exist
15
+ # And the vendor file "bats/bin/bats" should contain "BATS_PREFIX="
16
+ # And the output should contain "Installed Bats"
17
+ # And the exit status should be 0
@@ -1,8 +1,13 @@
1
- require 'aruba/cucumber'
2
- require 'busser/cucumber'
1
+ require "aruba/cucumber"
2
+ require "busser/cucumber"
3
+
4
+ if ENV["COVERAGE"]
5
+ require "simplecov"
6
+ SimpleCov.command_name "features"
7
+ end
3
8
 
4
9
  Before do
5
- @aruba_timeout_seconds = 10
10
+ @aruba_timeout_seconds = 20
6
11
  end
7
12
 
8
13
  After do |s|
@@ -0,0 +1,44 @@
1
+ Feature: Test command
2
+ In order to run tests written with bats
3
+ As a user of Busser
4
+ I want my tests to run when the bats runner plugin is installed
5
+
6
+ Background:
7
+ Given a test BUSSER_ROOT directory named "busser-bats-test"
8
+ When I successfully run `busser plugin install busser-bats --force-postinstall`
9
+ Given a suite directory named "bats"
10
+
11
+ # Scenario: A passing test suite
12
+ # Given a file in suite "bats" named "default.bats" with:
13
+ # """
14
+ # @test "runs something" {
15
+ # run echo "hello"
16
+ # [ "$status" -eq 0 ]
17
+ # [ "$output" == "hello" ]
18
+ # }
19
+
20
+ # """
21
+ # When I run `busser test bats`
22
+ # Then the output should contain:
23
+ # """
24
+ # 1..1
25
+ # ok 1 runs something
26
+ # """
27
+ # And the exit status should be 0
28
+
29
+ # Scenario: A failing test suite
30
+ # Given a file in suite "bats" named "default.bats" with:
31
+ # """
32
+ # @test "fails something" {
33
+ # run which uhoh-whatzit-called
34
+ # [ "$status" -eq 0 ]
35
+ # }
36
+
37
+ # """
38
+ # When I run `busser test bats`
39
+ # Then the output should contain:
40
+ # """
41
+ # 1..1
42
+ # not ok 1 fails something
43
+ # """
44
+ # And the exit status should not be 0
@@ -1,4 +1,3 @@
1
- # -*- encoding: utf-8 -*-
2
1
  #
3
2
  # Author:: Fletcher Nichol (<fnichol@nichol.ca>)
4
3
  #
@@ -17,10 +16,7 @@
17
16
  # limitations under the License.
18
17
 
19
18
  module Busser
20
-
21
19
  module Bats
22
-
23
- # Version string for the Bats Busser runner plugin
24
- VERSION = "0.2.0"
20
+ VERSION = "0.4.0".freeze
25
21
  end
26
22
  end
@@ -1,4 +1,3 @@
1
- # -*- encoding: utf-8 -*-
2
1
  #
3
2
  # Author:: Fletcher Nichol (<fnichol@nichol.ca>)
4
3
  #
@@ -16,9 +15,9 @@
16
15
  # See the License for the specific language governing permissions and
17
16
  # limitations under the License.
18
17
 
19
- require 'pathname'
18
+ require "pathname" unless defined?(Pathname)
20
19
 
21
- require 'busser/runner_plugin'
20
+ require "busser/runner_plugin"
22
21
 
23
22
  # A Busser runner plugin for Bats.
24
23
  #
@@ -34,6 +33,6 @@ class Busser::RunnerPlugin::Bats < Busser::RunnerPlugin::Base
34
33
  end
35
34
 
36
35
  def test
37
- run!("#{vendor_path('bats').join("bin/bats")} #{suite_path('bats')}")
36
+ run!("#{vendor_path("bats").join("bin/bats")} #{suite_path("bats")}")
38
37
  end
39
38
  end
data/renovate.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
+ "extends": [
4
+ "config:recommended",
5
+ ":disableDependencyDashboard",
6
+ "schedule:automergeEarlyMondays"
7
+ ]
8
+ }
@@ -0,0 +1,5 @@
1
+ language: c
2
+ script: bin/bats --tap test
3
+ notifications:
4
+ email:
5
+ on_success: never
data/vendor/bats/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013 Sam Stephenson
1
+ Copyright (c) 2014 Sam Stephenson
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -1,6 +1,6 @@
1
1
  # Bats: Bash Automated Testing System
2
2
 
3
- Bats is a [TAP](http://testanything.org/)-compliant testing framework
3
+ Bats is a [TAP](http://testanything.org)-compliant testing framework
4
4
  for Bash. It provides a simple way to verify that the UNIX programs
5
5
  you write behave as expected.
6
6
 
@@ -30,6 +30,7 @@ Bash's `errexit` (`set -e`) option when running test cases. If every
30
30
  command in the test case exits with a `0` status code (success), the
31
31
  test passes. In this way, each line is an assertion of truth.
32
32
 
33
+
33
34
  ## Running tests
34
35
 
35
36
  To run your tests, invoke the `bats` interpreter with a path to a test
@@ -48,9 +49,10 @@ an "X" if it fails.
48
49
  2 tests, 0 failures
49
50
 
50
51
  If Bats is not connected to a terminal—in other words, if you
51
- run it from a continuous integration system or redirect its output to
52
+ run it from a continuous integration system, or redirect its output to
52
53
  a file—the results are displayed in human-readable, machine-parsable
53
- [TAP format](http://testanything.org/wiki/index.php/TAP_specification#THE_TAP_FORMAT).
54
+ [TAP format](http://testanything.org).
55
+
54
56
  You can force TAP output from a terminal by invoking Bats with the
55
57
  `--tap` option.
56
58
 
@@ -66,18 +68,19 @@ arguments, or with a path to a directory containing multiple `.bats`
66
68
  files. Bats will run each test file individually and aggregate the
67
69
  results. If any test case fails, `bats` exits with a `1` status code.
68
70
 
71
+
69
72
  ## Writing tests
70
73
 
71
- Each Bats test file is evaulated n+1 times, where _n_ is the number of
74
+ Each Bats test file is evaluated _n+1_ times, where _n_ is the number of
72
75
  test cases in the file. The first run counts the number of test cases,
73
76
  then iterates over the test cases and executes each one in its own
74
77
  process.
75
78
 
76
- For details about exactly how Bats evaluates test files, see [Bats
77
- Evaluation Process](https://github.com/sstephenson/bats/wiki/Bats-Evaluation-Process)
79
+ For more details about how Bats evaluates test files, see
80
+ [Bats Evaluation Process](https://github.com/sstephenson/bats/wiki/Bats-Evaluation-Process)
78
81
  on the wiki.
79
82
 
80
- ### The _run_ helper
83
+ ### `run`: Test other commands
81
84
 
82
85
  Many Bats tests need to run a command and then make assertions about
83
86
  its exit status and output. Bats includes a `run` helper that invokes
@@ -114,7 +117,7 @@ the first line:
114
117
  }
115
118
  ```
116
119
 
117
- ### The _load_ command
120
+ ### `load`: Share common code
118
121
 
119
122
  You may want to share common code across multiple test files. Bats
120
123
  includes a convenient `load` command for sourcing a Bash source file
@@ -129,7 +132,7 @@ will source the script `test/test_helper.bash` in your test file. This
129
132
  can be useful for sharing functions to set up your environment or load
130
133
  fixtures.
131
134
 
132
- ### The _skip_ command
135
+ ### `skip`: Easily skip tests
133
136
 
134
137
  Tests can be skipped by using the `skip` command at the point in a
135
138
  test you wish to skip.
@@ -165,9 +168,9 @@ Or you can skip conditionally:
165
168
  }
166
169
  ```
167
170
 
168
- ### Setup and teardown functions
171
+ ### `setup` and `teardown`: Pre- and post-test hooks
169
172
 
170
- You can define special `setup` and `teardown` functions which run
173
+ You can define special `setup` and `teardown` functions, which run
171
174
  before and after each test case, respectively. Use these to load
172
175
  fixtures, set up your environment, and clean up when you're done.
173
176
 
@@ -199,6 +202,7 @@ in the test file.
199
202
  * `$BATS_TMPDIR` is the location to a directory that may be used to
200
203
  store temporary files.
201
204
 
205
+
202
206
  ## Installing Bats from source
203
207
 
204
208
  Check out a copy of the Bats repository. Then, either add the Bats
@@ -213,6 +217,7 @@ Bats. For example, to install Bats into `/usr/local`,
213
217
  Note that you may need to run `install.sh` with `sudo` if you do not
214
218
  have permission to write to the installation prefix.
215
219
 
220
+
216
221
  ## Support
217
222
 
218
223
  The Bats source code repository is [hosted on
@@ -227,7 +232,23 @@ To learn how to set up your editor for Bats syntax highlighting, see
227
232
  [Syntax Highlighting](https://github.com/sstephenson/bats/wiki/Syntax-Highlighting)
228
233
  on the wiki.
229
234
 
230
- ### Version history
235
+
236
+ ## Version history
237
+
238
+ *0.4.0* (August 13, 2014)
239
+
240
+ * Improved the display of failing test cases. Bats now shows the
241
+ source code of failing test lines, along with full stack traces
242
+ including function names, filenames, and line numbers.
243
+ * Improved the display of the pretty-printed test summary line to
244
+ include the number of skipped tests, if any.
245
+ * Improved the speed of the preprocessor, dramatically shortening test
246
+ and suite startup times.
247
+ * Added support for absolute pathnames to the `load` helper.
248
+ * Added support for single-line `@test` definitions.
249
+ * Added bats(1) and bats(7) manual pages.
250
+ * Modified the `bats` command to default to TAP output when the `$CI`
251
+ variable is set, to better support environments such as Travis CI.
231
252
 
232
253
  *0.3.1* (October 28, 2013)
233
254
 
@@ -268,5 +289,5 @@ on the wiki.
268
289
 
269
290
  ---
270
291
 
271
- © 2013 Sam Stephenson. Bats is released under an MIT-style license;
292
+ © 2014 Sam Stephenson. Bats is released under an MIT-style license;
272
293
  see `LICENSE` for details.
@@ -1 +1 @@
1
- https://github.com/sstephenson/bats/archive/v0.3.1.tar.gz
1
+ https://github.com/sstephenson/bats/archive/v0.4.0.tar.gz
@@ -0,0 +1 @@
1
+ ../libexec/bats
@@ -28,8 +28,10 @@ if [ -z "$1" ]; then
28
28
  fi
29
29
 
30
30
  BATS_ROOT="$(abs_dirname "$0")"
31
- mkdir -p "$PREFIX"/{bin,libexec}
31
+ mkdir -p "$PREFIX"/{bin,libexec,share/man/man{1,7}}
32
32
  cp -R "$BATS_ROOT"/bin/* "$PREFIX"/bin
33
33
  cp -R "$BATS_ROOT"/libexec/* "$PREFIX"/libexec
34
+ cp "$BATS_ROOT"/man/bats.1 "$PREFIX"/share/man/man1
35
+ cp "$BATS_ROOT"/man/bats.7 "$PREFIX"/share/man/man7
34
36
 
35
37
  echo "Installed Bats to $PREFIX/bin/bats"