Sha256: 3d4df1dd218d48ce3fdba650a89a95edcae5efe49de0a8d0d3ea5bca2bc087f7

Contents?: true

Size: 958 Bytes

Versions: 1

Compression:

Stored size: 958 Bytes

Contents

require 'spec_helper'

describe VagrantWindows::Helper , :unit => true do
  
  class DummyHelper
    include VagrantWindows::Helper
  end
  
  before(:all) do
    @dummy = DummyHelper.new
  end

  describe "win_friendly_path" do
    it "should replace slashes with backslashes"  do
      @dummy.win_friendly_path('c:/tmp/dir').should eq('c:\\tmp\\dir')
    end
    
    it "should prepend c: drive if not drive specified" do
      @dummy.win_friendly_path('/tmp/dir').should eq('c:\\tmp\\dir')
    end
    
    it "should return nil if no path specified" do
      @dummy.win_friendly_path(nil).should be_nil
    end
  end
  
  describe "win_friendly_share_id" do
    it "should use share id if present" do
      @dummy.win_friendly_share_id('sharename').should eq('sharename')
    end
    
    it "should use last folder name in guest_path" do
      @dummy.win_friendly_share_id('/tmp/folder/sharename').should eq('tmp_folder_sharename')
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vagrant-windows-1.2.0 spec/vagrant-windows/helper_spec.rb