busser-rspec 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/.cane ADDED
File without changes
@@ -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
@@ -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
@@ -0,0 +1,3 @@
1
+ ## 0.1.0 / 2013-05-22
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:: HIGUCHI Daisuke (<d-higuchi@creationline.com>)
2
+
3
+ Copyright (C) 2013, HIGUCHI Daisuke
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.
@@ -0,0 +1,44 @@
1
+ # <a name="title"></a> Busser::RunnerPlugin::Rspec
2
+
3
+ A Busser runner plugin for Rspec
4
+
5
+ ## <a name="installation"></a> Installation and Setup
6
+
7
+ Please read the Busser [plugin usage][plugin_usage] page for more details.
8
+
9
+ ## <a name="usage"></a> Usage
10
+
11
+ Please put test files into [COOKBOOK]/test/integration/[SUITES]/rspec/
12
+
13
+ ```cookbook
14
+ `-- test
15
+ `-- integration
16
+ `-- default
17
+ `-- rspec
18
+ `-- spec_helper.rb
19
+ ```
20
+
21
+ ## <a name="development"></a> Development
22
+
23
+ * Source hosted at [GitHub][repo]
24
+ * Report issues/questions/feature requests on [GitHub Issues][issues]
25
+
26
+ Pull requests are very welcome! Make sure your patches are well tested.
27
+ Ideally create a topic branch for every separate change you make. For
28
+ example:
29
+
30
+ 1. Fork the repo
31
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
32
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
33
+ 4. Push to the branch (`git push origin my-new-feature`)
34
+ 5. Create new Pull Request
35
+
36
+ ## <a name="authors"></a> Authors
37
+
38
+ Created and maintained by [Adam Jacob][author] (<adam@opscode.com>)
39
+ Based on busser-serverspec, created and maintained by [HIGUCHI Daisuke][author] (<d-higuchi@creationline.com>)
40
+
41
+ ## <a name="license"></a> License
42
+
43
+ Apache 2.0 (see [LICENSE][license])
44
+
@@ -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,29 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'busser/rspec/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'busser-rspec'
8
+ spec.version = Busser::Rspec::VERSION
9
+ spec.authors = ['HIGUCHI Daisuke']
10
+ spec.email = ['d-higuchi@creationline.com']
11
+ spec.description = %q{A Busser runner plugin for RSpec}
12
+ spec.summary = spec.description
13
+ spec.homepage = 'https://github.com/adamhjk/busser-rspec'
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
+ spec.add_development_dependency 'cane'
27
+ spec.add_development_dependency 'tailor'
28
+ spec.add_development_dependency 'countloc'
29
+ end
@@ -0,0 +1,11 @@
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-rspec-install"
8
+
9
+ Scenario: Running the postinstall generator
10
+ When I run `busser plugin install busser-rspec --force-postinstall`
11
+ Then 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 /^rspec\b/
@@ -0,0 +1,13 @@
1
+ require 'aruba/cucumber'
2
+ require 'busser/cucumber'
3
+
4
+ Before do
5
+ @aruba_timeout_seconds = 20
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,31 @@
1
+ Feature: Test command
2
+ In order to run tests written with rspec
3
+ As a user of Busser
4
+ I want my tests to run when the rspec runner plugin is installed
5
+
6
+ Background:
7
+ Given a test BUSSER_ROOT directory named "busser-rspec-test"
8
+ When I successfully run `busser plugin install busser-rspec --force-postinstall`
9
+ Given a suite directory named "rspec"
10
+
11
+ Scenario: A passing test suite
12
+ Given a file in suite "rspec" named "<YOUR_FILE>" with:
13
+ """
14
+ TEST FILE CONTENT
15
+
16
+ A good test might be a simple passing statement
17
+ """
18
+ When I run `busser test rspec`
19
+ Then I should verify some output for the rspec plugin
20
+ And the exit status should be 0
21
+
22
+ Scenario: A failing test suite
23
+ Given a file in suite "rspec" named "<YOUR_FILE>" with:
24
+ """
25
+ TEST FILE CONTENT
26
+
27
+ A good test might be a failing test case, raised exception, etc.
28
+ """
29
+ When I run `busser test rspec`
30
+ Then I should verify some output for the rspec plugin
31
+ And the exit status should not be 0
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- encoding: utf-8 -*-
3
+ #
4
+ # Author:: HIGUCHI Daisuke (<d-higuchi@creationline.com>)
5
+ #
6
+ # Copyright (C) 2013, HIGUCHI Daisuke
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'
21
+ require 'rspec/core/rake_task'
22
+ require 'rbconfig'
23
+
24
+ base_path = File.expand_path(ARGV.shift)
25
+
26
+ RSpec::Core::RakeTask.new(:spec) do |t|
27
+ t.rspec_path = RbConfig::CONFIG['bindir'] + '/rspec'
28
+ t.ruby_opts = [ "-I#{base_path}" ]
29
+ t.pattern = "#{base_path}/**/*_spec.rb"
30
+ end
31
+ Rake::Task["spec"].invoke
@@ -0,0 +1,26 @@
1
+ # -*- encoding: utf-8 -*-
2
+ #
3
+ # Author:: HIGUCHI Daisuke (<d-higuchi@creationline.com>)
4
+ #
5
+ # Copyright (C) 2013, HIGUCHI Daisuke
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 Rspec
22
+
23
+ # Version string for the Rspec Busser runner plugin
24
+ VERSION = "0.1.0"
25
+ end
26
+ end
@@ -0,0 +1,35 @@
1
+ # -*- encoding: utf-8 -*-
2
+ #
3
+ # Author:: HIGUCHI Daisuke (<d-higuchi@creationline.com>)
4
+ #
5
+ # Copyright (C) 2013, HIGUCHI Daisuke
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 Rspec.
22
+ #
23
+ # @author Adam Jacob <adam@opscode.com>
24
+ #
25
+ class Busser::RunnerPlugin::Rspec < Busser::RunnerPlugin::Base
26
+ postinstall do
27
+ install_gem("rspec", "<= 2.13.1")
28
+ end
29
+
30
+ def test
31
+ runner = File.join(File.dirname(__FILE__), %w{.. rspec runner.rb})
32
+
33
+ run_ruby_script!("#{runner} #{suite_path('rspec').to_s}")
34
+ end
35
+ end
metadata ADDED
@@ -0,0 +1,185 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: busser-rspec
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - HIGUCHI Daisuke
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-05-29 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 RSpec
127
+ email:
128
+ - d-higuchi@creationline.com
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-rspec.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/rspec/runner.rb
148
+ - lib/busser/rspec/version.rb
149
+ - lib/busser/runner_plugin/rspec.rb
150
+ homepage: https://github.com/adamhjk/busser-rspec
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: 1843673305333226728
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: 1843673305333226728
175
+ requirements: []
176
+ rubyforge_project:
177
+ rubygems_version: 1.8.25
178
+ signing_key:
179
+ specification_version: 3
180
+ summary: A Busser runner plugin for RSpec
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