busser-bats 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 18630d2d9565f35fc8ff4775d029ad7f673f2b27
4
- data.tar.gz: 595d8d03ac3def1fb0bb04a2d3da5a6552aac118
3
+ metadata.gz: 2c613c540bc4ab8518fd66d06d7fce1080b5a252
4
+ data.tar.gz: 6ecfe900ccff1587a141dbad3828f2c1a3a85930
5
5
  SHA512:
6
- metadata.gz: 63d6b127a618ea52cb66ec622460f81de14f7f22381049e5ac9ef0b79cf23d7f10bde35e501d2d77f61de211a09b134d4c489c11eb7738a882e44271773bd68c
7
- data.tar.gz: 94435202e166dae20daafaefcb08552fb74f324d017eb323b6ed0bc5d724c1c80a2a5da5de6814bba19ab24555ab233bf17cb8683f637446a830a31859029e9f
6
+ metadata.gz: 2d3ac5d61c193e198fdc9369107202b194d1ff36e7a2cb25cd50b36c6f9a60b1a0a9f72f74e29ecc7fed417b9ef53a83d2256f349847b1e0c98c4a66c0b65421
7
+ data.tar.gz: 035d76978a2ad3cc1172eb4a0c0bb6b6819a9c95f62d66259fe20f2ff364ed2ec189dbac26ba0179ce86d72639ab3f05a9e5cbe31c5bc4199d942a695f06d235
@@ -0,0 +1,3 @@
1
+ Style/ClassAndModuleChildren:
2
+ Exclude:
3
+ - lib/busser/runner_plugin/bats.rb
@@ -0,0 +1,10 @@
1
+ SimpleCov.profiles.define 'gem' do
2
+ command_name 'Specs'
3
+
4
+ add_filter '.gem/'
5
+ add_filter '/spec/'
6
+ add_filter '/lib/vendor/'
7
+
8
+ add_group 'Libraries', '/lib/'
9
+ end
10
+ SimpleCov.start 'gem'
@@ -1,11 +1,34 @@
1
1
  language: ruby
2
2
 
3
3
  rvm:
4
- - 2.0.0
5
- - 1.9.3
6
- - 1.9.2
7
- - ruby-head
4
+ - 2.1
5
+ - 2.0.0
6
+ - 1.9.3
7
+ - ruby-head
8
+
9
+ env:
10
+ - RUBYGEMS_VERSION=
11
+ - RUBYGEMS_VERSION=2.2.2
12
+ - RUBYGEMS_VERSION=2.1.11
13
+ - RUBYGEMS_VERSION=2.0.14
14
+ - RUBYGEMS_VERSION=1.8.29
15
+
16
+ bundler_args: --without guard
17
+
18
+ before_install:
19
+ - if [ -n "$RUBYGEMS_VERSION" ]; then gem update --system $RUBYGEMS_VERSION; fi
20
+ - gem --version
8
21
 
9
22
  matrix:
23
+ exclude:
24
+ - rvm: 2.1
25
+ env: RUBYGEMS_VERSION=1.8.29
26
+ - rvm: 2.0.0
27
+ env: RUBYGEMS_VERSION=1.8.29
28
+ - rvm: ruby-head
29
+ env: RUBYGEMS_VERSION=1.8.29
10
30
  allow_failures:
11
- - rvm: ruby-head
31
+ - rvm: ruby-head
32
+
33
+ notifications:
34
+ irc: "chat.freenode.net#kitchenci"
@@ -1,3 +1,15 @@
1
+ ## 0.3.0 / 2014-10-14
2
+
3
+ ### New features
4
+
5
+ * Upgrade vendored bats version to 0.4.0. ([@fnichol][])
6
+
7
+ ### Improvments
8
+
9
+ * Update testing dependencies, upgrade to RSpec 3.x, freshen TravisCI build matrix, add style and complexity support. ([@fnichol][])
10
+ * Allow Aruba tests to wait 20 seconds (vs. 10). ([@fnichol][])
11
+
12
+
1
13
  ## 0.2.0 / 2014-03-23
2
14
 
3
15
  ### Improvements
@@ -10,4 +22,4 @@
10
22
  * Initial release
11
23
 
12
24
  <!--- The following link definition list is generated by PimpMyChangelog --->
13
- [@fnichol]: https://github.com/fnichol
25
+ [@fnichol]: https://github.com/fnichol
data/Gemfile CHANGED
@@ -1,3 +1,10 @@
1
- source 'https://rubygems.org'
1
+ # -*- encoding: utf-8 -*-
2
+ source "https://rubygems.org"
2
3
 
3
4
  gemspec
5
+
6
+ group :guard do
7
+ gem "guard-cucumber"
8
+ gem "guard-cane"
9
+ gem "guard-rubocop"
10
+ end
@@ -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,13 +1,15 @@
1
1
  # <a name="title"></a> 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)
