busser-shpec 0.1.0.dev
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 +0 -0
- data/.gitignore +17 -0
- data/.tailor +4 -0
- data/.travis.yml +11 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +3 -0
- data/README.md +48 -0
- data/Rakefile +31 -0
- data/busser-shpec.gemspec +30 -0
- data/features/plugin_install_command.feature +14 -0
- data/features/plugin_list_command.feature +8 -0
- data/features/support/env.rb +13 -0
- data/features/test_command.feature +33 -0
- data/lib/busser/runner_plugin/shpec.rb +33 -0
- data/lib/busser/shpec/version.rb +10 -0
- metadata +180 -0
data/.cane
ADDED
File without changes
|
data/.gitignore
ADDED
data/.tailor
ADDED
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
# <a name="title"></a> Busser::RunnerPlugin::Shpec
|
2
|
+
|
3
|
+
A Busser runner plugin for [Shpec][shpec_site].
|
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
|
+
**TODO:** Write documentation explaining the structure/format of testing files.
|
12
|
+
|
13
|
+
## <a name="development"></a> Development
|
14
|
+
|
15
|
+
* Source hosted at [GitHub][repo]
|
16
|
+
* Report issues/questions/feature requests on [GitHub Issues][issues]
|
17
|
+
|
18
|
+
Pull requests are very welcome! Make sure your patches are well tested.
|
19
|
+
Ideally create a topic branch for every separate change you make. For
|
20
|
+
example:
|
21
|
+
|
22
|
+
1. Fork the repo
|
23
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
24
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
25
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
26
|
+
5. Create new Pull Request
|
27
|
+
|
28
|
+
## <a name="authors"></a> Authors
|
29
|
+
|
30
|
+
Based on [busser-bats](https://github.com/fnichol/busser-bats) plugin by [Fletcher Nichol] (<fletcher@nichol.ca>).
|
31
|
+
|
32
|
+
Created and maintained by [Vasily Mikhaylichenko][author] (<vasily@locomote.com.au>).
|
33
|
+
|
34
|
+
## <a name="license"></a> License
|
35
|
+
|
36
|
+
Author:: Vasily Mikhaylichenko, [Locomote](http://locomote.com.au).
|
37
|
+
|
38
|
+
Licensed under BSD license.
|
39
|
+
|
40
|
+
http://opensource.org/licenses/BSD-2-Clause
|
41
|
+
|
42
|
+
[author]: https://github.com/locoomote
|
43
|
+
[issues]: https://github.com/locomote/busser-shpec/issues
|
44
|
+
[license]: https://github.com/locomote/busser-shpec/blob/master/LICENSE
|
45
|
+
[repo]: https://github.com/locomote/busser-shpec
|
46
|
+
[plugin_usage]: http://docs.kitchen-ci.org/busser/plugin-usage
|
47
|
+
|
48
|
+
[shpec_site]: https://github.com/shpec/shpec
|
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/shpec/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'busser-shpec'
|
8
|
+
spec.version = Busser::Shpec::VERSION
|
9
|
+
spec.authors = ['Vasily Mikhaylichenko']
|
10
|
+
spec.email = ['vasily@locomote.com.au']
|
11
|
+
spec.description = %q{A Busser runner plugin for Shpec}
|
12
|
+
spec.summary = spec.description
|
13
|
+
spec.homepage = 'https://github.com/locomote/busser-shpec'
|
14
|
+
spec.license = 'BSD'
|
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,14 @@
|
|
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-shpec-install"
|
8
|
+
|
9
|
+
Scenario: Running the postinstall generator
|
10
|
+
When I run `busser plugin install busser-shpec --force-postinstall`
|
11
|
+
Then the vendor directory named "shpec" should exist
|
12
|
+
And the vendor file "shpec/bin/shpec" should contain "VERSION="
|
13
|
+
And the output should contain "install bin/shpec"
|
14
|
+
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 /^shpec\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,33 @@
|
|
1
|
+
Feature: Test command
|
2
|
+
In order to run tests written with shpec
|
3
|
+
As a user of Busser
|
4
|
+
I want my tests to run when the shpec runner plugin is installed
|
5
|
+
|
6
|
+
Background:
|
7
|
+
Given a test BUSSER_ROOT directory named "busser-shpec-test"
|
8
|
+
When I successfully run `busser plugin install busser-shpec --force-postinstall`
|
9
|
+
Given a suite directory named "shpec"
|
10
|
+
|
11
|
+
Scenario: A passing test suite
|
12
|
+
Given a file in suite "shpec" named "default_shpec.sh" with:
|
13
|
+
"""
|
14
|
+
describe "basic operations"
|
15
|
+
it "asserts equality"
|
16
|
+
assert equal "foo" "foo"
|
17
|
+
end_describe
|
18
|
+
|
19
|
+
"""
|
20
|
+
When I run `busser test shpec`
|
21
|
+
Then the exit status should be 0
|
22
|
+
|
23
|
+
Scenario: A failing test suite
|
24
|
+
Given a file in suite "shpec" named "default_shpec.sh" with:
|
25
|
+
"""
|
26
|
+
describe "basic operations"
|
27
|
+
it "asserts greater than"
|
28
|
+
assert gt 1 99
|
29
|
+
end_describe
|
30
|
+
|
31
|
+
"""
|
32
|
+
When I run `busser test shpec`
|
33
|
+
Then the exit status should not be 0
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
require 'pathname'
|
4
|
+
require 'tmpdir'
|
5
|
+
|
6
|
+
require 'busser/runner_plugin'
|
7
|
+
|
8
|
+
# A Busser runner plugin for Shpec.
|
9
|
+
class Busser::RunnerPlugin::Shpec < Busser::RunnerPlugin::Base
|
10
|
+
|
11
|
+
postinstall do
|
12
|
+
tmp_root = Pathname.new(Dir.mktmpdir("shpec"))
|
13
|
+
tarball_url = "https://github.com/shpec/shpec/archive/master.tar.gz"
|
14
|
+
tarball_file = tmp_root.join("shpec.tar.gz")
|
15
|
+
extract_root = tmp_root.join("shpec")
|
16
|
+
dest_path = vendor_path("shpec")
|
17
|
+
|
18
|
+
empty_directory(extract_root)
|
19
|
+
get(tarball_url, tarball_file)
|
20
|
+
inside(extract_root) do
|
21
|
+
run!(%{gunzip -c "#{tarball_file}" | tar xf - --strip-components=1})
|
22
|
+
|
23
|
+
ENV['PREFIX'] = dest_path.to_s
|
24
|
+
run!(%{make install})
|
25
|
+
end
|
26
|
+
remove_dir(tmp_root)
|
27
|
+
end
|
28
|
+
|
29
|
+
def test
|
30
|
+
suite_files = suite_path('shpec').join('*')
|
31
|
+
run!("#{vendor_path('shpec').join("bin/shpec")} #{suite_files}")
|
32
|
+
end
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,180 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: busser-shpec
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0.dev
|
5
|
+
prerelease: 6
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Vasily Mikhaylichenko
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-06-11 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 Shpec
|
127
|
+
email:
|
128
|
+
- vasily@locomote.com.au
|
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
|
+
- README.md
|
140
|
+
- Rakefile
|
141
|
+
- busser-shpec.gemspec
|
142
|
+
- features/plugin_install_command.feature
|
143
|
+
- features/plugin_list_command.feature
|
144
|
+
- features/support/env.rb
|
145
|
+
- features/test_command.feature
|
146
|
+
- lib/busser/runner_plugin/shpec.rb
|
147
|
+
- lib/busser/shpec/version.rb
|
148
|
+
homepage: https://github.com/locomote/busser-shpec
|
149
|
+
licenses:
|
150
|
+
- BSD
|
151
|
+
post_install_message:
|
152
|
+
rdoc_options: []
|
153
|
+
require_paths:
|
154
|
+
- lib
|
155
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
156
|
+
none: false
|
157
|
+
requirements:
|
158
|
+
- - ! '>='
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: '0'
|
161
|
+
segments:
|
162
|
+
- 0
|
163
|
+
hash: 1092636656169131349
|
164
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
|
+
none: false
|
166
|
+
requirements:
|
167
|
+
- - ! '>'
|
168
|
+
- !ruby/object:Gem::Version
|
169
|
+
version: 1.3.1
|
170
|
+
requirements: []
|
171
|
+
rubyforge_project:
|
172
|
+
rubygems_version: 1.8.23
|
173
|
+
signing_key:
|
174
|
+
specification_version: 3
|
175
|
+
summary: A Busser runner plugin for Shpec
|
176
|
+
test_files:
|
177
|
+
- features/plugin_install_command.feature
|
178
|
+
- features/plugin_list_command.feature
|
179
|
+
- features/support/env.rb
|
180
|
+
- features/test_command.feature
|