Sha256: 7ab79d5f27c36432ee136f5ed6869f7c68fb8228976eaceae9d84fc2349e3717

Contents?: true

Size: 728 Bytes

Versions: 8

Compression:

Stored size: 728 Bytes

Contents

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

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

MOCK = ENV['MOCK'] != 'false'

def heroku
  # ENV['HEROKU_API_KEY'] used for :api_key
  Heroku::API.new(:mock => MOCK)
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

8 entries across 8 versions & 1 rubygems

Version Path
heroku-api-0.1.7 test/test_helper.rb
heroku-api-0.1.6 test/test_helper.rb
heroku-api-0.1.5 test/test_helper.rb
heroku-api-0.1.4 test/test_helper.rb
heroku-api-0.1.3 test/test_helper.rb
heroku-api-0.1.2 test/test_helper.rb
heroku-api-0.1.1 test/test_helper.rb
heroku-api-0.1.0 test/test_helper.rb