Sha256: bd399389ec8775037c8b9b453e90d5312973752f591b14ec8ba6e46d6bf3b9f4

Contents?: true

Size: 648 Bytes

Versions: 29

Compression:

Stored size: 648 Bytes

Contents

class MockShip 
  attr_accessor :name, :ports, :image_id, :flavor, :region, :username, :dns, :tags

  def initialize
    @dns = "my.ip.address"
  end

  def wait_for_sshd
    @dns = "#{@name}.my.ip"
    return true
  end

end

class MockFleet
  attr_accessor :ships
  @@attempts = 0

  def initialize
    @ships = []
  end

  def add type
    @ships << MockShip.new
    yield(@ships[-1])
    @ships[-1]
  end

  def start
    if @@attempts < 1
      @@attempts += 1
      raise Fog::Errors::Error
    end
  end

  def destroy
  end

end

class MockBlimpy 
  @@fleet = nil
  def self.fleet 
    yield(@@fleet = MockFleet.new)
    @@fleet
  end

end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
beaker-1.12.2 spec/mock_blimpy.rb
beaker-1.12.1 spec/mock_blimpy.rb
beaker-1.12.0 spec/mock_blimpy.rb
beaker-1.11.2 spec/mock_blimpy.rb
beaker-1.11.1 spec/mock_blimpy.rb
beaker-1.11.0 spec/mock_blimpy.rb
beaker-1.10.0 spec/mock_blimpy.rb
beaker-1.9.1 spec/mock_blimpy.rb
beaker-1.9.0 spec/mock_blimpy.rb