chef-sugar 1.3.0 → 2.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: 66a357a489b8f06b63b80a4f27388f34dcfabfb8
4
- data.tar.gz: a918f43f869416832f5df31c528d31199177cb24
3
+ metadata.gz: 93e0d5081147bfd7cd05eb8091c27da520a831e8
4
+ data.tar.gz: ae8139070b27cca2c83659be2d1bf23b14e31157
5
5
  SHA512:
6
- metadata.gz: 632e3cf402e28a4e70daf2fa2cb1e1c9c55f5f5fae114c2cd4e3e436ee14f1ecaad627b0ec2c35caf316a89a46c2ce8ada33bc27709716db26c9ca4ff700d589
7
- data.tar.gz: af93b654a34537965675d2e3ded37cdc4dc9339b69c259257f2aabecd878e58056ad5fbe9af6495b700183af4b7f5b0121e7c9564208ea0d13ed873e5dd31fd6
6
+ metadata.gz: 4c2b69db6e0c2ec129c90bb89ba67c48fb65b68cbb83da240ddb22b72d0285b0b019a35733f8f61cb7c32e42ff8f3444a665f259fa04479c088d27a307d40ea9
7
+ data.tar.gz: da5c22f889074fd2e7d8c3f46f9429ae95524c521bd50e31c9af446ea14a4471176968da07579d67c1d7c69df5cd415b9e7edbbfa0c71c36b38470d49e18def4
@@ -0,0 +1,2 @@
1
+ DotPosition:
2
+ EnforcedStyle: leading
@@ -2,8 +2,22 @@ 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
- vx.y.z (not yet released)
6
- -------------------------
5
+ v2.0.0 (2014-06-16)
6
+ -------------------
7
+ ### Breaking
8
+ - Remove `not_linux?` method
9
+ - Remove `not_windows?` method
10
+
11
+ ### Improvements
12
+ - Miscellaneous spelling fixes
13
+ - Update a failing unit test for `installed?`
14
+ - Add Mac OS X to the list of platforms (Yosemite)
15
+ - Upgrade to RSpec 3
16
+ - Fix `which` (and `installed?` and `installed_at_version?`) when given an absolute path
17
+ - Fix `linux?` check to only return true on real linuxes
18
+
19
+ v1.3.0 (2014-05-05)
20
+ -------------------
7
21
  - Check both `$stdout` and `$stderr` in `version_for`
8
22
  - Add additional platform versions
9
23
  - Make `includes_recipe?` a top-level API (instead of just Node)
data/README.md CHANGED
@@ -42,7 +42,7 @@ include_recipe 'chef-sugar::default'
42
42
 
43
43
  Alternatively you can put it in a base role or recipe and it will be included subsequently.
44
44
 
45
- Requiring the Chef Sugar Gem will automatically extend the Recipe DSL, `Chef::Resource`, and `Chef::Provider` with helpful convienence methods.
45
+ Requiring the Chef Sugar Gem will automatically extend the Recipe DSL, `Chef::Resource`, and `Chef::Provider` with helpful convenience methods.
46
46
 
47
47
  ### Module Method
48
48
  If you are working outside of the Recipe DSL, you can use the module methods instead of the Recipe DSL. In general, the module methods have the same name as their Recipe-DSL counterparts, but require the node object as a parameter. For example:
@@ -181,7 +181,7 @@ end
181
181
  ```
182
182
 
183
183
  ### Constraints
184
- - `constaints` - create a new contraint (or requirement) that can be used to test version validations.
184
+ - `constraints` - create a new constraint (or requirement) that can be used to test version validations.
185
185
  - `chef_version` - (DSL only) a wrapper for `version(Chef::VERSION)`
186
186
  - `version` - create a new version that can be used to test constraint validation.
187
187
 
@@ -210,7 +210,7 @@ end
210
210
  ```
211
211
 
212
212
  ### Kernel
213
- - `require_chef_gem` - "safely" require a gem. Loading a gem with Chef is sometimes difficult and confusing. The errors that Chef produces are also sometimes not very intuitive. In the event you require a gem to exist on the system, you can use `require_chef_gem`, which wil attempt to require the gem and then produce helpful output if the gem is not installed:
213
+ - `require_chef_gem` - "safely" require a gem. Loading a gem with Chef is sometimes difficult and confusing. The errors that Chef produces are also sometimes not very intuitive. In the event you require a gem to exist on the system, you can use `require_chef_gem`, which will attempt to require the gem and then produce helpful output if the gem is not installed:
214
214
 
215
215
  Chef could not load the gem `#{name}'! You may need to install the gem
216
216
  manually with `gem install #{name}', or include a recipe before you can
