chef-sugar 2.5.0 → 3.0.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: cb7fd64f85beb2f7d54f0db0eeeddc14a7062c4c
4
- data.tar.gz: 81314e1d07f9f66f6aaacec9791c136f18742e7d
3
+ metadata.gz: d36f781f9ad16a91e542337396dbd4bfb7eb9a5c
4
+ data.tar.gz: 5582a86da12f5153b7d7983ff1837a9e32809c6e
5
5
  SHA512:
6
- metadata.gz: c253b9e100abc3d1b37282b31bef7044dcbc89d198624ea921e1ad9110d5eae03158c0b1bd981c284db9182db58390254fc99ef0f6ac3c92bcff92f104d77f5c
7
- data.tar.gz: e52323a36a787b6daf95e1ccef69e16c30f2bc92ca1e5ff2e8cbf82d981109cf31c6f18bafc895e8a8bbdc5c554deaae2088a9a80d6cbb707b83bfd411926c5e
6
+ metadata.gz: 1de9ff9c1e94dd9725ab54f5aa5cf51f76645dcbe56cb3b86c2b5a261326956128ba44bf91fc89e790842b8f616feac65724eec2dd65e96ce988fff35ae29617
7
+ data.tar.gz: f52967095ea599f2a1c524d1287546196b67e88251ca98a42e5a8a786b2068ae0e7436bb56e194fa0db981d2f60c278b5ee86ff1b6a6477838f0cef502e77ba8
data/.travis.yml CHANGED
@@ -1,7 +1,15 @@
1
+ sudo: false
2
+
1
3
  rvm:
2
- - 1.9.3
3
4
  - 2.0.0
4
5
  - 2.1
6
+ - 2.2
7
+
8
+ branches:
9
+ only:
10
+ - master
11
+
12
+ cache: bundler
5
13
 
6
14
  bundler_args: --jobs 7
7
15
 
data/CHANGELOG.md CHANGED
@@ -2,6 +2,24 @@ Chef Sugar Changelog
2
2
  =========================
3
3
  This file is used to list changes made in each version of the chef-sugar cookbook and gem.
4
4
 
5
+ v3.0.0 (2015-03-17)
6
+ -------------------
7
+ ### Breaking Changes
8
+ - Drop support for Ruby 1.9 (it might still work, but it is no longer officially supported)
9
+
10
+ ### Improvements
11
+ - Remove accidentially committed gem source
12
+ - Bump development dependencies
13
+ - Add `digitalocean?` matcher
14
+ - Expose the `rhel` platform as `el`
15
+ - Add `ppc64le` platform
16
+ - Add helper for determining if architecture is SPARC
17
+ - Add helper for determining if architecture is Intel
18
+ - Add dynamic platform/version matchers for Solaris
19
+
20
+ ### Bug Fixes
21
+ - Reset namespace_options when reaching top-level resources
22
+
5
23
  v2.5.0 (2015-01-05)
6
24
  -------------------
7
25
  ### Improvements
data/LICENSE CHANGED
@@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work.
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright 2013-2014 Seth Vargo
189
+ Copyright 2013-2015 Seth Vargo
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
data/README.md CHANGED
@@ -1,14 +1,10 @@
1
- Chef::Sugar
2
- ================
3
- [![Gem Version](http://img.shields.io/gem/v/chef-sugar.svg)][gem]
4
- [![Build Status](http://img.shields.io/travis/sethvargo/chef-sugar.svg)][travis]
5
- [![Dependency Status](http://img.shields.io/gemnasium/sethvargo/chef-sugar.svg)][gemnasium]
6
- [![Code Climate](http://img.shields.io/codeclimate/github/sethvargo/chef-sugar.svg)][codeclimate]
1
+ Chef Sugar
2
+ ==========
3
+ [![Gem Version](http://img.shields.io/gem/v/chef-sugar.svg?style=flat-square)][gem]
4
+ [![Build Status](http://img.shields.io/travis/sethvargo/chef-sugar.svg?style=flat-square)][travis]
7
5
 
8
6
  [gem]: https://rubygems.org/gems/chef-sugar
9
7
  [travis]: http://travis-ci.org/sethvargo/chef-suguar
10
- [gemnasium]: https://gemnasium.com/sethvargo/chef-sugar
11
- [codeclimate]: https://codeclimate.com/github/sethvargo/chef-sugar
12
8
 
13
9
  Chef Sugar is a Gem & Chef Recipe that includes series of helpful sugar of the Chef core and other resources to make a cleaner, more lean recipe DSL, enforce DRY principles, and make writing Chef recipes an awesome experience!
14
10
 
@@ -82,6 +78,8 @@ API
82
78
 
83
79
  - `_64_bit?`
84
80
  - `_32_bit?`
81
+ - `intel?`
82
+ - `sparc?`
85
83
 
86
84
  #### Examples
87
85
  ```ruby
@@ -94,6 +92,7 @@ end
94
92
  ### Cloud
95
93
  - `azure?`
96
94
  - `cloud?`
95
+ - `digitalocean?`
97
96
  - `ec2?`
98
97
  - `eucalyptus?`
99
98
  - `gce?`
@@ -303,6 +302,8 @@ There are also a series of dynamically defined matchers that map named operating
303
302
  - `mac_os_x_lion?`
304
303
  - `ubuntu_before_lucid?`
305
304
  - `ubuntu_before_or_at_maverick?`
305
+ - `solaris_10?`
306
+ - `solaris_11?`
306
307
 
307
308
  To get a full list, run the following in IRB:
308
309
 
@@ -445,7 +446,7 @@ License & Authors
445
446
  - Author: Seth Vargo (sethvargo@gmail.com)
446
447
 
447
448
  ```text
448
- Copyright 2013-2014 Seth Vargo
449
+ Copyright 2013-2015 Seth Vargo
449
450
 
450
451
  Licensed under the Apache License, Version 2.0 (the "License");
451
452
  you may not use this file except in compliance with the License.
data/chef-sugar.gemspec CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.add_development_dependency 'bundler', '~> 1.3'
28
28
  spec.add_development_dependency 'rake'
29
29
 
30
- spec.add_development_dependency 'chefspec', '~> 4.0'
31
- spec.add_development_dependency 'test-kitchen', '~> 1.1'
32
- spec.add_development_dependency 'kitchen-vagrant', '~> 0.14'
30
+ spec.add_development_dependency 'chefspec', '~> 4.2'
31
+ spec.add_development_dependency 'test-kitchen', '~> 1.3'
32
+ spec.add_development_dependency 'kitchen-vagrant', '~> 0.15'
33
33
  end
data/lib/chef/sugar.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2013-2014, Seth Vargo <sethvargo@gmail.com>
2
+ # Copyright 2013-2015, Seth Vargo <sethvargo@gmail.com>
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2013-2014, Seth Vargo <sethvargo@gmail.com>
2
+ # Copyright 2013-2015, Seth Vargo <sethvargo@gmail.com>
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@ class Chef
25
25
  # @return [Boolean]
26
26
  #
27
27
  def _64_bit?(node)
28
- %w(amd64 x86_64 ppc64 s390x ia64 sparc64 aarch64 arch64 arm64)
28
+ %w(amd64 x86_64 ppc64 ppc64le s390x ia64 sparc64 aarch64 arch64 arm64)
29
29
  .include?(node['kernel']['machine'])
30
30
  end
31
31
 
@@ -40,6 +40,26 @@ class Chef
40
40
  !_64_bit?(node)
41
41
  end
42
42
  alias_method :i386?, :_32_bit?
43
+
44
+ #
45
+ # Determine if the current architecture is Intel.
46
+ #
47
+ # @return [Boolean]
48
+ #
49
+ def intel?(node)
50
+ %w(i86pc)
51
+ .include?(node['kernel']['machine'])
52
+ end
53
+
54
+ #
55
+ # Determine if the current architecture is SPARC.
56
+ #
57
+ # @return [Boolean]
58
+ #
59
+ def sparc?(node)
60
+ %w(sun4u sun4v)
61
+ .include?(node['kernel']['machine'])
62
+ end
43
63
  end
44
64
 
45
65
  module DSL
@@ -49,6 +69,12 @@ class Chef
49
69
  # @see Chef::Sugar::Architecture#_32_bit?
50
70
  def _32_bit?; Chef::Sugar::Architecture._32_bit?(node); end
51
71
  alias_method :i386?, :_32_bit?
72
+
73
+ # @see Chef::Sugar::Architecture#intel?
74
+ def intel?; Chef::Sugar::Architecture.intel?(node); end
75
+
76
+ # @see Chef::Sugar::Architecture#sparc?
77
+ def sparc?; Chef::Sugar::Architecture.sparc?(node); end
52
78
  end
53
79
  end
54
80
  end
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2013-2014, Seth Vargo <sethvargo@gmail.com>
2
+ # Copyright 2013-2015, Seth Vargo <sethvargo@gmail.com>
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -127,6 +127,18 @@ class Chef
127
127
  def azure?(node)
128
128
  node.key?('azure')
129
129
  end
130
+
131
+ #
132
+ # Return true if the current current node is in DigitalOcean
133
+ #
134
+ # @param [Chef::Node] node
135
+ # the node to check
136
+ #
137
+ # @return [Boolean]
138
+ #
139
+ def digitalocean?(node)
140
+ node.key?('digital_ocean')
141
+ end
130
142
  end
131
143
 
132
144
  module DSL
@@ -157,6 +169,9 @@ class Chef
157
169
 
158
170
  # @see Chef::Sugar::Cloud#azure?
159
171
  def azure?; Chef::Sugar::Cloud.azure?(node); end
172
+
173
+ # @see Chef::Sugar::Cloud#digitalocean?
174
+ def digitalocean?; Chef::Sugar::Cloud.digitalocean?(node); end
160
175
  end
161
176
  end
162
177
  end
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2013-2014, Seth Vargo <sethvargo@gmail.com>
2
+ # Copyright 2013-2015, Seth Vargo <sethvargo@gmail.com>
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2013-2014, Seth Vargo <sethvargo@gmail.com>
2
+ # Copyright 2013-2015, Seth Vargo <sethvargo@gmail.com>
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2013-2014, Seth Vargo <sethvargo@gmail.com>
2
+ # Copyright 2013-2015, Seth Vargo <sethvargo@gmail.com>
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2013-2014, Seth Vargo <sethvargo@gmail.com>
2
+ # Copyright 2013-2015, Seth Vargo <sethvargo@gmail.com>
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2013-2014, Seth Vargo <sethvargo@gmail.com>
2
+ # Copyright 2013-2015, Seth Vargo <sethvargo@gmail.com>
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2013-2014, Seth Vargo <sethvargo@gmail.com>
2
+ # Copyright 2013-2015, Seth Vargo <sethvargo@gmail.com>
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2013-2014, Seth Vargo <sethvargo@gmail.com>
2
+ # Copyright 2013-2015, Seth Vargo <sethvargo@gmail.com>
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
data/lib/chef/sugar/ip.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2013-2014, Seth Vargo <sethvargo@gmail.com>
2
+ # Copyright 2013-2015, Seth Vargo <sethvargo@gmail.com>
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2013-2014, Seth Vargo <sethvargo@gmail.com>
2
+ # Copyright 2013-2015, Seth Vargo <sethvargo@gmail.com>
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2013-2014, Seth Vargo <sethvargo@gmail.com>
2
+ # Copyright 2013-2015, Seth Vargo <sethvargo@gmail.com>
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -17,12 +17,13 @@
17
17
  class Chef
18
18
  class Node
19
19
  class AttributeDoesNotExistError < StandardError
20
- def initialize(keys)
20
+ def initialize(keys, key)
21
21
  hash = keys.map { |key| "['#{key}']" }
22
22
 
23
23
  super <<-EOH
24
24
  No attribute `node#{hash.join}' exists on
25
- the current node. Please make sure you have spelled everything correctly.
25
+ the current node. Specifically the `#{key}' attribute is not
26
+ defined. Please make sure you have spelled everything correctly.
26
27
  EOH
27
28
  end
28
29
  end
@@ -76,7 +77,7 @@ EOH
76
77
  if hash.key?(key)
77
78
  hash[key]
78
79
  else
79
- raise AttributeDoesNotExistError.new(keys)
80
+ raise AttributeDoesNotExistError.new(keys, key)
80
81
  end
81
82
  end
82
83
  end
@@ -140,6 +141,9 @@ EOH
140
141
  instance_eval(&block)
141
142
  @current_namespace = current_namespace - keys
142
143
 
144
+ if @current_namespace.empty?
145
+ @namespace_options = nil
146
+ end
143
147
  nil
144
148
  end
145
149
 
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2013-2014, Seth Vargo <sethvargo@gmail.com>
2
+ # Copyright 2013-2015, Seth Vargo <sethvargo@gmail.com>
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -39,6 +39,13 @@ class Chef
39
39
  'mavericks' => '10.9',
40
40
  'yosemite' => '10.10',
41
41
  },
42
+ 'solaris' => {
43
+ '7' => '5.7',
44
+ '8' => '5.8',
45
+ '9' => '5.9',
46
+ '10' => '5.10',
47
+ '11' => '5.11',
48
+ },
42
49
  'ubuntu' => {
43
50
  'lucid' => '10.04',
44
51
  'maverick' => '10.10',
@@ -74,8 +81,9 @@ class Chef
74
81
  check = node['platform_version'].split('.')[0...length].join('.')
75
82
 
76
83
  # Calling #to_f will ensure we only check major versions since
77
- # '10.04.4'.to_f #=> 10.04.
78
- node['platform'] == platform && block.call(check.to_f, version.to_f)
84
+ # '10.04.4'.to_f #=> 10.04. We also use a regex to match on
85
+ # platform so things like `solaris2` match on `solaris`.
86
+ node['platform'] =~ %r(^#{platform}) && block.call(check.to_f, version.to_f)
79
87
  end
80
88
  end
81
89
  end
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2013-2014, Seth Vargo <sethvargo@gmail.com>
2
+ # Copyright 2013-2015, Seth Vargo <sethvargo@gmail.com>
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -110,6 +110,7 @@ class Chef
110
110
  node['platform_family'] == 'rhel'
111
111
  end
112
112
  alias_method :redhat?, :rhel?
113
+ alias_method :el?, :rhel?
113
114
 
114
115
  #
115
116
  # Determine if the current node is a member of the slackware family.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2013-2014, Seth Vargo <sethvargo@gmail.com>
2
+ # Copyright 2013-2015, Seth Vargo <sethvargo@gmail.com>
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2013-2014, Seth Vargo <sethvargo@gmail.com>
2
+ # Copyright 2013-2015, Seth Vargo <sethvargo@gmail.com>
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2013-2014, Seth Vargo <sethvargo@gmail.com>
2
+ # Copyright 2013-2015, Seth Vargo <sethvargo@gmail.com>
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2013-2014, Seth Vargo <sethvargo@gmail.com>
2
+ # Copyright 2013-2015, Seth Vargo <sethvargo@gmail.com>
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright 2013-2014, Seth Vargo <sethvargo@gmail.com>
2
+ # Copyright 2013-2015, Seth Vargo <sethvargo@gmail.com>
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -16,6 +16,6 @@
16
16
 
17
17
  class Chef
18
18
  module Sugar
19
- VERSION = '2.5.0'
19
+ VERSION = '3.0.0'
20
20
  end
21
21
  end
data/recipes/default.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  # Cookbook Name:: chef-sugar
3
3
  # Recipe:: default
4
4
  #
5
- # Copyright 2013-2014, Seth Vargo <sethvargo@gmail.com>
5
+ # Copyright 2013-2015, Seth Vargo <sethvargo@gmail.com>
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
8
8
  # you may not use this file except in compliance with the License.
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe Chef::Sugar::Architecture do
4
4
  it_behaves_like 'a chef sugar'
5
5
 
6
- _64_bit_machines = %w(amd64 x86_64 ppc64 s390x ia64 sparc64 aarch64 arch64 arm64)
6
+ _64_bit_machines = %w(amd64 x86_64 ppc64 ppc64le s390x ia64 sparc64 aarch64 arch64 arm64)
7
7
 
8
8
  describe '#_64_bit?' do
9
9
  _64_bit_machines.each do |arch|
@@ -32,4 +32,32 @@ describe Chef::Sugar::Architecture do
32
32
  end
33
33
  end
34
34
  end
35
+
36
+ describe '#intel?' do
37
+ it 'returns true when the system is Intel' do
38
+ node = { 'kernel' => { 'machine' => 'i86pc' } }
39
+ expect(described_class.intel?(node)).to be true
40
+ end
41
+
42
+ _64_bit_machines.each do |arch|
43
+ it "returns false when the system is #{arch}" do
44
+ node = { 'kernel' => { 'machine' => arch } }
45
+ expect(described_class.intel?(node)).to be false
46
+ end
47
+ end
48
+ end
49
+
50
+ describe '#sparc?' do
51
+ it 'returns true when the system is SPARC' do
52
+ node = { 'kernel' => { 'machine' => 'sun4u' } }
53
+ expect(described_class.sparc?(node)).to be true
54
+ end
55
+
56
+ _64_bit_machines.each do |arch|
57
+ it "returns false when the system is #{arch}" do
58
+ node = { 'kernel' => { 'machine' => arch } }
59
+ expect(described_class.sparc?(node)).to be false
60
+ end
61
+ end
62
+ end
35
63
  end
@@ -122,4 +122,16 @@ describe Chef::Sugar::Cloud do
122
122
  expect(described_class.azure?(node)).to be false
123
123
  end
124
124
  end
125
+
126
+ describe '#digitalocean?' do
127
+ it 'is true when the node is on digitalocean' do
128
+ node = { 'digital_ocean' => nil }
129
+ expect(described_class.digitalocean?(node)).to be true
130
+ end
131
+
132
+ it 'is false when the node is not on digitalocean' do
133
+ node = {}
134
+ expect(described_class.digitalocean?(node)).to be false
135
+ end
136
+ end
125
137
  end
@@ -47,7 +47,13 @@ describe Chef::Node do
47
47
  it 'raises an error if a key does not exist' do
48
48
  expect {
49
49
  node.deep_fetch!(:apache2, :not_real)
50
- }.to raise_error(Chef::Node::AttributeDoesNotExistError)
50
+ }.to raise_error(Chef::Node::AttributeDoesNotExistError) { |e|
51
+ expect(e.message).to eq(<<-EOH.gsub(/^ {10}/, ''))
52
+ No attribute `node['apache2']['not_real']' exists on
53
+ the current node. Specifically the `not_real' attribute is not
54
+ defined. Please make sure you have spelled everything correctly.
55
+ EOH
56
+ }
51
57
  end
52
58
  end
53
59
 
@@ -100,6 +106,48 @@ describe Chef::Node do
100
106
  })
101
107
  end
102
108
 
109
+ it 'maintains precedence level into nested calls' do
110
+ node.instance_eval do
111
+ namespace 'apache2', precedence: override do
112
+ namespace 'config' do
113
+ root '/var/www'
114
+ end
115
+ end
116
+ end
117
+
118
+ expect(node.override).to eq({
119
+ 'apache2' => {
120
+ 'config' => { 'root' => '/var/www' }
121
+ }
122
+ })
123
+ end
124
+
125
+ it 'resets precedence to default in subsequent non-nested calls' do
126
+ node.instance_eval do
127
+ namespace 'apache2', precedence: override do
128
+ namespace 'config' do
129
+ root '/var/www'
130
+ end
131
+ end
132
+
133
+ namespace 'php' do
134
+ version '5.3'
135
+ end
136
+ end
137
+
138
+ expect(node.override).to eq({
139
+ 'apache2' => {
140
+ 'config' => { 'root' => '/var/www' }
141
+ }
142
+ })
143
+
144
+ expect(node.default).to eq({
145
+ 'php' => {
146
+ 'version' => '5.3'
147
+ }
148
+ })
149
+ end
150
+
103
151
  it 'can access attributes within itself' do
104
152
  node.instance_eval do
105
153
  namespace 'apache2' do
@@ -269,5 +269,19 @@ describe Chef::Sugar::Platform do
269
269
  expect(described_class.debian_before_wheezy?(node)).to be false
270
270
  end
271
271
  end
272
+
273
+ describe '#solaris_10?' do
274
+ it 'returns true when the version is 5.10' do
275
+ node = { 'platform' => 'solaris2', 'platform_version' => '5.10' }
276
+ expect(described_class.solaris_10?(node)).to be true
277
+ end
278
+ end
279
+
280
+ describe '#solaris_11?' do
281
+ it 'returns true when the version is 5.11' do
282
+ node = { 'platform' => 'solaris2', 'platform_version' => '5.11' }
283
+ expect(described_class.solaris_11?(node)).to be true
284
+ end
285
+ end
272
286
  end
273
287
  end
@@ -1,9 +1,10 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe 'chef-sugar::default' do
4
- let(:chef_run) { ChefSpec::ServerRunner.new.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
5
5
 
6
6
  it 'installs the chef gem' do
7
- expect(chef_run).to install_chef_gem('chef-sugar').with(version: Chef::Sugar::VERSION)
7
+ expect(chef_run).to install_chef_gem('chef-sugar')
8
+ .with(version: Chef::Sugar::VERSION)
8
9
  end
9
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-sugar
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Vargo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-05 00:00:00.000000000 Z
11
+ date: 2015-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -44,42 +44,42 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '4.0'
47
+ version: '4.2'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '4.0'
54
+ version: '4.2'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: test-kitchen
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.1'
61
+ version: '1.3'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.1'
68
+ version: '1.3'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: kitchen-vagrant
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0.14'
75
+ version: '0.15'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0.14'
82
+ version: '0.15'
83
83
  description: A series of helpful sugar of the Chef core and other resources to make
84
84
  a cleaner, more lean recipe DSL, enforce DRY principles, and make writing Chef recipes
85
85
  an awesome experience!
@@ -99,7 +99,6 @@ files:
99
99
  - LICENSE
100
100
  - README.md
101
101
  - Rakefile
102
- - chef-sugar-2.3.2.gem
103
102
  - chef-sugar.gemspec
104
103
  - lib/chef/sugar.rb
105
104
  - lib/chef/sugar/architecture.rb
data/chef-sugar-2.3.2.gem DELETED
Binary file