Sha256: 725b2acb3ee30529ee3b781387fc685da61a60ce8b21cf633df78419d957fd7d

Contents?: true

Size: 641 Bytes

Versions: 18

Compression:

Stored size: 641 Bytes

Contents

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

  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

18 entries across 18 versions & 1 rubygems

Version Path
beaker-1.8.2 spec/mock_blimpy.rb
beaker-1.8.1 spec/mock_blimpy.rb
beaker-1.8.0 spec/mock_blimpy.rb
beaker-1.7.0 spec/mock_blimpy.rb
beaker-1.6.2 spec/mock_blimpy.rb
beaker-1.6.1 spec/mock_blimpy.rb
beaker-1.6.0 spec/mock_blimpy.rb
beaker-1.5.0 spec/mock_blimpy.rb
beaker-1.4.1 spec/mock_blimpy.rb
beaker-1.4.0 spec/mock_blimpy.rb
beaker-1.3.2 spec/mock_blimpy.rb
beaker-1.3.1 spec/mock_blimpy.rb
beaker-1.3.0 spec/mock_blimpy.rb
beaker-1.2.0 spec/mock_blimpy.rb
beaker-1.1.0 spec/mock_blimpy.rb
beaker-1.0.1 spec/mock_blimpy.rb
beaker-1.0.1.pre spec/mock_blimpy.rb
beaker-1.0.0 spec/mock_blimpy.rb