@@ -320,7 +320,7 @@ node['attribute'] = if windows?
320
320
  ```
321
321
 
322
322
  ### Ruby
323
- **Note:** The applies to the the Ruby found at `node['languages']['ruby']`.
323
+ **Note:** The applies to the Ruby found at `node['languages']['ruby']`.
324
324
 
325
325
  - `ruby_20?`
326
326
  - `ruby_19?`
@@ -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', '~> 3.0'
30
+ spec.add_development_dependency 'chefspec', '~> 4.0'
31
31
  spec.add_development_dependency 'test-kitchen', '~> 1.1'
32
32
  spec.add_development_dependency 'kitchen-vagrant', '~> 0.14'
33
33
  end
@@ -36,6 +36,7 @@ class Chef
36
36
  'lion' => '10.7',
37
37
  'mountain_lion' => '10.8',
38
38
  'mavericks' => '10.9',
39
+ 'yosemite' => '10.10',
39
40
  },
40
41
  'ubuntu' => {
41
42
  'lucid' => '10.04',
@@ -143,7 +143,6 @@ class Chef
143
143
  def windows?(node)
144
144
  node['platform_family'] == 'windows'
145
145
  end
146
- alias_method :not_linux?, :windows?
147
146
 
148
147
  #
149
148
  # Determine if the current system is a linux derivative
@@ -153,9 +152,16 @@ class Chef
153
152
  # @return [Boolean]
154
153
  #
155
154
  def linux?(node)
156
- !windows?(node)
155
+ %w(
156
+ arch
157
+ debian
158
+ fedora
159
+ gentoo
160
+ rhel
161
+ slackware
162
+ suse
163
+ ).include?(node['platform_family'])
157
164
  end
158
- alias_method :not_windows?, :linux?
159
165
  end
160
166
 
161
167
  module DSL
@@ -15,6 +15,7 @@
15
15
  #
16
16
 
17
17
  require 'mixlib/shellout'
18
+ require 'pathname'
18
19
 
19
20
  class Chef
20
21
  module Sugar
@@ -30,14 +31,18 @@ class Chef
30
31
  # @return [String, nil]
31
32
  #
32
33
  def which(cmd)
33
- paths = ENV['PATH'].split(::File::PATH_SEPARATOR) + %w(/bin /usr/bin /sbin /usr/sbin)
34
+ if Pathname.new(cmd).absolute?
35
+ File.executable?(cmd) ? cmd : nil
36
+ else
37
+ paths = ENV['PATH'].split(::File::PATH_SEPARATOR) + %w(/bin /usr/bin /sbin /usr/sbin)
34
38
 
35
- paths.each do |path|
36
- possible = File.join(path, cmd)
37
- return possible if File.executable?(possible)
38
- end
39
+ paths.each do |path|
40
+ possible = File.join(path, cmd)
41
+ return possible if File.executable?(possible)
42
+ end
39
43
 
40
- nil
44
+ nil
45
+ end
41
46
  end
42
47
 
43
48
  #
@@ -16,6 +16,6 @@
16
16
 
17
17
  class Chef
18
18
  module Sugar
19
- VERSION = '1.3.0'
19
+ VERSION = '2.0.0'
20
20
  end
21
21
  end
@@ -14,4 +14,4 @@ For the most up-to-date information and documentation, please visit the [Chef
14
14
  Sugar project page on GitHub](https://github.com/sethvargo/chef-sugar).
15
15
  EOH
16
16
 
17
- version '1.3.0'
17
+ version '2.0.0'
@@ -18,7 +18,7 @@
18
18
  #
19
19
 
20
20
  chef_gem('chef-sugar') do
21
- version '1.2.6'
21
+ version '2.0.0'
22
22
  action :nothing
23
23
  end.run_action(:install)
24
24
 
@@ -11,7 +11,6 @@ RSpec.configure do |config|
11
11
  end
12
12
 
13
13
  # Focus groups
14
- config.treat_symbols_as_metadata_keys_with_true_values = true
15
14
  config.filter_run(focus: true)
16
15
  config.run_all_when_everything_filtered = true
17
16
 
@@ -6,24 +6,24 @@ describe Chef::Sugar::Architecture do
6
6
  describe '#_64_bit?' do
7
7
  it 'returns true when the system is 64 bit' do
8
8
  node = { 'kernel' => { 'machine' => 'x86_64' } }
9
- expect(described_class._64_bit?(node)).to be_true
9
+ expect(described_class._64_bit?(node)).to be_truthy
10
10
  end
11
11
 
12
12
  it 'returns false when the system is not 64 bit' do
13
13
  node = { 'kernel' => { 'machine' => 'i386' } }
14
- expect(described_class._64_bit?(node)).to be_false
14
+ expect(described_class._64_bit?(node)).to be_falsey
15
15
  end
16
16
  end
17
17
 
18
18
  describe '#_32_bit?' do
19
19
  it 'returns true when the system is 32 bit' do
20
20
  node = { 'kernel' => { 'machine' => 'i386' } }
21
- expect(described_class._32_bit?(node)).to be_true
21
+ expect(described_class._32_bit?(node)).to be_truthy
22
22
  end
23
23
 
24
24
  it 'returns false when the system is not 32 bit' do
25
25
  node = { 'kernel' => { 'machine' => 'x86_64' } }
26
- expect(described_class._32_bit?(node)).to be_false
26
+ expect(described_class._32_bit?(node)).to be_falsey
27
27
  end
28
28
  end
29
29
  end
@@ -6,120 +6,120 @@ describe Chef::Sugar::Cloud do
6
6
  describe '#cloud?' do
7
7
  it 'is true when the node is on cloud' do
8
8
  node = { 'cloud' => nil }
9
- expect(described_class.cloud?(node)).to be_true
9
+ expect(described_class.cloud?(node)).to be_truthy
10
10
  end
11
11
 
12
12
  it 'is false when the node is not on cloud' do
13
13
  node = {}
14
- expect(described_class.cloud?(node)).to be_false
14
+ expect(described_class.cloud?(node)).to be_falsey
15
15
  end
16
16
  end
17
17
 
18
18
  describe '#ec2?' do
19
19
  it 'is true when the node is on ec2' do
20
20
  node = { 'ec2' => nil }
21
- expect(described_class.ec2?(node)).to be_true
21
+ expect(described_class.ec2?(node)).to be_truthy
22
22
  end
23
23
 
24
24
  it 'is false when the node is not on ec2' do
25
25
  node = {}
26
- expect(described_class.ec2?(node)).to be_false
26
+ expect(described_class.ec2?(node)).to be_falsey
27
27
  end
28
28
  end
29
29
 
30
30
  describe '#gce?' do
31
31
  it 'is true when the node is on gce' do
32
32
  node = { 'gce' => nil }
33
- expect(described_class.gce?(node)).to be_true
33
+ expect(described_class.gce?(node)).to be_truthy
34
34
  end
35
35
 
36
36
  it 'is false when the node is not on gce' do
37
37
  node = {}
38
- expect(described_class.gce?(node)).to be_false
38
+ expect(described_class.gce?(node)).to be_falsey
39
39
  end
40
40
  end
41
41
 
42
42
  describe '#rackspace?' do
43
43
  it 'is true when the node is on rackspace' do
44
44
  node = { 'rackspace' => nil }
45
- expect(described_class.rackspace?(node)).to be_true
45
+ expect(described_class.rackspace?(node)).to be_truthy
46
46
  end
47
47
 
48
48
  it 'is false when the node is not on rackspace' do
49
49
  node = {}
50
- expect(described_class.rackspace?(node)).to be_false
50
+ expect(described_class.rackspace?(node)).to be_falsey
51
51
  end
52
52
  end
53
53
 
54
54
  describe '#eucalyptus?' do
55
55
  it 'is true when the node is on eucalyptus' do
56
56
  node = { 'eucalyptus' => nil }
57
- expect(described_class.eucalyptus?(node)).to be_true
57
+ expect(described_class.eucalyptus?(node)).to be_truthy
58
58
  end
59
59
 
60
60
  it 'is false when the node is not on eucalyptus' do
61
61
  node = {}
62
- expect(described_class.eucalyptus?(node)).to be_false
62
+ expect(described_class.eucalyptus?(node)).to be_falsey
63
63
  end
64
64
  end
65
65
 
66
66
  describe '#euca?' do
67
67
  it 'is true when the node is on eucalyptus' do
68
68
  node = { 'eucalyptus' => nil }
69
- expect(described_class.euca?(node)).to be_true
69
+ expect(described_class.euca?(node)).to be_truthy
70
70
  end
71
71
 
72
72
  it 'is false when the node is not on eucalyptus' do
73
73
  node = {}
74
- expect(described_class.euca?(node)).to be_false
74
+ expect(described_class.euca?(node)).to be_falsey
75
75
  end
76
76
  end
77
77
 
78
78
  describe '#linode?' do
79
79
  it 'is true when the node is on linode' do
80
80
  node = { 'linode' => nil }
81
- expect(described_class.linode?(node)).to be_true
81
+ expect(described_class.linode?(node)).to be_truthy
82
82
  end
83
83
 
84
84
  it 'is false when the node is not on linode' do
85
85
  node = {}
86
- expect(described_class.linode?(node)).to be_false
86
+ expect(described_class.linode?(node)).to be_falsey
87
87
  end
88
88
  end
89
89
 
90
90
  describe '#openstack?' do
91
91
  it 'is true when the node is on openstack' do
92
92
  node = { 'openstack' => nil }
93
- expect(described_class.openstack?(node)).to be_true
93
+ expect(described_class.openstack?(node)).to be_truthy
94
94
  end
95
95
 
96
96
  it 'is false when the node is not on openstack' do
97
97
  node = {}
98
- expect(described_class.openstack?(node)).to be_false
98
+ expect(described_class.openstack?(node)).to be_falsey
99
99
  end
100
100
  end
101
101
 
102
102
  describe '#cloudstack?' do
103
103
  it 'is true when the node is on cloudstack' do
104
104
  node = { 'cloudstack' => nil }
105
- expect(described_class.cloudstack?(node)).to be_true
105
+ expect(described_class.cloudstack?(node)).to be_truthy
106
106
  end
107
107
 
108
108
  it 'is false when the node is not on cloudstack' do
109
109
  node = {}
110
- expect(described_class.cloudstack?(node)).to be_false
110
+ expect(described_class.cloudstack?(node)).to be_falsey
111
111
  end
112
112
  end
113
113
 
114
114
  describe '#azure?' do
115
115
  it 'is true when the node is on azure' do
116
116
  node = { 'azure' => nil }
117
- expect(described_class.azure?(node)).to be_true
117
+ expect(described_class.azure?(node)).to be_truthy
118
118
  end
119
119
 
120
120
  it 'is false when the node is not on azure' do
121
121
  node = {}
122
- expect(described_class.azure?(node)).to be_false
122
+ expect(described_class.azure?(node)).to be_falsey
123
123
  end
124
124
  end
125
125
  end
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe Chef::Sugar::DataBag do
4
4
  describe '#encrypted_data_bag_item' do
5
- before { Chef::EncryptedDataBagItem.stub(:load) }
5
+ before { allow(Chef::EncryptedDataBagItem).to receive(:load) }
6
6
 
7
7
  it 'loads the encrypted data bag item' do
8
8
  expect(Chef::EncryptedDataBagItem).to receive(:load)
@@ -13,8 +13,8 @@ describe Chef::Sugar::DataBag do
13
13
 
14
14
  context 'when Chef::Config is set' do
15
15
  it 'loads the secret key from the Chef::Config' do
16
- Chef::Config.stub(:[]).with(:encrypted_data_bag_secret).and_return('/data/path')
17
- File.stub(:read).with('/data/path').and_return('B@c0n')
16
+ allow(Chef::Config).to receive(:[]).with(:encrypted_data_bag_secret).and_return('/data/path')
17
+ allow(File).to receive(:read).with('/data/path').and_return('B@c0n')
18
18
 
19
19
  expect(Chef::EncryptedDataBagItem).to receive(:load)
20
20
  .with('accounts', 'github', 'B@c0n')
@@ -37,7 +37,7 @@ describe Chef::Sugar::DataBag do
37
37
 
38
38
  context 'when the environment exists' do
39
39
  it 'loads the data from the environment' do
40
- Chef::EncryptedDataBagItem.stub(:load).and_return(
40
+ allow(Chef::EncryptedDataBagItem).to receive(:load).and_return(
41
41
  'production' => {
42
42
  'username' => 'sethvargo',
43
43
  'password' => 'bacon',
@@ -53,7 +53,7 @@ describe Chef::Sugar::DataBag do
53
53
 
54
54
  context 'when the environment does not exist' do
55
55
  it 'loads the data from the default bucket' do
56
- Chef::EncryptedDataBagItem.stub(:load).and_return(
56
+ allow(Chef::EncryptedDataBagItem).to receive(:load).and_return(
57
57
  'staging' => {
58
58
  'username' => 'sethvargo',
59
59
  'password' => 'bacon',
@@ -9,8 +9,8 @@ describe Chef::Sugar::Kernel do
9
9
  end
10
10
 
11
11
  it 'loads the gem' do
12
- Chef::Sugar::Kernel.stub(:require).and_return(true)
13
- expect(described_class.require_chef_gem('bacon')).to be_true
12
+ allow(Chef::Sugar::Kernel).to receive(:require).and_return(true)
13
+ expect(described_class.require_chef_gem('bacon')).to be_truthy
14
14
  end
15
15
  end
16
16
  end
@@ -3,15 +3,15 @@ require 'spec_helper'
3
3
  describe Chef::Node do
4
4
  describe '#in?' do
5
5
  it 'returns true when the node is in the environment' do
6
- subject.stub(:chef_environment).and_return('production')
7
- expect(subject.in?('production')).to be_true
8
- expect(subject.in?(/production$/)).to be_true
6
+ allow(subject).to receive(:chef_environment).and_return('production')
7
+ expect(subject.in?('production')).to be_truthy
8
+ expect(subject.in?(/production$/)).to be_truthy
9
9
  end
10
10
 
11
11
  it 'returns false when the node is not in the environment' do
12
- subject.stub(:chef_environment).and_return('staging')
13
- expect(subject.in?('production')).to be_false
14
- expect(subject.in?(/production$/)).to be_false
12
+ allow(subject).to receive(:chef_environment).and_return('staging')
13
+ expect(subject.in?('production')).to be_falsey
14
+ expect(subject.in?(/production$/)).to be_falsey
15
15
  end
16
16
  end
17
17
 
@@ -6,144 +6,159 @@ describe Chef::Sugar::PlatformFamily do
6
6
  describe '#arch_linux?' do
7
7
  it 'returns true when the platform_family is arch linux' do
8
8
  node = { 'platform_family' => 'arch' }
9
- expect(described_class.arch_linux?(node)).to be_true
9
+ expect(described_class.arch_linux?(node)).to be_truthy
10
10
  end
11
11
 
12
12
  it 'returns false when the platform_family is not arch linux' do
13
13
  node = { 'platform_family' => 'windows' }
14
- expect(described_class.arch_linux?(node)).to be_false
14
+ expect(described_class.arch_linux?(node)).to be_falsey
15
15
  end
16
16
  end
17
17
 
18
18
  describe '#debian?' do
19
19
  it 'returns true when the platform_family is debian' do
20
20
  node = { 'platform_family' => 'debian' }
21
- expect(described_class.debian?(node)).to be_true
21
+ expect(described_class.debian?(node)).to be_truthy
22
22
  end
23
23
 
24
24
  it 'returns false when the platform_family is not debian' do
25
25
  node = { 'platform_family' => 'windows' }
26
- expect(described_class.debian?(node)).to be_false
26
+ expect(described_class.debian?(node)).to be_falsey
27
27
  end
28
28
  end
29
29
 
30
30
  describe '#fedora?' do
31
31
  it 'returns true when the platform_family is fedora' do
32
32
  node = { 'platform_family' => 'fedora' }
33
- expect(described_class.fedora?(node)).to be_true
33
+ expect(described_class.fedora?(node)).to be_truthy
34
34
  end
35
35
 
36
36
  it 'returns false when the platform_family is not fedora' do
37
37
  node = { 'platform_family' => 'windows' }
38
- expect(described_class.fedora?(node)).to be_false
38
+ expect(described_class.fedora?(node)).to be_falsey
39
39
  end
40
40
  end
41
41
 
42
42
  describe '#freebsd?' do
43
43
  it 'returns true when the platform_family is freebsd' do
44
44
  node = { 'platform_family' => 'freebsd' }
45
- expect(described_class.freebsd?(node)).to be_true
45
+ expect(described_class.freebsd?(node)).to be_truthy
46
46
  end
47
47
 
48
48
  it 'returns false when the platform_family is not freebsd' do
49
49
  node = { 'platform_family' => 'windows' }
50
- expect(described_class.freebsd?(node)).to be_false
50
+ expect(described_class.freebsd?(node)).to be_falsey
51
51
  end
52
52
  end
53
53
 
54
54
  describe '#gentoo?' do
55
55
  it 'returns true when the platform_family is gentoo' do
56
56
  node = { 'platform_family' => 'gentoo' }
57
- expect(described_class.gentoo?(node)).to be_true
57
+ expect(described_class.gentoo?(node)).to be_truthy
58
58
  end
59
59
 
60
60
  it 'returns false when the platform_family is not gentoo' do
61
61
  node = { 'platform_family' => 'windows' }
62
- expect(described_class.gentoo?(node)).to be_false
62
+ expect(described_class.gentoo?(node)).to be_falsey
63
63
  end
64
64
  end
65
65
 
66
66
  describe '#mac_os_x?' do
67
67
  it 'returns true when the platform_family is mac_os_x' do
68
68
  node = { 'platform_family' => 'mac_os_x' }
69
- expect(described_class.mac_os_x?(node)).to be_true
69
+ expect(described_class.mac_os_x?(node)).to be_truthy
70
70
  end
71
71
 
72
72
  it 'returns false when the platform_family is not mac_os_x' do
73
73
  node = { 'platform_family' => 'windows' }
74
- expect(described_class.mac_os_x?(node)).to be_false
74
+ expect(described_class.mac_os_x?(node)).to be_falsey
75
75
  end
76
76
  end
77
77
 
78
78
  describe '#openbsd?' do
79
79
  it 'returns true when the platform_family is openbsd' do
80
80
  node = { 'platform_family' => 'openbsd' }
81
- expect(described_class.openbsd?(node)).to be_true
81
+ expect(described_class.openbsd?(node)).to be_truthy
82
82
  end
83
83
 
84
84
  it 'returns false when the platform_family is not openbsd' do
85
85
  node = { 'platform_family' => 'windows' }
86
- expect(described_class.openbsd?(node)).to be_false
86
+ expect(described_class.openbsd?(node)).to be_falsey
87
87
  end
88
88
  end
89
89
 
90
90
  describe '#rhel?' do
91
91
  it 'returns true when the platform_family is rhel' do
92
92
  node = { 'platform_family' => 'rhel' }
93
- expect(described_class.rhel?(node)).to be_true
93
+ expect(described_class.rhel?(node)).to be_truthy
94
94
  end
95
95
 
96
96
  it 'returns false when the platform_family is not rhel' do
97
97
  node = { 'platform_family' => 'windows' }
98
- expect(described_class.rhel?(node)).to be_false
98
+ expect(described_class.rhel?(node)).to be_falsey
99
99
  end
100
100
  end
101
101
 
102
102
  describe '#slackware?' do
103
103
  it 'returns true when the platform_family is slackware' do
104
104
  node = { 'platform_family' => 'slackware' }
105
- expect(described_class.slackware?(node)).to be_true
105
+ expect(described_class.slackware?(node)).to be_truthy
106
106
  end
107
107
 
108
108
  it 'returns false when the platform_family is not slackware' do
109
109
  node = { 'platform_family' => 'windows' }
110
- expect(described_class.slackware?(node)).to be_false
110
+ expect(described_class.slackware?(node)).to be_falsey
111
111
  end
112
112
  end
113
113
 
114
114
  describe '#suse?' do
115
115
  it 'returns true when the platform_family is suse' do
116
116
  node = { 'platform_family' => 'suse' }
117
- expect(described_class.suse?(node)).to be_true
117
+ expect(described_class.suse?(node)).to be_truthy
118
118
  end
119
119
 
120
120
  it 'returns false when the platform_family is not suse' do
121
121
  node = { 'platform_family' => 'windows' }
122
- expect(described_class.suse?(node)).to be_false
122
+ expect(described_class.suse?(node)).to be_falsey
123
123
  end
124
124
  end
125
125
 
126
126
  describe '#windows?' do
127
127
  it 'returns true when the platform_family is windows' do
128
128
  node = { 'platform_family' => 'windows' }
129
- expect(described_class.windows?(node)).to be_true
129
+ expect(described_class.windows?(node)).to be_truthy
130
130
  end
131
131
 
132
132
  it 'returns false when the platform_family is not windows' do
133
133
  node = { 'platform_family' => 'debian' }
134
- expect(described_class.windows?(node)).to be_false
134
+ expect(described_class.windows?(node)).to be_falsey
135
135
  end
136
136
  end
137
137
 
138
138
  describe '#linux?' do
139
- it 'returns true when the platform_family is linux-based' do
139
+ it 'returns true when the platform_family is Debian' do
140
140
  node = { 'platform_family' => 'debian' }
141
- expect(described_class.debian?(node)).to be_true
141
+ expect(described_class.linux?(node)).to be_truthy
142
142
  end
143
143
 
144
- it 'returns false when the platform_family is not linux-based' do
144
+ it 'returns true when the platform_family is RedHat' do
145
+ node = { 'platform_family' => 'rhel' }
146
+ expect(described_class.linux?(node)).to be_truthy
147
+ end
148
+
149
+ it 'returns false when the platform_family is Windows' do
145
150
  node = { 'platform_family' => 'windows' }
146
- expect(described_class.debian?(node)).to be_false
151
+ expect(described_class.linux?(node)).to be_falsey
152
+ end
153
+
154
+ it 'returns false when the platform_family is OSX' do
155
+ node = { 'platform_family' => 'mac_os_x' }
156
+ expect(described_class.linux?(node)).to be_falsey
157
+ end
158
+
159
+ it 'returns false when the platform_family is OpenBSD' do
160
+ node = { 'platform_family' => 'openbsd' }
161
+ expect(described_class.linux?(node)).to be_falsey
147
162
  end
148
163
  end
149
164
  end
@@ -6,84 +6,84 @@ describe Chef::Sugar::Platform do
6
6
  describe '#linux_mint?' do
7
7
  it 'returns true when the platform is linux mint' do
8
8
  node = { 'platform' => 'linuxmint' }
9
- expect(described_class.linux_mint?(node)).to be_true
9
+ expect(described_class.linux_mint?(node)).to be_truthy
10
10
  end
11
11
 
12
12
  it 'returns false when the platform is not linux mint' do
13
13
  node = { 'platform' => 'windows' }
14
- expect(described_class.linux_mint?(node)).to be_false
14
+ expect(described_class.linux_mint?(node)).to be_falsey
15
15
  end
16
16
  end
17
17
 
18
18
  describe '#ubuntu?' do
19
19
  it 'returns true when the platform is ubuntu' do
20
20
  node = { 'platform' => 'ubuntu' }
21
- expect(described_class.ubuntu?(node)).to be_true
21
+ expect(described_class.ubuntu?(node)).to be_truthy
22
22
  end
23
23
 
24
24
  it 'returns false when the platform is not ubuntu' do
25
25
  node = { 'platform' => 'windows' }
26
- expect(described_class.ubuntu?(node)).to be_false
26
+ expect(described_class.ubuntu?(node)).to be_falsey
27
27
  end
28
28
  end
29
29
 
30
30
  describe '#amazon_linux?' do
31
31
  it 'returns true when the platform is amazon linux' do
32
32
  node = { 'platform' => 'amazon' }
33
- expect(described_class.amazon_linux?(node)).to be_true
33
+ expect(described_class.amazon_linux?(node)).to be_truthy
34
34
  end
35
35
 
36
36
  it 'returns false when the platform is not amazon linux' do
37
37
  node = { 'platform' => 'windows' }
38
- expect(described_class.amazon_linux?(node)).to be_false
38
+ expect(described_class.amazon_linux?(node)).to be_falsey
39
39
  end
40
40
  end
41
41
 
42
42
  describe '#centos?' do
43
43
  it 'returns true when the platform is centos' do
44
44
  node = { 'platform' => 'centos' }
45
- expect(described_class.centos?(node)).to be_true
45
+ expect(described_class.centos?(node)).to be_truthy
46
46
  end
47
47
 
48
48
  it 'returns false when the platform is not centos' do
49
49
  node = { 'platform' => 'windows' }
50
- expect(described_class.centos?(node)).to be_false
50
+ expect(described_class.centos?(node)).to be_falsey
51
51
  end
52
52
  end
53
53
 
54
54
  describe '#oracle_linux?' do
55
55
  it 'returns true when the platform is oracle linux' do
56
56
  node = { 'platform' => 'oracle' }
57
- expect(described_class.oracle_linux?(node)).to be_true
57
+ expect(described_class.oracle_linux?(node)).to be_truthy
58
58
  end
59
59
 
60
60
  it 'returns false when the platform is not oracle linux' do
61
61
  node = { 'platform' => 'windows' }
62
- expect(described_class.oracle_linux?(node)).to be_false
62
+ expect(described_class.oracle_linux?(node)).to be_falsey
63
63
  end
64
64
  end
65
65
 
66
66
  describe '#scientific_linux?' do
67
67
  it 'returns true when the platform is scientific linux' do
68
68
  node = { 'platform' => 'scientific' }
69
- expect(described_class.scientific_linux?(node)).to be_true
69
+ expect(described_class.scientific_linux?(node)).to be_truthy
70
70
  end
71
71
 
72
72
  it 'returns false when the platform is not scientific linux' do
73
73
  node = { 'platform' => 'windows' }
74
- expect(described_class.scientific_linux?(node)).to be_false
74
+ expect(described_class.scientific_linux?(node)).to be_falsey
75
75
  end
76
76
  end
77
77
 
78
78
  describe '#redhat_enterprise_linux?' do
79
79
  it 'returns true when the platform is redhat enterprise linux' do
80
80
  node = { 'platform' => 'enterprise' }
81
- expect(described_class.redhat_enterprise_linux?(node)).to be_true
81
+ expect(described_class.redhat_enterprise_linux?(node)).to be_truthy
82
82
  end
83
83
 
84
84
  it 'returns false when the platform is not redhat enterprise linux' do
85
85
  node = { 'platform' => 'windows' }
86
- expect(described_class.redhat_enterprise_linux?(node)).to be_false
86
+ expect(described_class.redhat_enterprise_linux?(node)).to be_falsey
87
87
  end
88
88
  end
89
89
 
@@ -91,134 +91,134 @@ describe Chef::Sugar::Platform do
91
91
  describe '#ubuntu_after_lucid?' do
92
92
  it 'returns true when the version is later than 10.04' do
93
93
  node = { 'platform' => 'ubuntu', 'platform_version' => '10.10' }
94
- expect(described_class.ubuntu_after_lucid?(node)).to be_true
94
+ expect(described_class.ubuntu_after_lucid?(node)).to be_truthy
95
95
  end
96
96
 
97
97
  it 'returns false when the version is 10.04' do
98
98
  node = { 'platform' => 'ubuntu', 'platform_version' => '10.04' }
99
- expect(described_class.ubuntu_after_lucid?(node)).to be_false
99
+ expect(described_class.ubuntu_after_lucid?(node)).to be_falsey
100
100
  end
101
101
 
102
102
  it 'returns false when the version is a patch release higher than 10.04' do
103
103
  node = { 'platform' => 'ubuntu', 'platform_version' => '10.04.4' }
104
- expect(described_class.ubuntu_after_lucid?(node)).to be_false
104
+ expect(described_class.ubuntu_after_lucid?(node)).to be_falsey
105
105
  end
106
106
 
107
107
  it 'returns false when the version is less than 10.04' do
108
108
  node = { 'platform' => 'ubuntu', 'platform_version' => '9.10' }
109
- expect(described_class.ubuntu_after_lucid?(node)).to be_false
109
+ expect(described_class.ubuntu_after_lucid?(node)).to be_falsey
110
110
  end
111
111
  end
112
112
 
113
113
  describe '#ubuntu_after_or_at_lucid?' do
114
114
  it 'returns true when the version is later than 10.04' do
115
115
  node = { 'platform' => 'ubuntu', 'platform_version' => '10.10' }
116
- expect(described_class.ubuntu_after_or_at_lucid?(node)).to be_true
116
+ expect(described_class.ubuntu_after_or_at_lucid?(node)).to be_truthy
117
117
  end
118
118
 
119
119
  it 'returns true when the version is 10.04' do
120
120
  node = { 'platform' => 'ubuntu', 'platform_version' => '10.04' }
121
- expect(described_class.ubuntu_after_or_at_lucid?(node)).to be_true
121
+ expect(described_class.ubuntu_after_or_at_lucid?(node)).to be_truthy
122
122
  end
123
123
 
124
124
  it 'returns true when the version is a patch release higher than 10.04' do
125
125
  node = { 'platform' => 'ubuntu', 'platform_version' => '10.04.4' }
126
- expect(described_class.ubuntu_after_or_at_lucid?(node)).to be_true
126
+ expect(described_class.ubuntu_after_or_at_lucid?(node)).to be_truthy
127
127
  end
128
128
 
129
129
  it 'returns false when the version is less than 10.04' do
130
130
  node = { 'platform' => 'ubuntu', 'platform_version' => '9.10' }
131
- expect(described_class.ubuntu_after_or_at_lucid?(node)).to be_false
131
+ expect(described_class.ubuntu_after_or_at_lucid?(node)).to be_falsey
132
132
  end
133
133
  end
134
134
 
135
135
  describe '#ubuntu_lucid?' do
136
136
  it 'returns false when the version is later than 10.04' do
137
137
  node = { 'platform' => 'ubuntu', 'platform_version' => '10.10' }
138
- expect(described_class.ubuntu_lucid?(node)).to be_false
138
+ expect(described_class.ubuntu_lucid?(node)).to be_falsey
139
139
  end
140
140
 
141
141
  it 'returns true when the version is 10.04' do
142
142
  node = { 'platform' => 'ubuntu', 'platform_version' => '10.04' }
143
- expect(described_class.ubuntu_lucid?(node)).to be_true
143
+ expect(described_class.ubuntu_lucid?(node)).to be_truthy
144
144
  end
145
145
 
146
146
  it 'returns true when the version is a patch release higher than 10.04' do
147
147
  node = { 'platform' => 'ubuntu', 'platform_version' => '10.04.4' }
148
- expect(described_class.ubuntu_lucid?(node)).to be_true
148
+ expect(described_class.ubuntu_lucid?(node)).to be_truthy
149
149
  end
150
150
 
151
151
  it 'returns false when the version is less than 10.04' do
152
152
  node = { 'platform' => 'ubuntu', 'platform_version' => '9.10' }
153
- expect(described_class.ubuntu_lucid?(node)).to be_false
153
+ expect(described_class.ubuntu_lucid?(node)).to be_falsey
154
154
  end
155
155
  end
156
156
 
157
157
  describe '#ubuntu_before_lucid?' do
158
158
  it 'returns false when the version is later than 10.04' do
159
159
  node = { 'platform' => 'ubuntu', 'platform_version' => '10.10' }
160
- expect(described_class.ubuntu_before_lucid?(node)).to be_false
160
+ expect(described_class.ubuntu_before_lucid?(node)).to be_falsey
161
161
  end
162
162
 
163
163
  it 'returns false when the version is 10.04' do
164
164
  node = { 'platform' => 'ubuntu', 'platform_version' => '10.04' }
165
- expect(described_class.ubuntu_before_lucid?(node)).to be_false
165
+ expect(described_class.ubuntu_before_lucid?(node)).to be_falsey
166
166
  end
167
167
 
168
168
  it 'returns false when the version is a patch release higher than 10.04' do
169
169
  node = { 'platform' => 'ubuntu', 'platform_version' => '10.04.4' }
170
- expect(described_class.ubuntu_before_lucid?(node)).to be_false
170
+ expect(described_class.ubuntu_before_lucid?(node)).to be_falsey
171
171
  end
172
172
 
173
173
  it 'returns true when the version is less than 10.04' do
174
174
  node = { 'platform' => 'ubuntu', 'platform_version' => '9.10' }
175
- expect(described_class.ubuntu_before_lucid?(node)).to be_true
175
+ expect(described_class.ubuntu_before_lucid?(node)).to be_truthy
176
176
  end
177
177
  end
178
178
 
179
179
  describe '#ubuntu_before_or_at_lucid?' do
180
180
  it 'returns false when the version is later than 10.04' do
181
181
  node = { 'platform' => 'ubuntu', 'platform_version' => '10.10' }
182
- expect(described_class.ubuntu_before_or_at_lucid?(node)).to be_false
182
+ expect(described_class.ubuntu_before_or_at_lucid?(node)).to be_falsey
183
183
  end
184
184
 
185
185
  it 'returns true when the version is 10.04' do
186
186
  node = { 'platform' => 'ubuntu', 'platform_version' => '10.04' }
187
- expect(described_class.ubuntu_before_or_at_lucid?(node)).to be_true
187
+ expect(described_class.ubuntu_before_or_at_lucid?(node)).to be_truthy
188
188
  end
189
189
 
190
190
  it 'returns true when the version is a patch release higher than 10.04' do
191
191
  node = { 'platform' => 'ubuntu', 'platform_version' => '10.04.4' }
192
- expect(described_class.ubuntu_before_or_at_lucid?(node)).to be_true
192
+ expect(described_class.ubuntu_before_or_at_lucid?(node)).to be_truthy
193
193
  end
194
194
 
195
195
  it 'returns true when the version is less than 10.04' do
196
196
  node = { 'platform' => 'ubuntu', 'platform_version' => '9.10' }
197
- expect(described_class.ubuntu_before_or_at_lucid?(node)).to be_true
197
+ expect(described_class.ubuntu_before_or_at_lucid?(node)).to be_truthy
198
198
  end
199
199
  end
200
200
 
201
201
  describe '#debian_wheezy?' do
202
202
  it 'returns true when the version is a subset of the major' do
203
203
  node = { 'platform' => 'debian', 'platform_version' => '7.1' }
204
- expect(described_class.debian_wheezy?(node)).to be_true
204
+ expect(described_class.debian_wheezy?(node)).to be_truthy
205
205
  end
206
206
 
207
207
  it 'returns false when the version is not the major' do
208
208
  node = { 'platform' => 'debian', 'platform_version' => '6.1' }
209
- expect(described_class.debian_wheezy?(node)).to be_false
209
+ expect(described_class.debian_wheezy?(node)).to be_falsey
210
210
  end
211
211
  end
212
212
 
213
213
  describe '#debian_before_wheezy?' do
214
214
  it 'returns true when the version is a less than the major' do
215
215
  node = { 'platform' => 'debian', 'platform_version' => '6.5' }
216
- expect(described_class.debian_before_wheezy?(node)).to be_true
216
+ expect(described_class.debian_before_wheezy?(node)).to be_truthy
217
217
  end
218
218
 
219
219
  it 'returns false when the version is not less than the major' do
220
220
  node = { 'platform' => 'debian', 'platform_version' => '8.0' }
221
- expect(described_class.debian_before_wheezy?(node)).to be_false
221
+ expect(described_class.debian_before_wheezy?(node)).to be_falsey
222
222
  end
223
223
  end
224
224
  end
@@ -6,34 +6,34 @@ describe Chef::Sugar::Ruby do
6
6
  describe '#ruby_20?' do
7
7
  it 'returns true when the ruby version is 2.0' do
8
8
  node = { 'languages' => { 'ruby' => { 'version' => '2.0.0' } } }
9
- expect(described_class.ruby_20?(node)).to be_true
9
+ expect(described_class.ruby_20?(node)).to be_truthy
10
10
  end
11
11
 
12
12
  it 'returns true when the ruby version is less than 2.0' do
13
13
  node = { 'languages' => { 'ruby' => { 'version' => '1.9.3' } } }
14
- expect(described_class.ruby_20?(node)).to be_false
14
+ expect(described_class.ruby_20?(node)).to be_falsey
15
15
  end
16
16
 
17
17
  it 'returns false when the ruby version is higher than 2.0' do
18
18
  node = { 'languages' => { 'ruby' => { 'version' => '3.0.0' } } }
19
- expect(described_class.ruby_20?(node)).to be_false
19
+ expect(described_class.ruby_20?(node)).to be_falsey
20
20
  end
21
21
  end
22
22
 
23
23
  describe '#ruby_19?' do
24
24
  it 'returns true when the ruby version is 1.9' do
25
25
  node = { 'languages' => { 'ruby' => { 'version' => '1.9.1' } } }
26
- expect(described_class.ruby_19?(node)).to be_true
26
+ expect(described_class.ruby_19?(node)).to be_truthy
27
27
  end
28
28
 
29
29
  it 'returns true when the ruby version is less than 1.9' do
30
30
  node = { 'languages' => { 'ruby' => { 'version' => '1.8.7' } } }
31
- expect(described_class.ruby_19?(node)).to be_false
31
+ expect(described_class.ruby_19?(node)).to be_falsey
32
32
  end
33
33
 
34
34
  it 'returns false when the ruby version is higher than 1.9' do
35
35
  node = { 'languages' => { 'ruby' => { 'version' => '2.0.0' } } }
36
- expect(described_class.ruby_19?(node)).to be_false
36
+ expect(described_class.ruby_19?(node)).to be_falsey
37
37
  end
38
38
  end
39
39
  end
@@ -7,13 +7,13 @@ describe Chef::Sugar::RunContext do
7
7
  let(:node) { double(Chef::Node) }
8
8
 
9
9
  it 'returns true when the recipe exists' do
10
- node.stub(:recipe?).and_return(true)
11
- expect(described_class.includes_recipe?(node, 'foo')).to be_true
10
+ allow(node).to receive(:recipe?).and_return(true)
11
+ expect(described_class.includes_recipe?(node, 'foo')).to be_truthy
12
12
  end
13
13
 
14
14
  it 'returns false when the recipe does not exist' do
15
- node.stub(:recipe?).and_return(false)
16
- expect(described_class.includes_recipe?(node, 'bar')).to be_false
15
+ allow(node).to receive(:recipe?).and_return(false)
16
+ expect(described_class.includes_recipe?(node, 'bar')).to be_falsey
17
17
  end
18
18
  end
19
19
  end
@@ -3,15 +3,27 @@ require 'spec_helper'
3
3
  describe Chef::Sugar::Shell do
4
4
  describe '#which' do
5
5
  it 'returns the first executable matching the command' do
6
- File.stub(:executable?).and_return(false)
7
- File.stub(:executable?).with('/usr/bin/mongo').and_return(true)
6
+ allow(File).to receive(:executable?).and_return(false)
7
+ allow(File).to receive(:executable?).with('/usr/bin/mongo').and_return(true)
8
8
  expect(described_class.which('mongo')).to eq('/usr/bin/mongo')
9
9
  end
10
10
 
11
11
  it 'returns nil when no command is found' do
12
- File.stub(:executable?).and_return(false)
12
+ allow(File).to receive(:executable?).and_return(false)
13
13
  expect(described_class.which('node')).to be_nil
14
14
  end
15
+
16
+ context 'with an absolute path' do
17
+ it 'returns the executable if it exists' do
18
+ allow(File).to receive(:executable?).with('/usr/local/bin/bash').and_return(true)
19
+ expect(described_class.which('/usr/local/bin/bash')).to eq('/usr/local/bin/bash')
20
+ end
21
+
22
+ it 'returns nil when the file is not executable' do
23
+ allow(File).to receive(:executable?).with('/usr/local/bin/bash').and_return(false)
24
+ expect(described_class.which('/usr/local/bin/bash')).to be_nil
25
+ end
26
+ end
15
27
  end
16
28
 
17
29
  describe '#dev_null' do
@@ -28,51 +40,51 @@ describe Chef::Sugar::Shell do
28
40
 
29
41
  describe '#installed?' do
30
42
  it 'returns true if the given binary exists' do
31
- File.stub(:which).and_return(false)
32
- File.stub(:which).with('/usr/bin/mongo').and_return(true)
33
- expect(described_class.installed?('mongo')).to be_true
43
+ allow(described_class).to receive(:which).and_return(nil)
44
+ allow(described_class).to receive(:which).with('mongo').and_return(true)
45
+ expect(described_class.installed?('mongo')).to be_truthy
34
46
  end
35
47
 
36
48
  it 'returns false if the given binary does not exist' do
37
- File.stub(:executable?).and_return(false)
38
- expect(described_class.installed?('node')).to be_false
49
+ allow(File).to receive(:executable?).and_return(false)
50
+ expect(described_class.installed?('node')).to be_falsey
39
51
  end
40
52
  end
41
53
 
42
54
  describe '#installed_at_version?' do
43
55
  it 'returns true if the command is installed at the correct version' do
44
- described_class.stub(:which).and_return(true)
45
- described_class.stub(:version_for).and_return('1.2.3')
46
- expect(described_class.installed_at_version?('mongo', '1.2.3')).to be_true
56
+ allow(described_class).to receive(:which).and_return(true)
57
+ allow(described_class).to receive(:version_for).and_return('1.2.3')
58
+ expect(described_class.installed_at_version?('mongo', '1.2.3')).to be_truthy
47
59
  end
48
60
 
49
61
  it 'returns true if the command is installed at the correct version and has additional output' do
50
- described_class.stub(:which).and_return(true)
51
- described_class.stub(:version_for).and_return('Mongo DB version 1.2.3. Some other text.')
52
- expect(described_class.installed_at_version?('mongo', '1.2.3')).to be_true
62
+ allow(described_class).to receive(:which).and_return(true)
63
+ allow(described_class).to receive(:version_for).and_return('Mongo DB version 1.2.3. Some other text.')
64
+ expect(described_class.installed_at_version?('mongo', '1.2.3')).to be_truthy
53
65
  end
54
66
 
55
67
  it 'returns true if the command is installed at the correct version with a regex' do
56
- described_class.stub(:which).and_return(true)
57
- described_class.stub(:version_for).and_return('1.2.3')
58
- expect(described_class.installed_at_version?('mongo', /1\.2/)).to be_true
68
+ allow(described_class).to receive(:which).and_return(true)
69
+ allow(described_class).to receive(:version_for).and_return('1.2.3')
70
+ expect(described_class.installed_at_version?('mongo', /1\.2/)).to be_truthy
59
71
  end
60
72
 
61
73
  it 'returns false if the command is installed at the wrong version' do
62
- described_class.stub(:which).and_return(true)
63
- described_class.stub(:version_for).and_return('1.2.3')
64
- expect(described_class.installed_at_version?('mongo', '4.5.6')).to be_false
74
+ allow(described_class).to receive(:which).and_return(true)
75
+ allow(described_class).to receive(:version_for).and_return('1.2.3')
76
+ expect(described_class.installed_at_version?('mongo', '4.5.6')).to be_falsey
65
77
  end
66
78
 
67
79
  it 'returns false if the command is not installed' do
68
- described_class.stub(:which).and_return(nil)
69
- expect(described_class.installed_at_version?('mongo', '1.0.0')).to be_false
80
+ allow(described_class).to receive(:which).and_return(nil)
81
+ expect(described_class.installed_at_version?('mongo', '1.0.0')).to be_falsey
70
82
  end
71
83
  end
72
84
 
73
85
  describe '#version_for' do
74
86
  let(:shell_out) { double('shell_out', run_command: nil, error!: nil, stdout: '1.2.3', stderr: 'Oh no!') }
75
- before { Mixlib::ShellOut.stub(:new).and_return(shell_out) }
87
+ before { allow(Mixlib::ShellOut).to receive(:new).and_return(shell_out) }
76
88
 
77
89
  it 'runs the thing in shellout' do
78
90
  expect(Mixlib::ShellOut).to receive(:new).with('mongo --version')
@@ -6,22 +6,22 @@ describe Chef::Sugar::Vagrant do
6
6
  describe '#vagrant?' do
7
7
  it 'returns true when the machine is on vagrant' do
8
8
  node = { 'vagrant' => {} }
9
- expect(described_class.vagrant?(node)).to be_true
9
+ expect(described_class.vagrant?(node)).to be_truthy
10
10
  end
11
11
 
12
12
  it 'returns true when the domain is vagrantup.com' do
13
13
  node = { 'domain' => 'bacon.vagrantup.com' }
14
- expect(described_class.vagrant?(node)).to be_true
14
+ expect(described_class.vagrant?(node)).to be_truthy
15
15
  end
16
16
 
17
17
  it 'returns true when the vagrant user exists on the system' do
18
18
  node = { 'etc' => { 'passwd' => { 'vagrant' => {} } } }
19
- expect(described_class.vagrant?(node)).to be_true
19
+ expect(described_class.vagrant?(node)).to be_truthy
20
20
  end
21
21
 
22
22
  it 'returns false when the machine is not on vagrant' do
23
23
  node = {}
24
- expect(described_class.vagrant?(node)).to be_false
24
+ expect(described_class.vagrant?(node)).to be_falsey
25
25
  end
26
26
  end
27
27
  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: 1.3.0
4
+ version: 2.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: 2014-05-05 00:00:00.000000000 Z
11
+ date: 2014-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '3.0'
47
+ version: '4.0'
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: '3.0'
54
+ version: '4.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: test-kitchen
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -90,6 +90,7 @@ extensions: []
90
90
  extra_rdoc_files: []
91
91
  files:
92
92
  - ".gitignore"
93
+ - ".hound.yml"
93
94
  - ".kitchen.yml"
94
95
  - ".travis.yml"
95
96
  - CHANGELOG.md