(typo)
[vagrant-dotfiles.git] / spec / vagrant-dotfiles.rb
1 require "spec_helper"
2
3 module Vagrant
4 module Provisioners
5 describe VagrantDotfiles do
6 before(:each) do
7 env_vm = Object.new
8 env_vm_config = Object.new
9 @mock_vm = Object.new
10 @config = VagrantDotfiles.config_class.new
11 @env_channel = Object.new
12
13 VagrantDotfiles.any_instance.stub(:env).and_return({:vm => env_vm})
14 env_vm.stub(:config).and_return(env_vm_config)
15 env_vm.stub(:channel).and_return(@env_channel)
16 env_vm_config.stub(:vm).and_return(@mock_vm)
17 VagrantDotfiles.any_instance.stub(:config).and_return(@config)
18 end
19
20 it "should prepare provisioning process" do
21 @config.should_receive(:all_enabled_attributes).and_return([VagrantDotfiles::Vim.new])
22 VagrantDotfiles::Vim.any_instance.should_receive(:prepare).with(@mock_vm, anything)
23
24 VagrantDotfiles.new.prepare
25 end
26
27 it "should provision the vm" do
28 @config.stub(:all_enabled_attributes).and_return([VagrantDotfiles::Vim.new])
29 vagrant_dotfiles = VagrantDotfiles.new
30
31 VagrantDotfiles::Vim.any_instance.stub(:prepare)
32 vagrant_dotfiles.prepare
33
34 VagrantDotfiles::Vim.any_instance.should_receive(:provision).with(@env_channel, anything, anything)
35 vagrant_dotfiles.provision!
36 end
37 end
38 end
39 end