serverspec 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,6 +15,7 @@ require 'serverspec/helper/detect_os'
15
15
 
16
16
  # Attributes helper
17
17
  require 'serverspec/helper/attributes'
18
+ include Serverspec::Helper::Attributes
18
19
 
19
20
  # Subject type helper
20
21
  require 'serverspec/helper/type'
@@ -2,7 +2,16 @@ module Serverspec
2
2
  module Helper
3
3
  module DetectOS
4
4
  def commands
5
- os = backend(Serverspec::Commands::Base).check_os
5
+ attr[:os_type] = {} if ! attr[:os_type]
6
+ host = RSpec.configuration.ssh ? RSpec.configuration.ssh.host : 'localhost'
7
+
8
+ if attr[:os_type][host]
9
+ os = attr[:os_type][host]
10
+ else
11
+ os = backend(Serverspec::Commands::Base).check_os
12
+ attr[:os_type][host] = os
13
+ end
14
+
6
15
  self.class.const_get('Serverspec').const_get('Commands').const_get(os).new
7
16
  end
8
17
  end
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "0.6.1"
2
+ VERSION = "0.6.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serverspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -323,7 +323,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
323
323
  version: '0'
324
324
  requirements: []
325
325
  rubyforge_project:
326
- rubygems_version: 1.8.23
326
+ rubygems_version: 1.8.25
327
327
  signing_key:
328
328
  specification_version: 3
329
329
  summary: RSpec tests for your servers provisioned by Puppet, Chef or anything else