busser-rspec 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,27 +1,28 @@
1
- # <a name="title"></a> Busser::RunnerPlugin::Rspec
1
+ # Busser::RunnerPlugin::Rspec
2
2
 
3
3
  A Busser runner plugin for Rspec
4
4
 
5
- ## <a name="installation"></a> Installation and Setup
5
+ ## Installation and Setup
6
6
 
7
- Please read the Busser [plugin usage][plugin_usage] page for more details.
7
+ Please read the Busser [plugin usage](plugin_usage) page for more details.
8
8
 
9
- ## <a name="usage"></a> Usage
9
+ ## Usage
10
10
 
11
11
  Please put test files into [COOKBOOK]/test/integration/[SUITES]/rspec/
12
12
 
13
- ```cookbook
14
- `-- test
15
- `-- integration
13
+ ```
14
+ -- [COOKBOOK]
15
+ `-- test
16
+ `-- integration
16
17
  `-- default
17
- `-- rspec
18
- `-- spec_helper.rb
18
+ `-- rspec
19
+ `-- spec_helper.rb
19
20
  ```
20
21
 
21
- ## <a name="development"></a> Development
22
+ ## Development
22
23
 
23
- * Source hosted at [GitHub][repo]
24
- * Report issues/questions/feature requests on [GitHub Issues][issues]
24
+ * Source hosted at [GitHub](https://github.com/opscode/busser-rspec)
25
+ * Report issues/questions/feature requests on [GitHub Issues](issues)
25
26
 
26
27
  Pull requests are very welcome! Make sure your patches are well tested.
27
28
  Ideally create a topic branch for every separate change you make. For
@@ -33,12 +34,13 @@ example:
33
34
  4. Push to the branch (`git push origin my-new-feature`)
34
35
  5. Create new Pull Request
35
36
 
36
- ## <a name="authors"></a> Authors
37
+ ## Authors
38
+
39
+ Created and maintained by Adam Jacob (adam@opscode.com)
37
40
 
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>)
41
+ Based on [busser-serverspec](https://github.com/cl-lab-k/busser-serverspec), created and maintained by HIGUCHI Daisuke (d-higuchi@creationline.com)
40
42
 
41
- ## <a name="license"></a> License
43
+ ## License
42
44
 
43
- Apache 2.0 (see [LICENSE][license])
45
+ Apache 2.0 (see [LICENSE](license))
44
46
 
data/busser-rspec.gemspec CHANGED
@@ -20,6 +20,9 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_dependency 'busser'
22
22
 
23
+ spec.add_development_dependency 'rspec'
24
+ spec.add_development_dependency 'chef'
25
+
23
26
  spec.add_development_dependency 'bundler', '~> 1.3'
24
27
  spec.add_development_dependency 'rake'
25
28
  spec.add_development_dependency 'aruba'
@@ -5,7 +5,9 @@ Feature: Plugin install command
5
5
 
6
6
  Background:
7
7
  Given a test BUSSER_ROOT directory named "busser-rspec-install"
8
+ And a sandboxed GEM_HOME directory named "busser-rspec-gem-home"
8
9
 
9
10
  Scenario: Running the postinstall generator
10
11
  When I run `busser plugin install busser-rspec --force-postinstall`
11
- Then the exit status should be 0
12
+ Then a gem named "rspec" is installed
13
+ And the exit status should be 0
@@ -5,27 +5,37 @@ Feature: Test command
5
5
 
6
6
  Background:
7
7
  Given a test BUSSER_ROOT directory named "busser-rspec-test"
8
+ And a sandboxed GEM_HOME directory named "busser-rspec-gem-home"
8
9
  When I successfully run `busser plugin install busser-rspec --force-postinstall`
9
10
  Given a suite directory named "rspec"
10
11
 
11
12
  Scenario: A passing test suite
12
- Given a file in suite "rspec" named "<YOUR_FILE>" with:
13
+ Given a file in suite "rspec" named "default_spec.rb" with:
13
14
  """
14
- TEST FILE CONTENT
15
-
16
- A good test might be a simple passing statement
15
+ describe 'default' do
16
+ it 'succeed' do
17
+ end
18
+ end
17
19
  """
18
20
  When I run `busser test rspec`
19
- Then I should verify some output for the rspec plugin
21
+ Then the output should contain:
22
+ """
23
+ 1 example, 0 failures
24
+ """
20
25
  And the exit status should be 0
21
26
 
22
27
  Scenario: A failing test suite
23
- Given a file in suite "rspec" named "<YOUR_FILE>" with:
28
+ Given a file in suite "rspec" named "default_spec.rb" with:
24
29
  """
25
- TEST FILE CONTENT
26
-
27
- A good test might be a failing test case, raised exception, etc.
30
+ describe 'default' do
31
+ it 'fail' do
32
+ raise
33
+ end
34
+ end
28
35
  """
29
36
  When I run `busser test rspec`
30
- Then I should verify some output for the rspec plugin
37
+ Then the output should contain:
38
+ """
39
+ 1 example, 1 failure
40
+ """
31
41
  And the exit status should not be 0
@@ -21,6 +21,6 @@ module Busser
21
21
  module Rspec
22
22
 
23
23
  # Version string for the Rspec Busser runner plugin
24
- VERSION = "0.7.0"
24
+ VERSION = "0.7.1"
25
25
  end
26
26
  end
@@ -25,28 +25,30 @@ require 'rubygems'
25
25
  #
26
26
  class Busser::RunnerPlugin::Rspec < Busser::RunnerPlugin::Base
27
27
  postinstall do
28
- install_gem("rspec", "<= 2.13.1")
28
+ install_gem("rspec")
29
29
  install_gem("bundler")
30
30
  end
31
31
 
32
32
  def test
33
33
  rspec_path = suite_path('rspec').to_s
34
34
 
35
- chef_apply do
36
- setup_file = File.join(rspec_path, "setup-recipe.rb")
35
+ setup_file = File.join(rspec_path, "setup-recipe.rb")
37
36
 
37
+ Dir.chdir(rspec_path) do
38
38
  if File.exists?(setup_file)
39
- eval(IO.read(setup_file))
39
+ if !File.exists?("/opt/chef/bin/chef-apply")
40
+ raise "You have a chef setup file at #{setup_file}, but /opt/chef/bin/chef-apply does not if exist"
41
+ end
42
+ run("/opt/chef/bin/chef-apply #{setup_file}")
40
43
  end
41
44
 
42
- execute "bundle install --local || bundle install" do
43
- environment("PATH" => "#{ENV['PATH']}:#{Gem.bindir}")
44
- cwd rspec_path
45
- only_if { File.exists?(File.join(rspec_path, "Gemfile")) }
45
+ if File.exists?(File.join(rspec_path, "Gemfile"))
46
+ # Bundle install local completes quickly if the gems are already found locally
47
+ # it fails if it needs to talk to the internet. The || below is the fallback
48
+ # to the internet-enabled version. It's a speed optimization.
49
+ run("env PATH=#{ENV['PATH']}:#{Gem.bindir} bundle install --local || bundle install")
46
50
  end
47
- end
48
51
 
49
- Dir.chdir(rspec_path) do
50
52
  runner = File.expand_path(File.join(File.dirname(__FILE__), "..", "rspec", "runner.rb"))
51
53
  run_ruby_script!("#{runner} -I #{rspec_path} -I #{rspec_path}/lib #{rspec_path}")
52
54
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: busser-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-30 00:00:00.000000000 Z
12
+ date: 2014-01-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: busser
@@ -27,6 +27,38 @@ dependencies:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rspec
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
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: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: chef
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'
30
62
  - !ruby/object:Gem::Dependency
31
63
  name: bundler
32
64
  requirement: !ruby/object:Gem::Requirement
@@ -162,7 +194,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
162
194
  version: '0'
163
195
  segments:
164
196
  - 0
165
- hash: -3777970935078636489
197
+ hash: -1620810802609636202
166
198
  required_rubygems_version: !ruby/object:Gem::Requirement
167
199
  none: false
168
200
  requirements:
@@ -171,10 +203,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
203
  version: '0'
172
204
  segments:
173
205
  - 0
174
- hash: -3777970935078636489
206
+ hash: -1620810802609636202
175
207
  requirements: []
176
208
  rubyforge_project:
177
- rubygems_version: 1.8.25
209
+ rubygems_version: 1.8.23
178
210
  signing_key:
179
211
  specification_version: 3
180
212
  summary: A Busser runner plugin for RSpec