diff --git a/lib/vagrant-lxc/machine_state.rb b/lib/vagrant-lxc/machine_state.rb index a3bbc0d..cbc8361 100644 --- a/lib/vagrant-lxc/machine_state.rb +++ b/lib/vagrant-lxc/machine_state.rb @@ -1,7 +1,7 @@ module Vagrant module LXC class MachineState < Vagrant::MachineState - CREATED_STATES = %w( running poweroff ).map!(&:to_sym) + CREATED_STATES = %w( running stopped ).map!(&:to_sym) def initialize(state_id) short = state_id.to_s.gsub("_", " ") @@ -14,7 +14,7 @@ module Vagrant end def off? - self.id == :poweroff + self.id == :stopped end def running? diff --git a/spec/support/unit_example_group.rb b/spec/support/unit_example_group.rb index 13cd1f2..f6751a3 100644 --- a/spec/support/unit_example_group.rb +++ b/spec/support/unit_example_group.rb @@ -5,6 +5,7 @@ module UnitExampleGroup Object.any_instance.stub(:system) { |*args, &block| UnitExampleGroup.prevent_system_calls(*args, &block) } + require 'vagrant/util/subprocess' Vagrant::Util::Subprocess.stub(:execute) { |*args, &block| UnitExampleGroup.prevent_system_calls(*args, &block) } diff --git a/spec/unit/machine_state_spec.rb b/spec/unit/machine_state_spec.rb index 9865372..e1082b4 100644 --- a/spec/unit/machine_state_spec.rb +++ b/spec/unit/machine_state_spec.rb @@ -29,8 +29,8 @@ describe Vagrant::LXC::MachineState do it { should_not be_off } end - context 'when state id is :poweroff' do - subject { described_class.new(:poweroff) } + context 'when state id is :stopped' do + subject { described_class.new(:stopped) } it { should be_created } it { should be_off }