1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/helper.rb

17 lines
888 B
Ruby
Raw Normal View History

2011-01-10 01:12:48 -05:00
require 'fog'
require 'fog/bin' # for available_providers
2010-11-04 14:12:44 -04:00
require File.expand_path(File.join(File.dirname(__FILE__), 'helpers', 'mock_helper'))
2011-01-21 20:42:56 -05:00
def lorem_file
File.open(File.dirname(__FILE__) + '/lorem.txt', 'r')
end
# check to see which credentials are available and add others to the skipped tags list
all_providers = ['aws', 'bluebox', 'brightbox', 'dnsimple', 'dnsmadeeasy', 'dynect', 'ecloud', 'glesys', 'gogrid', 'google', 'linode', 'local', 'ninefold', 'newservers', 'openstack', 'rackspace', 'slicehost', 'stormondemand', 'voxel', 'zerigo']
available_providers = Fog.available_providers.map {|provider| provider.downcase}
for provider in (all_providers - available_providers)
Formatador.display_line("[yellow]Skipping tests for [bold]#{provider}[/] [yellow]due to lacking credentials (add some to '~/.fog' to run them)[/]")
Thread.current[:tags] << ('-' << provider)
end