Specs for existing `Fog::Bin` interface

Prepartion for fog/fog-core#105
This commit is contained in:
Paul Thornthwaite 2014-12-09 20:30:38 +00:00
Родитель fee888931a
Коммит 2cd387622e
48 изменённых файлов: 636 добавлений и 0 удалений

Просмотреть файл

@ -52,6 +52,7 @@ task :travis => ['test', 'test:travis']
Rake::TestTask.new do |t|
t.pattern = File.join("spec", "**", "*_spec.rb")
t.libs << "spec"
end
namespace :test do

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe Atmos do
include Fog::BinSpec
let(:subject) { Atmos }
end

10
spec/fog/bin/aws_spec.rb Normal file
Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe AWS do
include Fog::BinSpec
let(:subject) { AWS }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe BareMetalCloud do
include Fog::BinSpec
let(:subject) { BareMetalCloud }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe Bluebox do
include Fog::BinSpec
let(:subject) { Bluebox }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe Brightbox do
include Fog::BinSpec
let(:subject) { Brightbox }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe Clodo do
include Fog::BinSpec
let(:subject) { Clodo }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe CloudSigma do
include Fog::BinSpec
let(:subject) { CloudSigma }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe Cloudstack do
include Fog::BinSpec
let(:subject) { Cloudstack }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe DigitalOcean do
include Fog::BinSpec
let(:subject) { DigitalOcean }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe DNSimple do
include Fog::BinSpec
let(:subject) { DNSimple }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe DNSMadeEasy do
include Fog::BinSpec
let(:subject) { DNSMadeEasy }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe Dreamhost do
include Fog::BinSpec
let(:subject) { Dreamhost }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe Dynect do
include Fog::BinSpec
let(:subject) { Dynect }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe Ecloud do
include Fog::BinSpec
let(:subject) { Ecloud }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe Fogdocker do
include Fog::BinSpec
let(:subject) { Fogdocker }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe Glesys do
include Fog::BinSpec
let(:subject) { Glesys }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe GoGrid do
include Fog::BinSpec
let(:subject) { GoGrid }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe Google do
include Fog::BinSpec
let(:subject) { Google }
end

10
spec/fog/bin/hp_spec.rb Normal file
Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe HP do
include Fog::BinSpec
let(:subject) { HP }
end

10
spec/fog/bin/ibm_spec.rb Normal file
Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe IBM do
include Fog::BinSpec
let(:subject) { IBM }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe InternetArchive do
include Fog::BinSpec
let(:subject) { InternetArchive }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe Joyent do
include Fog::BinSpec
let(:subject) { Joyent }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe Libvirt do
include Fog::BinSpec
let(:subject) { Libvirt }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe Linode do
include Fog::BinSpec
let(:subject) { Linode }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe Local do
include Fog::BinSpec
let(:subject) { Local }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe Ninefold do
include Fog::BinSpec
let(:subject) { Ninefold }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe OpenNebula do
include Fog::BinSpec
let(:subject) { OpenNebula }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe OpenStack do
include Fog::BinSpec
let(:subject) { OpenStack }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe Openvz do
include Fog::BinSpec
let(:subject) { Openvz }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe Ovirt do
include Fog::BinSpec
let(:subject) { Ovirt }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe ProfitBricks do
include Fog::BinSpec
let(:subject) { ProfitBricks }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe Rackspace do
include Fog::BinSpec
let(:subject) { Rackspace }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe Rage4 do
include Fog::BinSpec
let(:subject) { Rage4 }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe RiakCS do
include Fog::BinSpec
let(:subject) { RiakCS }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe SakuraCloud do
include Fog::BinSpec
let(:subject) { SakuraCloud }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe Serverlove do
include Fog::BinSpec
let(:subject) { Serverlove }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe Softlayer do
include Fog::BinSpec
let(:subject) { Softlayer }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe StormOnDemand do
include Fog::BinSpec
let(:subject) { StormOnDemand }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe Vcloud do
include Fog::BinSpec
let(:subject) { Vcloud }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe VcloudDirector do
include Fog::BinSpec
let(:subject) { VcloudDirector }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe Vmfusion do
include Fog::BinSpec
let(:subject) { Vmfusion }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe Voxel do
include Fog::BinSpec
let(:subject) { Voxel }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe Vsphere do
include Fog::BinSpec
let(:subject) { Vsphere }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe XenServer do
include Fog::BinSpec
let(:subject) { XenServer }
end

Просмотреть файл

@ -0,0 +1,10 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
require "helpers/bin"
describe Zerigo do
include Fog::BinSpec
let(:subject) { Zerigo }
end

155
spec/fog/bin_spec.rb Normal file
Просмотреть файл

