From 09bd40c207e503e9f969df0c9ae15d466cf075ed Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 10 Feb 2010 22:26:37 -0800 Subject: [PATCH] Tests for modified 'up' command --- test/vagrant/commands_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/vagrant/commands_test.rb b/test/vagrant/commands_test.rb index 722a8216a..3b39f3740 100644 --- a/test/vagrant/commands_test.rb +++ b/test/vagrant/commands_test.rb @@ -10,6 +10,7 @@ class CommandsTest < Test::Unit::TestCase context "up" do setup do + Vagrant::Env.stubs(:persisted_vm).returns(nil) Vagrant::VM.stubs(:up) end @@ -18,6 +19,13 @@ class CommandsTest < Test::Unit::TestCase Vagrant::Commands.up end + should "error if a persisted VM already exists" do + Vagrant::Env.expects(:persisted_vm).returns(true) + Vagrant::Commands.expects(:error_and_exit).once + Vagrant::VM.expects(:up).never + Vagrant::Commands.up + end + should "call up on VM" do Vagrant::VM.expects(:up).once Vagrant::Commands.up