Sha256: e6ef692ecf44bf1431a477059da321138269bf5e6c009694db1a05b9f7086fb7

Contents?: true

Size: 1009 Bytes

Versions: 15

Compression:

Stored size: 1009 Bytes

Contents

require_relative "../base"

describe VagrantPlugins::Parallels::Driver::PD_8 do
  include_context "parallels"
  let(:parallels_version) { "8" }

  subject { VagrantPlugins::Parallels::Driver::Meta.new(uuid) }

  it_behaves_like "parallels desktop driver"

  describe "ssh_ip" do
    let(:content) {'10.200.0.99="1394547632,1800,001c420000ff,01001c420000ff"'}

    it "returns an IP address assigned to the specified MAC" do
      driver.should_receive(:read_mac_address).and_return("001C420000FF")
      File.should_receive(:open).with(an_instance_of(String)).
        and_return(StringIO.new(content))

      subject.ssh_ip.should == "10.200.0.99"
    end

    it "rises DhcpLeasesNotAccessible exception when file is not accessible" do
      File.stub(:open).and_call_original
      File.should_receive(:open).with(an_instance_of(String)).
        and_raise(Errno::EACCES)
      expect { subject.ssh_ip }.
        to raise_error(VagrantPlugins::Parallels::Errors::DhcpLeasesNotAccessible)
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
vagrant-parallels-1.4.0.rc1 test/unit/driver/pd_8_test.rb
vagrant-parallels-1.3.13 test/unit/driver/pd_8_test.rb
vagrant-parallels-1.3.12 test/unit/driver/pd_8_test.rb
vagrant-parallels-1.3.10 test/unit/driver/pd_8_test.rb
vagrant-parallels-1.3.9 test/unit/driver/pd_8_test.rb
vagrant-parallels-1.3.8 test/unit/driver/pd_8_test.rb
vagrant-parallels-1.3.7 test/unit/driver/pd_8_test.rb
vagrant-parallels-1.3.6 test/unit/driver/pd_8_test.rb
vagrant-parallels-1.3.5 test/unit/driver/pd_8_test.rb
vagrant-parallels-1.3.4 test/unit/driver/pd_8_test.rb
vagrant-parallels-1.3.3 test/unit/driver/pd_8_test.rb
vagrant-parallels-1.3.3.rc1 test/unit/driver/pd_8_test.rb
vagrant-parallels-1.3.2 test/unit/driver/pd_8_test.rb
vagrant-parallels-1.3.1 test/unit/driver/pd_8_test.rb
vagrant-parallels-1.3.0 test/unit/driver/pd_8_test.rb