spec/unit/chef/sugar/virtualization_spec.rb in chef-sugar-2.2.0 vs spec/unit/chef/sugar/virtualization_spec.rb in chef-sugar-2.3.0
- old
+ new
@@ -4,19 +4,36 @@
it_behaves_like 'a chef sugar'
describe '#lxc?' do
it 'returns true when the machine is a linux contianer' do
node = { 'virtualization' => { 'system' => 'lxc' } }
- expect(described_class.lxc?(node)).to be_truthy
+ expect(described_class.lxc?(node)).to be true
end
it 'returns false when the virtual machine is not lxc' do
node = { 'virtualization' => { 'system' => 'vbox' } }
- expect(described_class.lxc?(node)).to be_falsey
+ expect(described_class.lxc?(node)).to be false
end
it 'returns false when the machine is not virtual' do
node = {}
- expect(described_class.lxc?(node)).to be_falsey
+ expect(described_class.lxc?(node)).to be false
+ end
+ end
+
+ describe '#vmware?' do
+ it 'returns true when the machine is under vmware' do
+ node = { 'virtualization' => { 'system' => 'vmware' } }
+ expect(described_class.vmware?(node)).to be true
+ end
+
+ it 'returns false when the virtual machine is not under vmware' do
+ node = { 'virtualization' => { 'system' => 'vbox' } }
+ expect(described_class.vmware?(node)).to be false
+ end
+
+ it 'returns false when the machine is not virtual' do
+ node = {}
+ expect(described_class.vmware?(node)).to be false
end
end
end