Sha256: 8405e293b35d0d8fac7306ae7f5d9456461f37a31183d124f9243b2edcd39a8d

Contents?: true

Size: 946 Bytes

Versions: 150

Compression:

Stored size: 946 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

150 entries across 150 versions & 1 rubygems

Version Path
beaker-2.48.1 spec/mock_fission.rb
beaker-2.48.0 spec/mock_fission.rb
beaker-2.47.1 spec/mock_fission.rb
beaker-2.47.0 spec/mock_fission.rb
beaker-2.46.0 spec/mock_fission.rb
beaker-2.45.0 spec/mock_fission.rb
beaker-2.44.0 spec/mock_fission.rb
beaker-2.43.0 spec/mock_fission.rb
beaker-2.42.0 spec/mock_fission.rb
beaker-2.41.0 spec/mock_fission.rb
beaker-2.40.0 spec/mock_fission.rb
beaker-2.39.0 spec/mock_fission.rb
beaker-2.38.1 spec/mock_fission.rb
beaker-2.38.0 spec/mock_fission.rb
beaker-2.37.0 spec/mock_fission.rb
beaker-2.36.0 spec/mock_fission.rb
beaker-2.35.0 spec/mock_fission.rb
beaker-2.34.0 spec/mock_fission.rb
beaker-2.33.0 spec/mock_fission.rb
beaker-2.32.1 spec/mock_fission.rb