5 describe VagrantDotfiles
do
8 env_vm_config
= Object
.new
10 @config = VagrantDotfiles
.config_class
.new
11 @env_channel = Object
.new
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)
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
)
24 VagrantDotfiles
.new
.prepare
27 it
"should provision the vm" do
28 @config.stub(:all_enabled_attributes).and_return([VagrantDotfiles
::Vim.new
])
29 vagrant_dotfiles
= VagrantDotfiles
.new
31 VagrantDotfiles
::Vim.any_instance
.stub(:prepare)
32 vagrant_dotfiles
.prepare
34 VagrantDotfiles
::Vim.any_instance
.should_receive(:provision).with(@env_channel, anything
, anything
)
35 vagrant_dotfiles
.provision
!