6
+ [![Dependency Status](https://gemnasium.com/test-kitchen/busser-bats.svg)](https://gemnasium.com/test-kitchen/busser-bats)
5
7
 
6
8
  A Busser runner plugin for [Bats][bats_site]
7
9
 
8
10
  ## <a name="installation"></a> Installation and Setup
9
11
 
10
- Please read the Busser [plugin usage][plugin_usage] page for more details.
12
+ 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.
11
13
 
12
14
  ## <a name="usage"></a> Usage
13
15
 
data/Rakefile CHANGED
@@ -1,12 +1,11 @@
1
+ # -*- encoding: utf-8 -*-
2
+
1
3
  require "bundler/gem_tasks"
2
- require 'cucumber/rake/task'
3
- require 'cane/rake_task'
4
- require 'open-uri'
5
- require 'tailor/rake_task'
4
+ require "open-uri"
6
5
 
7
6
  namespace :bats do
8
7
 
9
- version = ENV.fetch("BATS_VERSION", "v0.3.1")
8
+ version = ENV.fetch("BATS_VERSION", "v0.4.0")
10
9
  url = "https://github.com/sstephenson/bats/archive/#{version}.tar.gz"
11
10
  tarball = "tmp/bats-#{version}.tar.gz"
12
11
  vendor = "vendor/bats"
@@ -41,20 +40,26 @@ namespace :bats do
41
40
  end
42
41
  end
43
42
 
43
+ require "cucumber/rake/task"
44
44
  Cucumber::Rake::Task.new(:features) do |t|
45
- t.cucumber_opts = ['features', '-x', '--format progress']
45
+ t.cucumber_opts = ["features", "-x", "--format progress"]
46
46
  end
47
47
 
48
48
  desc "Run all test suites"
49
49
  task :test => [:features]
50
50
 
51
+ require "finstyle"
52
+ require "rubocop/rake_task"
53
+ RuboCop::RakeTask.new(:style) do |task|
54
+ task.options << "--display-cop-names"
55
+ end
56
+
57
+ require "cane/rake_task"
51
58
  desc "Run cane to check quality metrics"
52
59
  Cane::RakeTask.new do |cane|
53
- cane.canefile = './.cane'
60
+ cane.canefile = "./.cane"
54
61
  end
55
62
 
56
- Tailor::RakeTask.new
57
-
58
63
  desc "Display LOC stats"
59
64
  task :stats do
60
65
  puts "\n## Production Code Stats"
@@ -64,6 +69,6 @@ task :stats do
64
69
  end
65
70
 
66
71
  desc "Run all quality tasks"
67
- task :quality => [:cane, :tailor, :stats]
72
+ task :quality => [:cane, :style, :stats]
68
73
 
69
74
  task :default => [:test, :quality]
@@ -1,30 +1,35 @@
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
+ gem.add_dependency "busser"
22
23
 
23
- spec.add_development_dependency 'bundler', '~> 1.3'
24
- spec.add_development_dependency 'rake'
25
- spec.add_development_dependency 'aruba'
24
+ gem.add_development_dependency "aruba"
25
+ gem.add_development_dependency "bundler", "~> 1.3"
26
+ gem.add_development_dependency "countloc"
27
+ gem.add_development_dependency "rake"
28
+ gem.add_development_dependency "simplecov"
26
29
 
27
- spec.add_development_dependency 'cane'
28
- spec.add_development_dependency 'tailor'
29
- spec.add_development_dependency 'countloc'
30
+ # style and complexity libraries are tightly version pinned as newer releases
31
+ # may introduce new and undesireable style choices which would be immediately
32
+ # enforced in CI
33
+ gem.add_development_dependency "finstyle", "1.2.0"
34
+ gem.add_development_dependency "cane", "2.6.2"
30
35
  end
@@ -1,8 +1,15 @@
1
- require 'aruba/cucumber'
2
- require 'busser/cucumber'
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ require "aruba/cucumber"
4
+ require "busser/cucumber"
5
+
6
+ if ENV["COVERAGE"]
7
+ require "simplecov"
8
+ SimpleCov.command_name "features"
9
+ end
3
10
 
4
11
  Before do
5
- @aruba_timeout_seconds = 10
12
+ @aruba_timeout_seconds = 20
6
13
  end
7
14
 
8
15
  After do |s|
@@ -21,6 +21,6 @@ module Busser
21
21
  module Bats
22
22
 
23
23
  # Version string for the Bats Busser runner plugin
24
- VERSION = "0.2.0"
24
+ VERSION = "0.3.0"
25
25
  end
26
26
  end
@@ -16,9 +16,9 @@
16
16
  # See the License for the specific language governing permissions and
17
17
  # limitations under the License.
18
18
 
19
- require 'pathname'
19
+ require "pathname"
20
20
 
21
- require 'busser/runner_plugin'
21
+ require "busser/runner_plugin"
22
22
 
23
23
  # A Busser runner plugin for Bats.
24
24
  #
@@ -34,6 +34,6 @@ class Busser::RunnerPlugin::Bats < Busser::RunnerPlugin::Base
34
34
  end
35
35
 
36
36
  def test
37
- run!("#{vendor_path('bats').join("bin/bats")} #{suite_path('bats')}")
37
+ run!("#{vendor_path("bats").join("bin/bats")} #{suite_path("bats")}")
38
38
  end
39
39
  end
@@ -0,0 +1,5 @@
1
+ language: c
2
+ script: bin/bats --tap test
3
+ notifications:
4
+ email:
5
+ on_success: never
@@ -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.