@ -0,0 +1,155 @@
require "minitest/autorun"
require "fog"
require "fog/bin"
describe Fog do
describe "#providers" do
it "includes existing providers" do
assert_equal "Atmos", Fog.providers[:atmos]
assert_equal "AWS", Fog.providers[:aws]
assert_equal "BareMetalCloud", Fog.providers[:baremetalcloud]
assert_equal "Bluebox", Fog.providers[:bluebox]
assert_equal "Brightbox", Fog.providers[:brightbox]
assert_equal "Clodo", Fog.providers[:clodo]
assert_equal "CloudSigma", Fog.providers[:cloudsigma]
assert_equal "Cloudstack", Fog.providers[:cloudstack]
assert_equal "DigitalOcean", Fog.providers[:digitalocean]
assert_equal "DNSimple", Fog.providers[:dnsimple]
assert_equal "DNSMadeEasy", Fog.providers[:dnsmadeeasy]
assert_equal "Dreamhost", Fog.providers[:dreamhost]
assert_equal "Dynect", Fog.providers[:dynect]
assert_equal "Ecloud", Fog.providers[:ecloud]
assert_equal "Fogdocker", Fog.providers[:fogdocker]
assert_equal "Glesys", Fog.providers[:glesys]
assert_equal "GoGrid", Fog.providers[:gogrid]
assert_equal "Google", Fog.providers[:google]
assert_equal "HP", Fog.providers[:hp]
assert_equal "IBM", Fog.providers[:ibm]
assert_equal "InternetArchive", Fog.providers[:internetarchive]
assert_equal "Joyent", Fog.providers[:joyent]
assert_equal "Libvirt", Fog.providers[:libvirt]
assert_equal "Linode", Fog.providers[:linode]
assert_equal "Local", Fog.providers[:local]
assert_equal "Ninefold", Fog.providers[:ninefold]
assert_equal "OpenNebula", Fog.providers[:opennebula]
assert_equal "OpenStack", Fog.providers[:openstack]
assert_equal "Openvz", Fog.providers[:openvz]
assert_equal "Ovirt", Fog.providers[:ovirt]
assert_equal "ProfitBricks", Fog.providers[:profitbricks]
assert_equal "Rackspace", Fog.providers[:rackspace]
assert_equal "Rage4", Fog.providers[:rage4]
assert_equal "RiakCS", Fog.providers[:riakcs]
assert_equal "SakuraCloud", Fog.providers[:sakuracloud]
assert_equal "Serverlove", Fog.providers[:serverlove]
assert_equal "Softlayer", Fog.providers[:softlayer]
assert_equal "StormOnDemand", Fog.providers[:stormondemand]
assert_equal "Vcloud", Fog.providers[:vcloud]
assert_equal "VcloudDirector", Fog.providers[:vclouddirector]
assert_equal "Vmfusion", Fog.providers[:vmfusion]
assert_equal "Voxel", Fog.providers[:voxel]
assert_equal "Vsphere", Fog.providers[:vsphere]
assert_equal "XenServer", Fog.providers[:xenserver]
assert_equal "Zerigo", Fog.providers[:zerigo]
end
end
describe "#registered_providers" do
it "includes existing providers" do
assert_includes Fog.registered_providers, "Atmos"
assert_includes Fog.registered_providers, "AWS"
assert_includes Fog.registered_providers, "BareMetalCloud"
assert_includes Fog.registered_providers, "Bluebox"
assert_includes Fog.registered_providers, "Brightbox"
assert_includes Fog.registered_providers, "Clodo"
assert_includes Fog.registered_providers, "CloudSigma"
assert_includes Fog.registered_providers, "Cloudstack"
assert_includes Fog.registered_providers, "DigitalOcean"
assert_includes Fog.registered_providers, "DNSimple"
assert_includes Fog.registered_providers, "DNSMadeEasy"
assert_includes Fog.registered_providers, "Dreamhost"
assert_includes Fog.registered_providers, "Dynect"
assert_includes Fog.registered_providers, "Ecloud"
assert_includes Fog.registered_providers, "Fogdocker"
assert_includes Fog.registered_providers, "Glesys"
assert_includes Fog.registered_providers, "GoGrid"
assert_includes Fog.registered_providers, "Google"
assert_includes Fog.registered_providers, "HP"
assert_includes Fog.registered_providers, "IBM"
assert_includes Fog.registered_providers, "InternetArchive"
assert_includes Fog.registered_providers, "Joyent"
assert_includes Fog.registered_providers, "Libvirt"
assert_includes Fog.registered_providers, "Linode"
assert_includes Fog.registered_providers, "Local"
assert_includes Fog.registered_providers, "Ninefold"
assert_includes Fog.registered_providers, "OpenNebula"
assert_includes Fog.registered_providers, "OpenStack"
assert_includes Fog.registered_providers, "Openvz"
assert_includes Fog.registered_providers, "Ovirt"
assert_includes Fog.registered_providers, "ProfitBricks"
assert_includes Fog.registered_providers, "Rackspace"
assert_includes Fog.registered_providers, "Rage4"
assert_includes Fog.registered_providers, "RiakCS"
assert_includes Fog.registered_providers, "SakuraCloud"
assert_includes Fog.registered_providers, "Serverlove"
assert_includes Fog.registered_providers, "Softlayer"
assert_includes Fog.registered_providers, "StormOnDemand"
assert_includes Fog.registered_providers, "Vcloud"
assert_includes Fog.registered_providers, "VcloudDirector"
assert_includes Fog.registered_providers, "Vmfusion"
assert_includes Fog.registered_providers, "Voxel"
assert_includes Fog.registered_providers, "Vsphere"
assert_includes Fog.registered_providers, "XenServer"
assert_includes Fog.registered_providers, "Zerigo"
end
end
describe "#available_providers" do
it "includes existing providers" do
assert_includes Fog.available_providers, "Atmos" if Atmos.available?
assert_includes Fog.available_providers, "AWS" if AWS.available?
assert_includes Fog.available_providers, "BareMetalCloud" if BareMetalCloud.available?
assert_includes Fog.available_providers, "Bluebox" if Bluebox.available?
assert_includes Fog.available_providers, "Brightbox" if Brightbox.available?
assert_includes Fog.available_providers, "Clodo" if Clodo.available?
assert_includes Fog.available_providers, "CloudSigma" if CloudSigma.available?
assert_includes Fog.available_providers, "Cloudstack" if Cloudstack.available?
assert_includes Fog.available_providers, "DigitalOcean" if DigitalOcean.available?
assert_includes Fog.available_providers, "DNSimple" if DNSimple.available?
assert_includes Fog.available_providers, "DNSMadeEasy" if DNSMadeEasy.available?
assert_includes Fog.available_providers, "Dreamhost" if Dreamhost.available?
assert_includes Fog.available_providers, "Dynect" if Dynect.available?
assert_includes Fog.available_providers, "Ecloud" if Ecloud.available?
assert_includes Fog.available_providers, "Fogdocker" if Fogdocker.available?
assert_includes Fog.available_providers, "Glesys" if Glesys.available?
assert_includes Fog.available_providers, "GoGrid" if GoGrid.available?
assert_includes Fog.available_providers, "Google" if Google.available?
assert_includes Fog.available_providers, "HP" if HP.available?
assert_includes Fog.available_providers, "IBM" if IBM.available?
assert_includes Fog.available_providers, "InternetArchive" if InternetArchive.available?
assert_includes Fog.available_providers, "Joyent" if Joyent.available?
assert_includes Fog.available_providers, "Libvirt" if Libvirt.available?
assert_includes Fog.available_providers, "Linode" if Linode.available?
assert_includes Fog.available_providers, "Local" if Local.available?
assert_includes Fog.available_providers, "Ninefold" if Ninefold.available?
assert_includes Fog.available_providers, "OpenNebula" if OpenNebula.available?
assert_includes Fog.available_providers, "OpenStack" if OpenStack.available?
assert_includes Fog.available_providers, "Openvz" if Openvz.available?
assert_includes Fog.available_providers, "Ovirt" if Ovirt.available?
assert_includes Fog.available_providers, "ProfitBricks" if ProfitBricks.available?
assert_includes Fog.available_providers, "Rackspace" if Rackspace.available?
assert_includes Fog.available_providers, "Rage4" if Rage4.available?
assert_includes Fog.available_providers, "RiakCS" if RiakCS.available?
assert_includes Fog.available_providers, "SakuraCloud" if SakuraCloud.available?
assert_includes Fog.available_providers, "Serverlove" if Serverlove.available?
assert_includes Fog.available_providers, "Softlayer" if Softlayer.available?
assert_includes Fog.available_providers, "StormOnDemand" if StormOnDemand.available?
assert_includes Fog.available_providers, "Vcloud" if Vcloud.available?
assert_includes Fog.available_providers, "VcloudDirector" if VcloudDirector.available?
assert_includes Fog.available_providers, "Vmfusion" if Vmfusion.available?
assert_includes Fog.available_providers, "Voxel" if Voxel.available?
assert_includes Fog.available_providers, "Vsphere" if Vsphere.available?
assert_includes Fog.available_providers, "XenServer" if XenServer.available?
assert_includes Fog.available_providers, "Zerigo" if Zerigo.available?
end
end
end

30
spec/helpers/bin.rb Normal file
Просмотреть файл

@ -0,0 +1,30 @@
module Fog
module BinSpec
extend Minitest::Spec::DSL
it "responds to available?" do
assert_respond_to subject, :available?
end
it "responds to class_for" do
assert_respond_to subject, :class_for
end
it "#class_for raises ArgumentError for unknown services" do
assert_raises(ArgumentError) { subject.class_for(:unknown) }
end
it "responds to collections" do
skip if subject == ::Google
assert_respond_to subject, :collections
end
it "responds to []" do
assert_respond_to subject, :[]
end
it "responds to services" do
assert_respond_to subject, :services
end
end
end