spec/unit/chef/sugar/vagrant_spec.rb in chef-sugar-2.3.0 vs spec/unit/chef/sugar/vagrant_spec.rb in chef-sugar-2.3.1

- old
+ new

@@ -12,9 +12,19 @@ it 'returns true when the domain is vagrantup.com' do node = { 'domain' => 'bacon.vagrantup.com' } expect(described_class.vagrant?(node)).to be true end + it 'returns false when the domain is nil' do + node = { 'domain' => nil } + expect(described_class.vagrant?(node)).to be false + end + + it 'returns false when the domain is not vagrantup.com' do + node = { 'domain' => 'sethvargo.com' } + expect(described_class.vagrant?(node)).to be false + end + it 'returns true when the vagrant user exists on the system' do node = { 'etc' => { 'passwd' => { 'vagrant' => {} } } } expect(described_class.vagrant?(node)).to be true end