Sha256: ee555de480900f234db8c50f6f004ff266344d4fb513b448a0329675bea10b5e

Contents?: true

Size: 1.01 KB

Versions: 26

Compression:

Stored size: 1.01 KB

Contents

require File.expand_path("#{File.dirname(__FILE__)}/../lib/heroku/api")

require 'rubygems'
gem 'minitest' # ensure we are using the gem version
require 'minitest/autorun'
require 'time'

DATA_PATH = File.expand_path("#{File.dirname(__FILE__)}/data")
MOCK = ENV['MOCK'] != 'false'

def data_site_crt
  @data_site_crt ||= File.read(File.join(DATA_PATH, 'site.crt'))
end

def data_site_key
  @data_site_key ||= File.read(File.join(DATA_PATH, 'site.key'))
end

def heroku
  # ENV['HEROKU_API_KEY'] used for :api_key
  Heroku::API.new(:mock => MOCK)
end

def random_domain
  "#{random_name}.com"
end

def random_name
  "heroku-rb-#{SecureRandom.hex(10)}"
end

def random_email_address
  "email@#{random_name}.com"
end

def with_app(params={}, &block)
  begin
    data = heroku.post_app(params).body
    @name = data['name']
    ready = false
    until ready
      ready = heroku.request(:method => :put, :path => "/apps/#{@name}/status").status == 201
    end
    yield(data)
  ensure
    heroku.delete_app(@name) rescue nil
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
heroku-api-0.4.3 test/test_helper.rb
heroku-api-0.4.2 test/test_helper.rb
heroku-api-0.4.1 test/test_helper.rb
heroku-api-0.4.0 test/test_helper.rb
heroku-api-0.3.23 test/test_helper.rb
heroku-api-0.3.22 test/test_helper.rb
heroku-api-0.3.21 test/test_helper.rb
heroku-api-0.3.20 test/test_helper.rb
heroku-api-0.3.19 test/test_helper.rb
heroku-api-0.3.18 test/test_helper.rb
heroku-api-0.3.17 test/test_helper.rb
heroku-api-0.3.16 test/test_helper.rb
heroku-api-0.3.15 test/test_helper.rb
heroku-api-0.3.14 test/test_helper.rb
heroku-api-0.3.13 test/test_helper.rb
heroku-api-0.3.12 test/test_helper.rb
heroku-api-0.3.11 test/test_helper.rb
heroku-api-0.3.10 test/test_helper.rb
pogoapp-api-0.3.8 test/test_helper.rb
heroku-api-0.3.9 test/test_helper.rb