busser-minitest 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.cane ADDED
File without changes
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/.tailor ADDED
@@ -0,0 +1,4 @@
1
+ Tailor.config do |config|
2
+ config.formatters "text"
3
+ config.file_set 'lib/**/*.rb'
4
+ end
data/.travis.yml ADDED
@@ -0,0 +1,11 @@
1
+ language: ruby
2
+
3
+ rvm:
4
+ - 2.0.0
5
+ - 1.9.3
6
+ - 1.9.2
7
+ - ruby-head
8
+
9
+ matrix:
10
+ allow_failures:
11
+ - rvm: ruby-head
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ ## 0.1.0 / 2013-04-10
2
+
3
+ * Initial release
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,15 @@
1
+ Author:: Fletcher Nichol (<fnichol@nichol.ca>)
2
+
3
+ Copyright (C) 2013, Fletcher Nichol
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
data/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # <a name="title"></a> Busser::RunnerPlugin::Minitest
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)
5
+
6
+ A Busser runner plugin for the [minitest][minitest_site] testing library
7
+
8
+ ## <a name="installation"></a> Installation and Setup
9
+
10
+ Please read the Busser [plugin usage][plugin_usage] page for more details.
11
+
12
+ ## <a name="usage"></a> Usage
13
+
14
+ **TODO:** Write documentation explaining the structure/format of testing files.
15
+
16
+ ## <a name="development"></a> Development
17
+
18
+ * Source hosted at [GitHub][repo]
19
+ * Report issues/questions/feature requests on [GitHub Issues][issues]
20
+
21
+ Pull requests are very welcome! Make sure your patches are well tested.
22
+ Ideally create a topic branch for every separate change you make. For
23
+ example:
24
+
25
+ 1. Fork the repo
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
30
+
31
+ ## <a name="authors"></a> Authors
32
+
33
+ Created and maintained by [Fletcher Nichol][author] (<fnichol@nichol.ca>)
34
+
35
+ ## <a name="license"></a> License
36
+
37
+ Apache 2.0 (see [LICENSE][license])
38
+
39
+
40
+ [author]: https://github.com/enter-github-user
41
+ [issues]: https://github.com/enter-github-user/busser-minitest/issues
42
+ [license]: https://github.com/enter-github-user/busser-minitest/blob/master/LICENSE
43
+ [repo]: https://github.com/enter-github-user/busser-minitest
44
+ [plugin_usage]: http://docs.kitchen-ci.org/busser/plugin-usage
45
+
46
+ [minitest_site]: https://github.com/seattlerb/minitest
data/Rakefile ADDED
@@ -0,0 +1,31 @@
1
+ require "bundler/gem_tasks"
2
+ require 'cucumber/rake/task'
3
+ require 'cane/rake_task'
4
+ require 'tailor/rake_task'
5
+
6
+ Cucumber::Rake::Task.new(:features) do |t|
7
+ t.cucumber_opts = ['features', '-x', '--format progress']
8
+ end
9
+
10
+ desc "Run all test suites"
11
+ task :test => [:features]
12
+
13
+ desc "Run cane to check quality metrics"
14
+ Cane::RakeTask.new do |cane|
15
+ cane.canefile = './.cane'
16
+ end
17
+
18
+ Tailor::RakeTask.new
19
+
20
+ desc "Display LOC stats"
21
+ task :stats do
22
+ puts "\n## Production Code Stats"
23
+ sh "countloc -r lib"
24
+ puts "\n## Test Code Stats"
25
+ sh "countloc -r features"
26
+ end
27
+
28
+ desc "Run all quality tasks"
29
+ task :quality => [:cane, :tailor, :stats]
30
+
31
+ task :default => [:test, :quality]
@@ -0,0 +1,30 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'busser/minitest/version'
5
+
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'
15
+
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']
20
+
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'
30
+ end
@@ -0,0 +1,13 @@
1
+ Feature: Plugin install command
2
+ In order to use this plugin
3
+ As a user of Busser
4
+ I want to run the postinstall for this plugin
5
+
6
+ Background:
7
+ Given a test BUSSER_ROOT directory named "busser-minitest-install"
8
+ And a sandboxed GEM_HOME directory named "busser-minitest-gem-home"
9
+
10
+ Scenario: Running the postinstall generator
11
+ When I run `busser plugin install busser-minitest --force-postinstall`
12
+ Then a gem named "minitest" is installed
13
+ And the exit status should be 0
@@ -0,0 +1,8 @@
1
+ Feature: Plugin list command
2
+ In order to use this plugin
3
+ As a user of Busser
4
+ I want to see this plugin in the 'busser plugin list' command
5
+
6
+ Scenario: Plugin appears in plugin list command
7
+ When I successfully run `busser plugin list`
8
+ Then the output should match /^minitest\b/
@@ -0,0 +1,13 @@
1
+ require 'aruba/cucumber'
2
+ require 'busser/cucumber'
3
+
4
+ Before do
5
+ @aruba_timeout_seconds = 10
6
+ end
7
+
8
+ After do |s|
9
+ # Tell Cucumber to quit after this scenario is done - if it failed.
10
+ # This is useful to inspect the 'tmp/aruba' directory before any other
11
+ # steps are executed and clear it out.
12
+ Cucumber.wants_to_quit = true if s.failed?
13
+ end
@@ -0,0 +1,66 @@
1
+ Feature: Test command
2
+ In order to run tests written with minitest
3
+ As a user of Busser
4
+ I want my tests to run when the minitest runner plugin is installed
5
+
6
+ Background:
7
+ Given a test BUSSER_ROOT directory named "busser-minitest-test"
8
+ And a sandboxed GEM_HOME directory named "busser-minitest-gem-home"
9
+ When I successfully run `busser plugin install busser-minitest --force-postinstall`
10
+ Given a suite directory named "minitest"
11
+
12
+ Scenario: A passing test suite
13
+ Given a file in suite "minitest" named "test_passing.rb" with:
14
+ """
15
+ require 'minitest/autorun'
16
+
17
+ class TestAllTheThings < MiniTest::Unit::TestCase
18
+ def setup
19
+ @answer = "you know"
20
+ end
21
+
22
+ def test_that_the_answer_is_correct
23
+ assert_equal "you know", @answer
24
+ end
25
+ end
26
+ """
27
+ Given a file in suite "minitest" named "passing_spec.rb" with:
28
+ """
29
+ require 'minitest/autorun'
30
+
31
+ describe 'Winning' do
32
+ before do
33
+ @winning = true
34
+ end
35
+
36
+ it "wins, naturally" do
37
+ @winning.must_equal true
38
+ end
39
+ end
40
+ """
41
+ When I run `busser test minitest`
42
+ Then the output should contain:
43
+ """
44
+ 2 tests, 2 assertions, 0 failures, 0 errors, 0 skips
45
+ """
46
+ And the exit status should be 0
47
+
48
+ Scenario: A failing test suite
49
+ Given a file in suite "minitest" named "failing_spec.rb" with:
50
+ """
51
+ require 'minitest/autorun'
52
+
53
+ Twitter = Struct.new(:online)
54
+
55
+ describe 'Fail whale' do
56
+ let(:twitter) { Twitter.new(false) }
57
+
58
+ it "never goes down" do
59
+ twitter.online.must_equal true
60
+ end
61
+ end
62
+ """
63
+ When I run `busser test minitest`
64
+ Then the output should contain "Expected: true"
65
+ Then the output should contain "Actual: false"
66
+ And the exit status should not be 0
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- encoding: utf-8 -*-
3
+ #
4
+ # Author:: Fletcher Nichol (<fnichol@nichol.ca>)
5
+ #
6
+ # Copyright (C) 2013, Fletcher Nichol
7
+ #
8
+ # Licensed under the Apache License, Version 2.0 (the "License");
9
+ # you may not use this file except in compliance with the License.
10
+ # You may obtain a copy of the License at
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing, software
15
+ # distributed under the License is distributed on an "AS IS" BASIS,
16
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ # See the License for the specific language governing permissions and
18
+ # limitations under the License.
19
+
20
+ require 'rake/testtask'
21
+
22
+ abort "usage: #{File.basename($0)} <test_base_path>" if ARGV.first.nil?
23
+
24
+ base_path = File.expand_path(ARGV.shift)
25
+ test_files = ["#{base_path}/**/*_spec.rb", "#{base_path}/**/test_*.rb"]
26
+
27
+ Rake::TestTask.new(:test) do |t|
28
+ t.libs = []
29
+ t.test_files = FileList[*test_files]
30
+ t.verbose = true
31
+ end
32
+
33
+ Rake::Task["test"].invoke
@@ -0,0 +1,26 @@
1
+ # -*- encoding: utf-8 -*-
2
+ #
3
+ # Author:: Fletcher Nichol (<fnichol@nichol.ca>)
4
+ #
5
+ # Copyright (C) 2013, Fletcher Nichol
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+
19
+ module Busser
20
+
21
+ module Minitest
22
+
23
+ # Version string for the Minitest Busser runner plugin
24
+ VERSION = "0.1.0"
25
+ end
26
+ end
@@ -0,0 +1,36 @@
1
+ # -*- encoding: utf-8 -*-
2
+ #
3
+ # Author:: Fletcher Nichol (<fnichol@nichol.ca>)
4
+ #
5
+ # Copyright (C) 2013, Fletcher Nichol
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+
19
+ require 'busser/runner_plugin'
20
+
21
+ # A Busser runner plugin for Minitest.
22
+ #
23
+ # @author Fletcher Nichol <fnichol@nichol.ca>
24
+ #
25
+ class Busser::RunnerPlugin::Minitest < Busser::RunnerPlugin::Base
26
+
27
+ postinstall do
28
+ install_gem("minitest")
29
+ end
30
+
31
+ def test
32
+ runner = File.join(File.dirname(__FILE__), %w{.. minitest runner.rb})
33
+
34
+ run_ruby_script!("#{runner} #{suite_path('minitest').to_s}")
35
+ end
36
+ end
metadata ADDED
@@ -0,0 +1,185 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: busser-minitest
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Fletcher Nichol
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-04-10 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: busser
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: bundler
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: '1.3'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '1.3'
46
+ - !ruby/object:Gem::Dependency
47
+ name: rake
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: aruba
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: cane
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: tailor
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: countloc
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ description: A Busser runner plugin for the minitest testing library
127
+ email:
128
+ - fnichol@nichol.ca
129
+ executables: []
130
+ extensions: []
131
+ extra_rdoc_files: []
132
+ files:
133
+ - .cane
134
+ - .gitignore
135
+ - .tailor
136
+ - .travis.yml
137
+ - CHANGELOG.md
138
+ - Gemfile
139
+ - LICENSE
140
+ - README.md
141
+ - Rakefile
142
+ - busser-minitest.gemspec
143
+ - features/plugin_install_command.feature
144
+ - features/plugin_list_command.feature
145
+ - features/support/env.rb
146
+ - features/test_command.feature
147
+ - lib/busser/minitest/runner.rb
148
+ - lib/busser/minitest/version.rb
149
+ - lib/busser/runner_plugin/minitest.rb
150
+ homepage: https://github.com/fnichol/busser-minitest
151
+ licenses:
152
+ - Apache 2.0
153
+ post_install_message:
154
+ rdoc_options: []
155
+ require_paths:
156
+ - lib
157
+ required_ruby_version: !ruby/object:Gem::Requirement
158
+ none: false
159
+ requirements:
160
+ - - ! '>='
161
+ - !ruby/object:Gem::Version
162
+ version: '0'
163
+ segments:
164
+ - 0
165
+ hash: -3316780338842173769
166
+ required_rubygems_version: !ruby/object:Gem::Requirement
167
+ none: false
168
+ requirements:
169
+ - - ! '>='
170
+ - !ruby/object:Gem::Version
171
+ version: '0'
172
+ segments:
173
+ - 0
174
+ hash: -3316780338842173769
175
+ requirements: []
176
+ rubyforge_project:
177
+ rubygems_version: 1.8.24
178
+ signing_key:
179
+ specification_version: 3
180
+ summary: A Busser runner plugin for the minitest testing library
181
+ test_files:
182
+ - features/plugin_install_command.feature
183
+ - features/plugin_list_command.feature
184
+ - features/support/env.rb
185
+ - features/test_command.feature