serverspec 0.10.13 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8a4acd1df5e5fbfb90f35c8c263d0a325caa1f91
4
- data.tar.gz: acf698f9ff6cb2eb208bc6373bbdda0075407dd0
3
+ metadata.gz: 279b84aaad3e71e171fe5872691185331de88e42
4
+ data.tar.gz: cdbc4f32caca9fb007181aa281608f4ee9d32b83
5
5
  SHA512:
6
- metadata.gz: b676dea6041e203fbd5f5fe0c453bd41460514e2d5b7580a5d43e2e7b6ba0bdb954ff8aa8391fe17e84bfb673a5f9814fa3db7ad998f267ae3750671b6ef7f48
7
- data.tar.gz: c5a582e9d9a17eecbf404450c68832be64372505d78bcbedcdcbc1596d3b7af88a6ef45e8984b8203ca55b3e164ecd54221678a7e0a59f01eb0ca5b73266cc72
6
+ metadata.gz: ee6180eac5a04397eec6491a327543fcd3afe864ece743929a3640953ac40a170e132792d1a817054debbfd0a69b263862ee2431c8dfca4a1b85a76201e28ed3
7
+ data.tar.gz: 3a835a4d699bbe5089b8e62e8f677b0db591493c9419a56713ce0bfd7e362a2f4d895ee62310c3fe64830fc4c9b4caba028791d798e233ed94ff0fb5a88df951
@@ -26,6 +26,10 @@ require 'serverspec/helper/detect_os'
26
26
  require 'serverspec/helper/attributes'
27
27
  include Serverspec::Helper::Attributes
28
28
 
29
+ # Properties helper
30
+ require 'serverspec/helper/properties'
31
+ include Serverspec::Helper::Properties
32
+
29
33
  # Subject type helper
30
34
  require 'serverspec/helper/type'
31
35
  include Serverspec::Helper::Type
@@ -4,9 +4,11 @@ module Serverspec
4
4
  module Helper
5
5
  module Attributes
6
6
  def attr
7
+ puts "Warning: attr method will be obsoleted. Please use property method instead."
7
8
  Serverspec::Attributes.instance.attributes
8
9
  end
9
10
  def attr_set(attr)
11
+ puts "Warning: attr_set method will be obsoleted. Please use set_property method instead."
10
12
  Serverspec::Attributes.instance.attributes(attr)
11
13
  end
12
14
  end
@@ -2,14 +2,14 @@ module Serverspec
2
2
  module Helper
3
3
  module DetectOS
4
4
  def commands
5
- attr[:os_type] = {} if ! attr[:os_type]
5
+ property[:os_type] = {} if ! property[:os_type]
6
6
  host = RSpec.configuration.ssh ? RSpec.configuration.ssh.host : 'localhost'
7
7
 
8
- if attr[:os_type][host]
9
- os = attr[:os_type][host]
8
+ if property[:os_type][host]
9
+ os = property[:os_type][host]
10
10
  else
11
11
  os = backend(Serverspec::Commands::Base).check_os
12
- attr[:os_type][host] = os
12
+ property[:os_type][host] = os
13
13
  end
14
14
 
15
15
  self.class.const_get('Serverspec').const_get('Commands').const_get(os).new
@@ -0,0 +1,14 @@
1
+ require 'serverspec/properties'
2
+
3
+ module Serverspec
4
+ module Helper
5
+ module Properties
6
+ def property
7
+ Serverspec::Properties.instance.properties
8
+ end
9
+ def set_property(prop)
10
+ Serverspec::Properties.instance.properties(prop)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,17 @@
1
+ require 'singleton'
2
+
3
+ module Serverspec
4
+ class Properties
5
+ include Singleton
6
+ def initialize
7
+ @prop = {}
8
+ end
9
+ def properties(prop=nil)
10
+ if ! prop.nil?
11
+ @prop = prop
12
+ end
13
+ @prop
14
+ end
15
+ end
16
+ end
17
+
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "0.10.13"
2
+ VERSION = "0.11.0"
3
3
  end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ include Serverspec::Helper::Properties
4
+
5
+ describe 'Properties Helper' do
6
+ before :all do
7
+ set_property :role => 'proxy'
8
+ end
9
+ subject { property }
10
+ it { should include :role => 'proxy' }
11
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serverspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.13
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-31 00:00:00.000000000 Z
11
+ date: 2013-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh
@@ -143,6 +143,7 @@ files:
143
143
  - lib/serverspec/helper/freebsd.rb
144
144
  - lib/serverspec/helper/gentoo.rb
145
145
  - lib/serverspec/helper/plamo.rb
146
+ - lib/serverspec/helper/properties.rb
146
147
  - lib/serverspec/helper/puppet.rb
147
148
  - lib/serverspec/helper/redhat.rb
148
149
  - lib/serverspec/helper/smartos.rb
@@ -173,6 +174,7 @@ files:
173
174
  - lib/serverspec/matchers/return_exit_status.rb
174
175
  - lib/serverspec/matchers/return_stderr.rb
175
176
  - lib/serverspec/matchers/return_stdout.rb
177
+ - lib/serverspec/properties.rb
176
178
  - lib/serverspec/setup.rb
177
179
  - lib/serverspec/subject.rb
178
180
  - lib/serverspec/type/base.rb
@@ -289,7 +291,7 @@ files:
289
291
  - spec/gentoo/service_spec.rb
290
292
  - spec/gentoo/user_spec.rb
291
293
  - spec/gentoo/zfs_spec.rb
292
- - spec/helpers/attributes_spec.rb
294
+ - spec/helpers/properties_spec.rb
293
295
  - spec/plamo/cgroup_spec.rb
294
296
  - spec/plamo/command_spec.rb
295
297
  - spec/plamo/cron_spec.rb
@@ -490,7 +492,7 @@ test_files:
490
492
  - spec/gentoo/service_spec.rb
491
493
  - spec/gentoo/user_spec.rb
492
494
  - spec/gentoo/zfs_spec.rb
493
- - spec/helpers/attributes_spec.rb
495
+ - spec/helpers/properties_spec.rb
494
496
  - spec/plamo/cgroup_spec.rb
495
497
  - spec/plamo/command_spec.rb
496
498
  - spec/plamo/cron_spec.rb
@@ -1,11 +0,0 @@
1
- require 'spec_helper'
2
-
3
- include Serverspec::Helper::Attributes
4
-
5
- describe 'Attributes Helper' do
6
- before :all do
7
- attr_set :role => 'proxy'
8
- end
9
- subject { attr }
10
- it { should include :role => 'proxy' }
11
- end