Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Vagrant
Commits
d797e483
Commit
d797e483
authored
14 years ago
by
Mitchell Hashimoto
Browse files
Options
Download
Email Patches
Plain Diff
Clear shared folders uses new modify pipeline
parent
79c46b4e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/vagrant/action/vm/clear_shared_folders.rb
+2
-1
lib/vagrant/action/vm/clear_shared_folders.rb
test/vagrant/action/vm/clear_shared_folders_test.rb
+6
-1
test/vagrant/action/vm/clear_shared_folders_test.rb
with
8 additions
and
2 deletions
+8
-2
lib/vagrant/action/vm/clear_shared_folders.rb
+
2
-
1
View file @
d797e483
...
@@ -8,7 +8,7 @@ module Vagrant
...
@@ -8,7 +8,7 @@ module Vagrant
end
end
def
call
(
env
)
def
call
(
env
)
env
[
"config"
].
vm
.
customize
do
|
vm
|
proc
=
lambda
do
|
vm
|
if
vm
.
shared_folders
.
length
>
0
if
vm
.
shared_folders
.
length
>
0
env
.
ui
.
info
I18n
.
t
(
"vagrant.actions.vm.clear_shared_folders.deleting"
)
env
.
ui
.
info
I18n
.
t
(
"vagrant.actions.vm.clear_shared_folders.deleting"
)
...
@@ -18,6 +18,7 @@ module Vagrant
...
@@ -18,6 +18,7 @@ module Vagrant
end
end
end
end
env
[
"vm.modify"
].
call
(
proc
)
@app
.
call
(
env
)
@app
.
call
(
env
)
end
end
end
end
...
...
This diff is collapsed.
Click to expand it.
test/vagrant/action/vm/clear_shared_folders_test.rb
+
6
-
1
View file @
d797e483
...
@@ -7,6 +7,7 @@ class ClearSharedFoldersVMActionTest < Test::Unit::TestCase
...
@@ -7,6 +7,7 @@ class ClearSharedFoldersVMActionTest < Test::Unit::TestCase
@vm
=
mock
(
"vm"
)
@vm
=
mock
(
"vm"
)
@env
[
"vm"
]
=
@vm
@env
[
"vm"
]
=
@vm
@env
[
"vm.modify"
]
=
mock
(
"proc"
)
@internal_vm
=
mock
(
"internal"
)
@internal_vm
=
mock
(
"internal"
)
@vm
.
stubs
(
:vm
).
returns
(
@internal_vm
)
@vm
.
stubs
(
:vm
).
returns
(
@internal_vm
)
...
@@ -19,7 +20,6 @@ class ClearSharedFoldersVMActionTest < Test::Unit::TestCase
...
@@ -19,7 +20,6 @@ class ClearSharedFoldersVMActionTest < Test::Unit::TestCase
@shared_folder
=
mock
(
"shared_folder"
)
@shared_folder
=
mock
(
"shared_folder"
)
@shared_folders
=
[
@shared_folder
]
@shared_folders
=
[
@shared_folder
]
@internal_vm
.
stubs
(
:shared_folders
).
returns
(
@shared_folders
)
@internal_vm
.
stubs
(
:shared_folders
).
returns
(
@shared_folders
)
@env
[
"config"
].
vm
.
stubs
(
:customize
).
yields
(
@internal_vm
)
end
end
should
"call destroy on each shared folder then reload"
do
should
"call destroy on each shared folder then reload"
do
...
@@ -28,6 +28,11 @@ class ClearSharedFoldersVMActionTest < Test::Unit::TestCase
...
@@ -28,6 +28,11 @@ class ClearSharedFoldersVMActionTest < Test::Unit::TestCase
sf
.
expects
(
:destroy
).
once
.
in_sequence
(
destroy_seq
)
sf
.
expects
(
:destroy
).
once
.
in_sequence
(
destroy_seq
)
end
end
@env
[
"vm.modify"
].
expects
(
:call
).
with
()
do
|
proc
|
proc
.
call
(
@internal_vm
)
true
end
@app
.
expects
(
:call
).
with
(
@env
).
once
@app
.
expects
(
:call
).
with
(
@env
).
once
@instance
.
call
(
@env
)
@instance
.
call
(
@env
)
end
end
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment