Skip to content

Commit

Permalink
vagrant up can be used the same as vagrant resume [closes hashico…
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Aug 4, 2010
1 parent 1cbc931 commit cf32abb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,7 @@
## 0.5.2 (unreleased)

- `vagrant up` can be used as a way to resume the VM as well (same as
`vagrant resume`). [GH-134]
- Sudo uses "-E" flag to preserve environment for chef provisioners.
This fixes issues with CentOS. [GH-133]
- Added "IdentitiesOnly yes" to options when `vagrant ssh` is run to
Expand Down
1 change: 1 addition & 0 deletions lib/vagrant/vm.rb
Expand Up @@ -103,6 +103,7 @@ def up(options=nil)

def start
return if @vm.running?
return resume if @vm.saved?

env.actions.run(:start)
end
Expand Down
8 changes: 8 additions & 0 deletions test/vagrant/vm_test.rb
Expand Up @@ -203,6 +203,7 @@ def initialize(vm); end
context "starting" do
setup do
@mock_vm.stubs(:running?).returns(false)
@mock_vm.stubs(:saved?).returns(false)
end

should "not do anything if the VM is already running" do
Expand All @@ -211,6 +212,13 @@ def initialize(vm); end
@vm.start
end

should "execute the resume action if saved" do
@mock_vm.expects(:saved?).returns(true)
@vm.expects(:resume).once
@vm.env.actions.expects(:run).with(:start).never
@vm.start
end

should "execute the start action" do
@vm.env.actions.expects(:run).with(:start).once
@vm.start
Expand Down

0 comments on commit cf32abb

Please sign in to comment.