Sha256: ef7fa305ceea71a2502626549e546ccd7e45622b2b79293ab678b18ed1f95478

Contents?: true

Size: 1.42 KB

Versions: 2

Compression:

Stored size: 1.42 KB

Contents

require 'spec_helper'
require 'mocha/api'
require 'vagrant-windows/windows_machine'

describe VagrantWindows::WindowsMachine , :unit => true do
  
  describe "is_vmware?" do
    it "should be true for vmware_fusion" do
      machine = stub(:provider_name => :vmware_fusion)
      windows_machine = VagrantWindows::WindowsMachine.new(machine)
      expect(windows_machine.is_vmware?()).to be_true
    end
    
    it "should be true for vmware_workstation" do
      machine = stub(:provider_name => :vmware_workstation)
      windows_machine = VagrantWindows::WindowsMachine.new(machine)
      expect(windows_machine.is_vmware?()).to be_true
    end
    
    it "should be false for virtual_box" do
      machine = stub(:provider_name => :virtual_box)
      windows_machine = VagrantWindows::WindowsMachine.new(machine)
      expect(windows_machine.is_vmware?()).to be_false
    end
  end
  
  describe "is_windows?" do
    it "should return true when config vm guest is windows" do
      vm = stub(:guest => :windows)
      config = stub(:vm => vm)
      machine = stub(:config => config)
      expect(VagrantWindows::WindowsMachine.is_windows?(machine)).to be_true
    end
    
    it "should return false when config vm guest is not windows" do
      vm = stub(:guest => :ubuntu)
      config = stub(:vm => vm)
      machine = stub(:config => config)
      expect(VagrantWindows::WindowsMachine.is_windows?(machine)).to be_false
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vagrant-windows-1.3.0 spec/vagrant-windows/windows_machine_spec.rb
vagrant-windows-1.3.0.pre.3 spec/vagrant-windows/windows_machine_spec.rb