Sha256: 0703d74e5222e2885914ab6483a0370b209f0464e60a1fd046f3b3ed98d151a5

Contents?: true

Size: 798 Bytes

Versions: 3

Compression:

Stored size: 798 Bytes

Contents

require 'spec_helper'

describe Chef::Sugar::Vagrant do
  it_behaves_like 'a chef sugar'

  describe '#vagrant?' do
    it 'returns true when the machine is on vagrant' do
      node = { 'vagrant' => {} }
      expect(described_class.vagrant?(node)).to be_truthy
    end

    it 'returns true when the domain is vagrantup.com' do
      node = { 'domain' => 'bacon.vagrantup.com' }
      expect(described_class.vagrant?(node)).to be_truthy
    end

    it 'returns true when the vagrant user exists on the system' do
      node = { 'etc' => { 'passwd' => { 'vagrant' => {} } } }
      expect(described_class.vagrant?(node)).to be_truthy
    end

    it 'returns false when the machine is not on vagrant' do
      node = {}
      expect(described_class.vagrant?(node)).to be_falsey
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
chef-sugar-2.2.0 spec/unit/chef/sugar/vagrant_spec.rb
chef-sugar-2.1.0 spec/unit/chef/sugar/vagrant_spec.rb
chef-sugar-2.0.0 spec/unit/chef/sugar/vagrant_spec.rb