<commit_before>require_relative 'base'

require VagrantPlugins::Parallels.source_root.join('lib/vagrant-parallels/config')

describe VagrantPlugins::Parallels::Config do
  let(:machine) { double('machine') }

  def assert_invalid
    errors = subject.validate(machine)
    if !errors.values.any? { |v| !v.empty? }
      raise "No errors: #{errors.inspect}"
    end
  end

  def assert_valid
    errors = subject.validate(machine)
    if !errors.values.all? { |v| v.empty? }
      raise "Errors: #{errors.inspect}"
    end
  end

  def valid_defaults
    subject.image = 'foo'
  end

  before do
    vm_config = double('vm_config')
    vm_config.stub(networks: [])
    config = double('config')
    config.stub(vm: vm_config)
    machine.stub(config: config)
  end

  its 'valid by default' do
    subject.finalize!
    assert_valid
  end

  context 'defaults' do
    before { subject.finalize! }

    it { expect(subject.check_guest_additions).to be_true }
    it { expect(subject.name).to be_nil }
    it { expect(subject.functional_psf).to be_true }
    it { expect(subject.optimize_power_consumption).to be_true }

    it 'should have one Shared adapter' do
      expect(subject.network_adapters).to eql({
        0 => [:shared, {}],<commit_msg>Fix unit tests for provider configuration<commit_after>require_relative 'base'

require VagrantPlugins::Parallels.source_root.join('lib/vagrant-parallels/config')

describe VagrantPlugins::Parallels::Config do
  let(:machine) { double('machine') }

  def assert_invalid
    errors = subject.validate(machine)
    if !errors.values.any? { |v| !v.empty? }
      raise "No errors: #{errors.inspect}"
    end
  end

  def assert_valid
    errors = subject.validate(machine)
    if !errors.values.all? { |v| v.empty? }
      raise "Errors: #{errors.inspect}"
    end
  end

  before do
    vm_config = double('vm_config')
    vm_config.stub(networks: [])
    config = double('config')
    config.stub(vm: vm_config)
    machine.stub(config: config)
  end

  its 'valid by default' do
    subject.finalize!
    assert_valid
  end

  context 'defaults' do
    before { subject.finalize! }

    it { expect(subject.check_guest_tools).to eq(true) }
    it { expect(subject.name).to be_nil }
    it { expect(subject.functional_psf).to eq(true) }
    it { expect(subject.linked_clone).to eq(false) }
    it { expect(subject.regen_src_uuid).to eq(true) }

    it 'should have one Shared adapter' do
      expect(subject.network_adapters).to eql({
        0 => [:shared, {}],
{'fraction_non_alphanumeric': 0.12430278884462151, 'fraction_numerical': 0.0007968127490039841, 'mean_word_length': 3.4285714285714284, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2817352', 'n_tokens_mistral': 854, 'n_tokens_neox': 836, 'n_words': 181}