Sha256: 91139dbb13b99b555fdcb30d108d2eb02e67e71096a74e9cb7d2d48ed8ccf717
Contents?: true
Size: 961 Bytes
Versions: 53
Compression:
Stored size: 961 Bytes
Contents
module VagrantTests class DummyProviderPlugin < Vagrant.plugin("2") name "Dummy Provider" description <<-EOF This creates a provider named "dummy" which does nothing, so that the unit tests aren't reliant on VirtualBox (or any other real provider for that matter). EOF provider(:dummy) { DummyProvider } end class DummyProvider < Vagrant.plugin("2", :provider) def initialize(machine) @machine = machine end def state=(id) state_file.open("w+") do |f| f.write(id.to_s) end end def state if !state_file.file? new_state = @machine.id new_state = Vagrant::MachineState::NOT_CREATED_ID if !new_state self.state = new_state end state_id = state_file.read.to_sym Vagrant::MachineState.new(state_id, state_id.to_s, state_id.to_s) end protected def state_file @machine.data_dir.join("dummy_state") end end end
Version data entries
53 entries across 46 versions & 8 rubygems