From 388662c62a2225dfdbb6307cdfc992703d44ba6e Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 19 Jun 2010 11:48:13 -0700 Subject: [PATCH] All shared folder tests passing. still failing tests in other areas to be worked on. --- .../vagrant/actions/vm/shared_folders_test.rb | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/test/vagrant/actions/vm/shared_folders_test.rb b/test/vagrant/actions/vm/shared_folders_test.rb index 16ec88f03..3d4f4360a 100644 --- a/test/vagrant/actions/vm/shared_folders_test.rb +++ b/test/vagrant/actions/vm/shared_folders_test.rb @@ -21,6 +21,7 @@ class SharedFoldersActionTest < Test::Unit::TestCase end @runner.stubs(:env).returns(env) + env.config.vm.shared_folders end context "before boot" do @@ -32,6 +33,15 @@ class SharedFoldersActionTest < Test::Unit::TestCase end end + context "after boot" do + should "mount folders then setup unison" do + seq = sequence("after") + @action.expects(:mount_shared_folders).once.in_sequence(seq) + @action.expects(:setup_unison).once.in_sequence(seq) + @action.after_boot + end + end + context "collecting shared folders" do setup do File.stubs(:expand_path).returns("baz") @@ -119,31 +129,21 @@ class SharedFoldersActionTest < Test::Unit::TestCase end end - # context "mounting the shared folders" do - # setup do - # @folders = stub_shared_folders - # @ssh = mock("ssh") - # @runner.ssh.stubs(:execute).yields(@ssh) - # @runner.system.stubs(:mount_shared_folder) - # end + context "mounting the shared folders" do + setup do + @folders = stub_shared_folders + @ssh = mock("ssh") + @runner.ssh.stubs(:execute).yields(@ssh) + @runner.system.stubs(:mount_shared_folder) + end - # should "mount all shared folders to the VM" do - # mount_seq = sequence("mount_seq") - # @folders.each do |name, hostpath, guestpath| - # @runner.system.expects(:mount_shared_folder).with(@ssh, name, guestpath).in_sequence(mount_seq) - # end + should "mount all shared folders to the VM" do + mount_seq = sequence("mount_seq") + @folders.each do |name, data| + @runner.system.expects(:mount_shared_folder).with(@ssh, name, data[:guestpath]).in_sequence(mount_seq) + end - # @action.after_boot - # end - - # should "execute the necessary rysnc commands for each sync folder" do - # @folders.map { |f| f << 'sync' } - # @folders.each do |name, hostpath, guestpath, syncd| - # @runner.system.expects(:create_sync).with(@ssh, :syncpath => syncd, :guestpath => guestpath) - # end - # @runner.ssh.expects(:execute).yields(@ssh) - - # @action.after_boot - # end - # end + @action.mount_shared_folders + end + end end