diff --git a/lib/vagrant/action/builtin/synced_folder_cleanup.rb b/lib/vagrant/action/builtin/synced_folder_cleanup.rb index 66e6a2783..2670d9e11 100644 --- a/lib/vagrant/action/builtin/synced_folder_cleanup.rb +++ b/lib/vagrant/action/builtin/synced_folder_cleanup.rb @@ -21,7 +21,7 @@ module Vagrant # Go through each folder and do cleanup folders.each_key do |impl_name| @logger.info("Invoking synced folder cleanup for: #{impl_name}") - plugins[impl_name.to_sym][0].new.cleanup(env) + plugins[impl_name.to_sym][0].new.cleanup(env[:machine]) end @app.call(env) diff --git a/tasks/test.rake b/tasks/test.rake index 8926fe28e..e0f7598dc 100644 --- a/tasks/test.rake +++ b/tasks/test.rake @@ -2,8 +2,7 @@ require 'rake/testtask' require 'rspec/core/rake_task' namespace :test do - RSpec::Core::RakeTask.new do |t| - t.name = "unit" + RSpec::Core::RakeTask.new(:unit) do |t| t.pattern = "test/unit/**/*_test.rb" end @@ -13,8 +12,7 @@ namespace :test do t.pattern = "test/unit_legacy/**/*_test.rb" end - RSpec::Core::RakeTask.new do |t| - t.name = "acceptance" + RSpec::Core::RakeTask.new(:acceptance) do |t| t.pattern = "test/acceptance/**/*_test.rb" end end diff --git a/test/unit/vagrant/action/builtin/synced_folder_cleanup_test.rb b/test/unit/vagrant/action/builtin/synced_folder_cleanup_test.rb index 9ac78bdd3..6375d25bb 100644 --- a/test/unit/vagrant/action/builtin/synced_folder_cleanup_test.rb +++ b/test/unit/vagrant/action/builtin/synced_folder_cleanup_test.rb @@ -52,6 +52,7 @@ describe Vagrant::Action::Builtin::SyncedFolderCleanup do plugins[:default] = [impl(true, "default"), 10] plugins[:nfs] = [impl(true, "nfs"), 5] + env[:machine] = Object.new env[:root_path] = Pathname.new(Dir.mktmpdir) subject.stub(:plugins => plugins) @@ -73,8 +74,10 @@ describe Vagrant::Action::Builtin::SyncedFolderCleanup do } } + expect_any_instance_of(tracker).to receive(:cleanup). + with(env[:machine]) + subject.call(env) - tracker.clean.should be_true end it "should invoke cleanup once per implementation" do diff --git a/test/unit/vagrant/environment_test.rb b/test/unit/vagrant/environment_test.rb index d2b520a19..a3b914eb9 100644 --- a/test/unit/vagrant/environment_test.rb +++ b/test/unit/vagrant/environment_test.rb @@ -311,7 +311,7 @@ describe Vagrant::Environment do it "should allow passing in a custom action runner" do instance.action_runner.should_not_receive(:run) - other_runner = mock + other_runner = double("runner") other_runner.should_receive(:run).and_return(:foo) instance.hook(:bar, runner: other_runner).should == :foo diff --git a/vagrant.gemspec b/vagrant.gemspec index 5e96c4e88..6c2a1ae28 100644 --- a/vagrant.gemspec +++ b/vagrant.gemspec @@ -27,9 +27,7 @@ Gem::Specification.new do |s| s.add_development_dependency "mocha" # This has problems on Windows, we need to find a better way: # s.add_development_dependency "sys-proctable", "~> 0.9.0" - s.add_development_dependency "rspec-core", "~> 2.11.0" - s.add_development_dependency "rspec-expectations", "~> 2.11.0" - s.add_development_dependency "rspec-mocks", "~> 2.11.0" + s.add_development_dependency "rspec", "~> 2.14.0" # The following block of code determines the files that should be included # in the gem. It does this by reading all the files in the directory where