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.21.0 spec/mock_blimpy.rb
beaker-1.20.1 spec/mock_blimpy.rb
beaker-1.20.0 spec/mock_blimpy.rb
beaker-1.19.1 spec/mock_blimpy.rb
beaker-1.19.0 spec/mock_blimpy.rb
beaker-1.18.0 spec/mock_blimpy.rb
beaker-1.17.7 spec/mock_blimpy.rb
beaker-1.17.6 spec/mock_blimpy.rb
beaker-1.17.5 spec/mock_blimpy.rb
beaker-1.17.4 spec/mock_blimpy.rb
beaker-1.17.3 spec/mock_blimpy.rb
beaker-1.17.2 spec/mock_blimpy.rb
beaker-1.17.1 spec/mock_blimpy.rb
beaker-1.17.0 spec/mock_blimpy.rb
beaker-1.16.0 spec/mock_blimpy.rb
beaker-1.15.0 spec/mock_blimpy.rb
beaker-1.14.1 spec/mock_blimpy.rb
beaker-1.14.0 spec/mock_blimpy.rb
beaker-1.13.1 spec/mock_blimpy.rb
beaker-1.13.0 spec/mock_blimpy.rb