--- /dev/null
+require "spec_helper"
+
+module Vagrant
+ module Provisioners
+ describe VagrantDotfiles do
+ before(:each) do
+ env_vm = Object.new
+ env_vm_config = Object.new
+ @mock_vm = Object.new
+ @config = VagrantDotfiles.config_class.new
+ @env_channel = Object.new
+
+ VagrantDotfiles.any_instance.stub(:env).and_return({:vm => env_vm})
+ env_vm.stub(:config).and_return(env_vm_config)
+ env_vm.stub(:channel).and_return(@env_channel)
+ env_vm_config.stub(:vm).and_return(@mock_vm)
+ VagrantDotfiles.any_instance.stub(:config).and_return(@config)
+ end
+
+ it "should prepare provisioning process" do
+ @config.should_receive(:all_enabled_attributes).and_return([VagrantDotfiles::Vim.new])
+ VagrantDotfiles::Vim.any_instance.should_receive(:prepare).with(@mock_vm, anything)
+
+ VagrantDotfiles.new.prepare
+ end
+
+ it "should provision the vm" do
+ @config.stub(:all_enabled_attributes).and_return([VagrantDotfiles::Vim.new])
+ vagrant_dotfiles = VagrantDotfiles.new
+
+ VagrantDotfiles::Vim.any_instance.stub(:prepare)
+ vagrant_dotfiles.prepare
+
+ VagrantDotfiles::Vim.any_instance.should_receive(:provision).with(@env_channel, anything, anything)
+ vagrant_dotfiles.provision!
+ end
+ end
+ end
+end