busser-minitest 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6219bf2929f13aae93a8a8f2fa7b3f92edfe13e5
4
+ data.tar.gz: 03d114f5d7e0319985fd0261cf1549613b429ca6
5
+ SHA512:
6
+ metadata.gz: d611cde94fd65055b5c104739aecced8e00b4588537dbc5b1b7ae1a9580d10fa5cd4e48d05078069ff4d8c1fad414d6c592a344834ecd7346ab19a6c20d1601d
7
+ data.tar.gz: 6bf92f79d5718777a2e8088038374ce10899014a6770eca581ae96b15e735dc3d65989373446e9fefbb90ccd8af0fb90cd8f26842b81678caf13c50fb8392dd6
@@ -0,0 +1,3 @@
1
+ Style/ClassAndModuleChildren:
2
+ Exclude:
3
+ - lib/busser/runner_plugin/minitest.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,16 @@
1
+ ## 0.3.0 / 2014-10-11
2
+
3
+ ### New features
4
+
5
+ * Support a Gemfile to pull in dependencies. ([@fnichol][])
6
+
7
+
8
+ ### Improvements
9
+
10
+ * Update testing dependencies, freshen TravisCI build matrix, add style and complexity support. ([@fnichol][])
11
+ * Allow Aruba tests to wait 45 seconds (vs. 30). ([@fnichol][])
12
+
13
+
1
14
  ## 0.2.0 / 2013-05-13
2
15
 
3
16
  ### Bug fixes
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,7 +1,9 @@
1
1
  # <a name="title"></a> Busser::RunnerPlugin::Minitest
2
2
 
3
- [![Build Status](https://travis-ci.org/fnichol/busser-minitest.png?branch=master)](https://travis-ci.org/fnichol/busser-minitest)
4
- [![Code Climate](https://codeclimate.com/github/fnichol/busser-minitest.png)](https://codeclimate.com/github/fnichol/busser-minitest)
3
+ [![Gem Version](https://badge.fury.io/rb/busser-minitest.png)](http://badge.fury.io/rb/busser-minitest)
4
+ [![Build Status](https://travis-ci.org/test-kitchen/busser-minitest.png?branch=master)](https://travis-ci.org/test-kitchen/busser-minitest)
5
+ [![Code Climate](https://codeclimate.com/github/test-kitchen/busser-minitest.png)](https://codeclimate.com/github/test-kitchen/busser-minitest)
6
+ [![Dependency Status](https://gemnasium.com/test-kitchen/busser-minitest.svg)](https://gemnasium.com/test-kitchen/busser-minitest)
5
7
 
6
8
  A Busser runner plugin for the [minitest][minitest_site] testing library
7
9
 
@@ -10,8 +12,71 @@ A Busser runner plugin for the [minitest][minitest_site] testing library
10
12
  Please read the Busser [plugin usage][plugin_usage] page for more details.
11
13
 
12
14
  ## <a name="usage"></a> Usage
13
-
14
- **TODO:** Write documentation explaining the structure/format of testing files.
15
+ Assume a cookwith with the following structure (some directories omitted for
16
+ brevity). This also assumes that your .kitchen.yml has been written with a
17
+ suite per recipe.
18
+
19
+ ```
20
+ .
21
+ ├── Berksfile
22
+ ├── Berksfile.lock
23
+ ├── CHANGELOG.md
24
+ ├── README.md
25
+ ├── Thorfile
26
+ ├── attributes
27
+ │   └── default.rb
28
+ ├── chefignore
29
+ ├── definitions
30
+ ├── files
31
+ │   └── default
32
+ │   ├── bar.txt
33
+ │   ├── foo.txt
34
+ │   └── foobar.txt
35
+ ├── libraries
36
+ ├── metadata.rb
37
+ ├── providers
38
+ ├── recipes
39
+ │   ├── bar.rb
40
+ │   ├── default.rb
41
+ │   └── foo.rb
42
+ ├── resources
43
+ ├── templates
44
+ │   └── default
45
+ ```
46
+
47
+ The test directory follows a similar structure to the recipes directory. In the integration directory,
48
+ there should be a directory for each recipe, which contains a directory for each busser being used. In
49
+ this example, we're only using minitest. Finally, the actual test files themselves live inside the busser
50
+ directory. The test files must be named either test_*.rb or *_spec.rb in order to be parsed.
51
+
52
+ ```
53
+ └── test
54
+ └── integration
55
+ ├── bar
56
+ │   └── minitest
57
+ │   └── test_bar.rb
58
+ ├── default
59
+ │   └── minitest
60
+ │   └── test_default.rb
61
+ └── foo
62
+ └── minitest
63
+ └── test_foo.rb
64
+ ```
65
+
66
+ The test files use standard minitest assertions, constructs etc. As an example, the test_default.rb file
67
+ listed above might have the following content to check for the existance of a particulare file.
68
+
69
+
70
+ ```
71
+ require 'minitest/autorun'
72
+
73
+ describe "foobar::default" do
74
+
75
+ it "has created foobar.txt" do
76
+ assert File.exists?("/usr/local/foobar.txt")
77
+ end
78
+ end
79
+ ```
15
80
 
16
81
  ## <a name="development"></a> Development
17
82
 
data/Rakefile CHANGED
@@ -1,22 +1,27 @@
1
+ # -*- encoding: utf-8 -*-
2
+
1
3
  require "bundler/gem_tasks"
2
- require 'cucumber/rake/task'
3
- require 'cane/rake_task'
4
- require 'tailor/rake_task'
5
4
 
5
+ require "cucumber/rake/task"
6
6
  Cucumber::Rake::Task.new(:features) do |t|
7
- t.cucumber_opts = ['features', '-x', '--format progress']
7
+ t.cucumber_opts = ["features", "-x", "--format progress"]
8
8
  end
9
9
 
10
10
  desc "Run all test suites"
11
11
  task :test => [:features]
12
12
 
13
+ require "finstyle"
14
+ require "rubocop/rake_task"
15
+ RuboCop::RakeTask.new(:style) do |task|
16
+ task.options << "--display-cop-names"
17
+ end
18
+
19
+ require "cane/rake_task"
13
20
  desc "Run cane to check quality metrics"
14
21
  Cane::RakeTask.new do |cane|
15
- cane.canefile = './.cane'
22
+ cane.canefile = "./.cane"
16
23
  end
17
24
 
18
- Tailor::RakeTask.new
19
-
20
25
  desc "Display LOC stats"
21
26
  task :stats do
22
27
  puts "\n## Production Code Stats"
@@ -26,6 +31,6 @@ task :stats do
26
31
  end
27
32
 
28
33
  desc "Run all quality tasks"
29
- task :quality => [:cane, :tailor, :stats]
34
+ task :quality => [:cane, :style, :stats]
30
35
 
31
36
  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/minitest/version'
4
+ require "busser/minitest/version"
5
+ require "English"
5
6
 
6
- Gem::Specification.new do |spec|
7
- spec.name = 'busser-minitest'
8
- spec.version = Busser::Minitest::VERSION
9
- spec.authors = ['Fletcher Nichol']
10
- spec.email = ['fnichol@nichol.ca']
11
- spec.description = %q{A Busser runner plugin for the minitest testing library}
12
- spec.summary = spec.description
13
- spec.homepage = 'https://github.com/fnichol/busser-minitest'
14
- spec.license = 'Apache 2.0'
7
+ Gem::Specification.new do |gem|
8
+ gem.name = "busser-minitest"
9
+ gem.version = Busser::Minitest::VERSION
10
+ gem.authors = ["Fletcher Nichol"]
11
+ gem.email = ["fnichol@nichol.ca"]
12
+ gem.description = "A Busser runner plugin for the minitest testing library"
13
+ gem.summary = gem.description
14
+ gem.homepage = "https://github.com/fnichol/busser-minitest"
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 = 20
12
+ @aruba_timeout_seconds = 45
6
13
  end
7
14
 
8
15
  After do |s|
@@ -17,9 +17,11 @@
17
17
  # See the License for the specific language governing permissions and
18
18
  # limitations under the License.
19
19
 
20
- require 'rake/testtask'
20
+ require "rake/testtask"
21
21
 
22
- abort "usage: #{File.basename($0)} <test_base_path>" if ARGV.first.nil?
22
+ if ARGV.first.nil?
23
+ abort "usage: #{File.basename($PROGRAM_NAME)} <test_base_path>"
24
+ end
23
25
 
24
26
  base_path = File.expand_path(ARGV.shift)
25
27
  test_files = ["#{base_path}/**/*_spec.rb", "#{base_path}/**/test_*.rb"]
@@ -21,6 +21,6 @@ module Busser
21
21
  module Minitest
22
22
 
23
23
  # Version string for the Minitest Busser runner plugin
24
- VERSION = "0.2.0"
24
+ VERSION = "0.3.0"
25
25
  end
26
26
  end
@@ -16,7 +16,7 @@
16
16
  # See the License for the specific language governing permissions and
17
17
  # limitations under the License.
18
18
 
19
- require 'busser/runner_plugin'
19
+ require "busser/runner_plugin"
20
20
 
21
21
  # A Busser runner plugin for Minitest.
22
22
  #
@@ -26,11 +26,26 @@ class Busser::RunnerPlugin::Minitest < Busser::RunnerPlugin::Base
26
26
 
27
27
  postinstall do
28
28
  install_gem("minitest", "< 5.0")
29
+ install_gem("bundler")
29
30
  end
30
31
 
31
32
  def test
32
- runner = File.join(File.dirname(__FILE__), %w{.. minitest runner.rb})
33
+ minitest_path = suite_path("minitest")
34
+ runner = File.join(File.dirname(__FILE__), %w[.. minitest runner.rb])
33
35
 
34
- run_ruby_script!("#{runner} #{suite_path('minitest').to_s}")
36
+ if File.exist?(File.join(minitest_path, "Gemfile"))
37
+ banner("Gemfile found, bundle installing...")
38
+
39
+ # Bundle install local completes quickly if the gems are already found
40
+ # locally it fails if it needs to talk to the internet. The || below is
41
+ # the fallback to the internet-enabled version. It's a speed
42
+ # optimization.
43
+ Dir.chdir(minitest_path) do
44
+ run("PATH=#{ENV["PATH"]}:#{Gem.bindir}; " \
45
+ "bundle install --local || bundle install")
46
+ end
47
+ end
48
+
49
+ run_ruby_script!("#{runner} #{minitest_path}")
35
50
  end
36
51
  end
metadata CHANGED
@@ -1,128 +1,127 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: busser-minitest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
5
- prerelease:
4
+ version: 0.3.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Fletcher Nichol
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-05-14 00:00:00.000000000 Z
11
+ date: 2014-10-11 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: busser
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: aruba
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
28
39
  - !ruby/object:Gem::Version
29
40
  version: '0'
30
41
  - !ruby/object:Gem::Dependency
31
42
  name: bundler
32
43
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
44
  requirements:
35
- - - ~>
45
+ - - "~>"
36
46
  - !ruby/object:Gem::Version
37
47
  version: '1.3'
38
48
  type: :development
39
49
  prerelease: false
40
50
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
51
  requirements:
43
- - - ~>
52
+ - - "~>"
44
53
  - !ruby/object:Gem::Version
45
54
  version: '1.3'
46
55
  - !ruby/object:Gem::Dependency
47
- name: rake
56
+ name: countloc
48
57
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
58
  requirements:
51
- - - ! '>='
59
+ - - ">="
52
60
  - !ruby/object:Gem::Version
53
61
  version: '0'
54
62
  type: :development
55
63
  prerelease: false
56
64
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
65
  requirements:
59
- - - ! '>='
66
+ - - ">="
60
67
  - !ruby/object:Gem::Version
61
68
  version: '0'
62
69
  - !ruby/object:Gem::Dependency
63
- name: aruba
70
+ name: rake
64
71
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
72
  requirements:
67
- - - ! '>='
73
+ - - ">="
68
74
  - !ruby/object:Gem::Version
69
75
  version: '0'
70
76
  type: :development
71
77
  prerelease: false
72
78
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
79
  requirements:
75
- - - ! '>='
80
+ - - ">="
76
81
  - !ruby/object:Gem::Version
77
82
  version: '0'
78
83
  - !ruby/object:Gem::Dependency
79
- name: cane
84
+ name: simplecov
80
85
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
86
  requirements:
83
- - - ! '>='
87
+ - - ">="
84
88
  - !ruby/object:Gem::Version
85
89
  version: '0'
86
90
  type: :development
87
91
  prerelease: false
88
92
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
93
  requirements:
91
- - - ! '>='
94
+ - - ">="
92
95
  - !ruby/object:Gem::Version
93
96
  version: '0'
94
97
  - !ruby/object:Gem::Dependency
95
- name: tailor
98
+ name: finstyle
96
99
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
100
  requirements:
99
- - - ! '>='
101
+ - - '='
100
102
  - !ruby/object:Gem::Version
101
- version: '0'
103
+ version: 1.2.0
102
104
  type: :development
103
105
  prerelease: false
104
106
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
107
  requirements:
107
- - - ! '>='
108
+ - - '='
108
109
  - !ruby/object:Gem::Version
109
- version: '0'
110
+ version: 1.2.0
110
111
  - !ruby/object:Gem::Dependency
111
- name: countloc
112
+ name: cane
112
113
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
114
  requirements:
115
- - - ! '>='
115
+ - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: '0'
117
+ version: 2.6.2
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
121
  requirements:
123
- - - ! '>='
122
+ - - '='
124
123
  - !ruby/object:Gem::Version
125
- version: '0'
124
+ version: 2.6.2
126
125
  description: A Busser runner plugin for the minitest testing library
127
126
  email:
128
127
  - fnichol@nichol.ca
@@ -130,12 +129,14 @@ executables: []
130
129
  extensions: []
131
130
  extra_rdoc_files: []
132
131
  files:
133
- - .cane
134
- - .gitignore
135
- - .tailor
136
- - .travis.yml
132
+ - ".cane"
133
+ - ".gitignore"
134
+ - ".rubocop.yml"
135
+ - ".simplecov"
136
+ - ".travis.yml"
137
137
  - CHANGELOG.md
138
138
  - Gemfile
139
+ - Guardfile
139
140
  - LICENSE
140
141
  - README.md
141
142
  - Rakefile
@@ -150,33 +151,26 @@ files:
150
151
  homepage: https://github.com/fnichol/busser-minitest
151
152
  licenses:
152
153
  - Apache 2.0
154
+ metadata: {}
153
155
  post_install_message:
154
156
  rdoc_options: []
155
157
  require_paths:
156
158
  - lib
157
159
  required_ruby_version: !ruby/object:Gem::Requirement
158
- none: false
159
160
  requirements:
160
- - - ! '>='
161
+ - - ">="
161
162
  - !ruby/object:Gem::Version
162
163
  version: '0'
163
- segments:
164
- - 0
165
- hash: -2102569719594849840
166
164
  required_rubygems_version: !ruby/object:Gem::Requirement
167
- none: false
168
165
  requirements:
169
- - - ! '>='
166
+ - - ">="
170
167
  - !ruby/object:Gem::Version
171
168
  version: '0'
172
- segments:
173
- - 0
174
- hash: -2102569719594849840
175
169
  requirements: []
176
170
  rubyforge_project:
177
- rubygems_version: 1.8.24
171
+ rubygems_version: 2.2.2
178
172
  signing_key:
179
- specification_version: 3
173
+ specification_version: 4
180
174
  summary: A Busser runner plugin for the minitest testing library
181
175
  test_files:
182
176
  - features/plugin_install_command.feature
data/.tailor DELETED
@@ -1,4 +0,0 @@
1
- Tailor.config do |config|
2
- config.formatters "text"
3
- config.file_set 'lib/**/*.rb'
4
- end