beaker-rspec 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/beaker-rspec.gemspec CHANGED
@@ -6,7 +6,7 @@ less_than_one_nine = ruby_conf['MAJOR'].to_i == 1 && ruby_conf['MINOR'].to_i < 9
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "beaker-rspec"
9
- s.version = '2.1.0'
9
+ s.version = '2.1.1'
10
10
  s.authors = ["Puppetlabs"]
11
11
  s.email = ["sqa@puppetlabs.com"]
12
12
  s.homepage = "https://github.com/puppetlabs/beaker-rspec"
@@ -15,25 +15,24 @@ RSpec.configure do |c|
15
15
  nodeset = ENV['RS_SET'] || 'default'
16
16
  nodesetfile = ENV['RS_SETFILE'] || File.join('spec/acceptance/nodesets',"#{nodeset}.yml")
17
17
 
18
- case ENV['RS_DESTROY']
19
- when 'no'
20
- preserve = ['--preserve-hosts','always']
21
- when 'onpass'
22
- preserve = ['--preserve-hosts','onfail']
23
- else
24
- preserve = ['--preserve-hosts','never']
25
- end
26
18
  fresh_nodes = ENV['RS_PROVISION'] == 'no' ? '--no-provision' : nil
27
19
  keyfile = ENV['RS_KEYFILE'] ? ['--keyfile', ENV['RS_KEYFILE']] : nil
28
20
  debug = ENV['RS_DEBUG'] ? ['--log-level', 'debug'] : nil
29
21
 
30
22
  # Configure all nodes in nodeset
31
- c.setup([preserve, fresh_nodes, '--hosts', nodesetfile, keyfile, debug].flatten.compact)
23
+ c.setup([fresh_nodes, '--hosts', nodesetfile, keyfile, debug].flatten.compact)
32
24
  c.provision
33
25
  c.validate
34
26
 
35
27
  # Destroy nodes if no preserve hosts
36
28
  c.after :suite do
37
- c.cleanup
29
+ case ENV['RS_DESTROY']
30
+ when 'no'
31
+ # Don't cleanup
32
+ when 'onpass'
33
+ c.cleanup if RSpec.world.filtered_examples.values.flatten.none?(&:exception)
34
+ else
35
+ c.cleanup
36
+ end
38
37
  end
39
38
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 2
7
7
  - 1
8
- - 0
9
- version: 2.1.0
8
+ - 1
9
+ version: 2.1.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Puppetlabs
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2014-01-29 00:00:00 -08:00
17
+ date: 2014-01-30 00:00:00 -08:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency