spec/vagrant-windows/helper_spec.rb in vagrant-windows-1.0.3 vs spec/vagrant-windows/helper_spec.rb in vagrant-windows-1.2.0
- old
+ new
@@ -1,27 +1,38 @@
-require "vagrant-windows/helper"
+require 'spec_helper'
-describe VagrantWindows::Helper do
+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
+ 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