<commit_before>require_relative '../base'

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

describe VagrantPlugins::Parallels::Driver::Base do
  include_context 'parallels'
  before do
    stub_const('Vagrant::Util::Subprocess', subprocess)
    allow(subprocess).to receive(:execute).
        with('mdfind', any_args).
        and_return(subprocess_result(stdout: "/application.app"))

    allow(File).to receive(:exist?).with(any_args).and_return(true)
  end

  describe 'read_guest_tools_iso_path' do
    subject(:instance) { described_class.new uuid }

    it "reads `linux`:nil success" do
      expect(instance.read_guest_tools_iso_path('linux')).to end_with('prl-tools-lin.iso')
    end
    it "reads `linux`:`x86_64` success" do
      expect(instance.read_guest_tools_iso_path('linux', 'x86_64')).to end_with('prl-tools-lin.iso')
    end
    it "reads `linux`:`aarch64` success" do
      expect(instance.read_guest_tools_iso_path('linux', 'aarch64')).to end_with('prl-tools-lin-arm.iso')
    end
    it "reads `linux`:`arm64` success" do
      expect(instance.read_guest_tools_iso_path('linux', 'arm64')).to end_with('prl-tools-lin-arm.iso')
    end

    it "reads `darwin`:nil success" do
      expect(instance.read_guest_tools_iso_path('darwin')).to end_with('prl-tools-mac.iso')
    end
    it "reads `darwin`:`x86_64` success" do
      expect(instance.read_guest_tools_iso_path('darwin', 'x86_64')).to end_with('prl-tools-mac.iso')
    end
    it "reads `darwin`:`aarch64` success" do
      expect(instance.read_guest_tools_iso_path('darwin', 'aarch64')).to end_with('prl-tools-mac-arm.iso')
    end
    it "reads `darwin`:`arm64` success" do
      expect(instance.read_guest_tools_iso_path('darwin', 'arm64')).to end_with('prl-tools-mac-arm.iso')
    end
    it "reads `darwin`:`arm` success" do
      expect(instance.read_guest_tools_iso_path('darwin', 'arm')).to end_with('prl-tools-mac-arm.iso')
    end

    it "reads `windows`:nil success" do
      expect(instance.read_guest_tools_iso_path('windows')).to end_with('PTIAgent.exe')
    end
    it "reads `windows`:`x86_64` success" do
      expect(instance.read_guest_tools_iso_path('windows')).to end_with('PTIAgent.exe')
    end
    it "reads `windows`:`aarch64` success" do
      expect(instance.read_guest_tools_iso_path('windows')).to end_with('PTIAgent.exe')
    end
    
    it "reads `unknown`:nil success" do
      expect(instance.read_guest_tools_iso_path('unknown')).to eq(nil)
    end
    
    it "reads `linux`:nil exception" do
      VagrantPlugins::Parallels::Plugin.setup_i18n
      allow(File).to receive(:exist?).and_return(false)
      expect(instance.read_guest_tools_iso_path('linux')).to raise_exception
    end
  end
end<commit_msg>Issue #401 Correcting the final unit test that catches the missing path exception<commit_after>require_relative '../base'

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

describe VagrantPlugins::Parallels::Driver::Base do
  include_context 'parallels'
  before do
    stub_const('Vagrant::Util::Subprocess', subprocess)
    allow(subprocess).to receive(:execute).
        with('mdfind', any_args).
        and_return(subprocess_result(stdout: "/application.app"))

    allow(File).to receive(:exist?).with(any_args).and_return(true)
  end

  describe 'read_guest_tools_iso_path' do
    subject(:instance) { described_class.new uuid }

    it "reads `linux`:nil success" do
      expect(instance.read_guest_tools_iso_path('linux')).to end_with('prl-tools-lin.iso')
    end
    it "reads `linux`:`x86_64` success" do
      expect(instance.read_guest_tools_iso_path('linux', 'x86_64')).to end_with('prl-tools-lin.iso')
    end
    it "reads `linux`:`aarch64` success" do
      expect(instance.read_guest_tools_iso_path('linux', 'aarch64')).to end_with('prl-tools-lin-arm.iso')
    end
    it "reads `linux`:`arm64` success" do
      expect(instance.read_guest_tools_iso_path('linux', 'arm64')).to end_with('prl-tools-lin-arm.iso')
    end

    it "reads `darwin`:nil success" do
      expect(instance.read_guest_tools_iso_path('darwin')).to end_with('prl-tools-mac.iso')
    end
    it "reads `darwin`:`x86_64` success" do
      expect(instance.read_guest_tools_iso_path('darwin', 'x86_64')).to end_with('prl-tools-mac.iso')
    end
    it "reads `darwin`:`aarch64` success" do
      expect(instance.read_guest_tools_iso_path('darwin', 'aarch64')).to end_with('prl-tools-mac-arm.iso')
    end
    it "reads `darwin`:`arm64` success" do
      expect(instance.read_guest_tools_iso_path('darwin', 'arm64')).to end_with('prl-tools-mac-arm.iso')
    end
    it "reads `darwin`:`arm` success" do
      expect(instance.read_guest_tools_iso_path('darwin', 'arm')).to end_with('prl-tools-mac-arm.iso')
    end

    it "reads `windows`:nil success" do
      expect(instance.read_guest_tools_iso_path('windows')).to end_with('PTIAgent.exe')
    end
    it "reads `windows`:`x86_64` success" do
      expect(instance.read_guest_tools_iso_path('windows')).to end_with('PTIAgent.exe')
    end
    it "reads `windows`:`aarch64` success" do
      expect(instance.read_guest_tools_iso_path('windows')).to end_with('PTIAgent.exe')
    end
    
    it "reads `unknown`:nil success" do
      expect(instance.read_guest_tools_iso_path('unknown')).to eq(nil)
    end
    
    it "reads `linux`:nil exception" do
      VagrantPlugins::Parallels::Plugin.setup_i18n
      allow(File).to receive(:exist?).and_return(false)
      expect { instance.read_guest_tools_iso_path('linux') }.to raise_exception
    end
  end
end
{'fraction_non_alphanumeric': 0.14352100089365505, 'fraction_numerical': 0.01483467381590706, 'mean_word_length': 4.46484375, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2336754', 'n_tokens_mistral': 2062, 'n_tokens_neox': 1989, 'n_words': 317}