8 env_vm_config
= Object
.new
10 @config = CopyMyConf
.config_class
.new
11 @env_channel = Object
.new
13 CopyMyConf
.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 CopyMyConf
.any_instance
.stub(:config).and_return(@config)
20 it
"should prepare provisioning process" do
21 @config.should_receive(:all_true).and_return([:vim])
22 CopyMyConf
::Vim.any_instance
.should_receive(:prepare).with(@mock_vm, anything
)
24 CopyMyConf
.new
.prepare
27 it
"should provision the vm" do
28 @config.stub(:all_true).and_return([:vim])
29 copy_my_conf
= CopyMyConf
.new
31 CopyMyConf
::Vim.any_instance
.stub(:prepare)
34 CopyMyConf
::Vim.any_instance
.should_receive(:provision).with(@env_channel, anything
, anything
)
35 copy_my_conf
.provision
!