Sha256: 794f2b0beb0c3c160aca3076887c73035a74d83f2ff170fdf575c3a26c7d6149

Contents?: true

Size: 942 Bytes

Versions: 55

Compression:

Stored size: 942 Bytes

Contents

class Response
  attr_accessor :code, :message, :data
  def initialize(code = 0, message = '', data = nil)
    @code = code
    @message = message
    @data = data
  end
end

class MockFissionVM
  attr_accessor :name
  @@snaps = []
  def initialize name
    @name = name
    @running = true
  end

  def self.set_snapshots snaps
    @@snaps = snaps
  end

  def snapshots
    Response.new(0, '', @@snaps)
  end

  def revert_to_snapshot name
    @running = false
  end

  def running?
    Response.new(0, '', @running)
  end

  def start opt
    @running = true
  end

  def exists?
    true
  end
end

class MockFission
  @@vms = []
  def self.presets hosts
    snaps = []
    hosts.each do |host|
      @@vms << MockFissionVM.new( host.name )
      snaps << host[ :snapshot ]
    end
    MockFissionVM.set_snapshots(snaps)
  end

  def self.all
    Response.new(0, '', @@vms)
  end
  def self.new name
    MockFissionVM.new(name)
  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
beaker-4.38.1 spec/mock_fission.rb
beaker-4.38.0 spec/mock_fission.rb
beaker-4.37.2 spec/mock_fission.rb
beaker-4.37.1 spec/mock_fission.rb
beaker-4.37.0 spec/mock_fission.rb
beaker-4.36.1 spec/mock_fission.rb
beaker-4.36.0 spec/mock_fission.rb
beaker-4.35.0 spec/mock_fission.rb
beaker-4.34.0 spec/mock_fission.rb
beaker-4.33.0 spec/mock_fission.rb
beaker-4.32.0 spec/mock_fission.rb
beaker-4.31.0 spec/mock_fission.rb
beaker-4.30.0 spec/mock_fission.rb
beaker-4.29.1 spec/mock_fission.rb
beaker-4.29.0 spec/mock_fission.rb
beaker-4.28.1 spec/mock_fission.rb
beaker-4.28.0 spec/mock_fission.rb
beaker-4.27.1 spec/mock_fission.rb
beaker-4.27.0 spec/mock_fission.rb
beaker-4.26.0 spec/mock_fission.rb