mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
d48db03314
Purpose is to better abstract individual services
31 lines
743 B
Ruby
31 lines
743 B
Ruby
require 'spec_helper'
|
|
|
|
describe Vcloud do
|
|
it { should be_initialized }
|
|
|
|
it { should have(2).services }
|
|
|
|
describe "#registered_services" do
|
|
subject { Vcloud.registered_services }
|
|
|
|
it { should == ":ecloud, :vcloud" }
|
|
end
|
|
|
|
describe "when indexing it like an array" do
|
|
describe "with a service that exists" do
|
|
before do
|
|
Fog::Vcloud.should_receive(:new).and_return(true)
|
|
end
|
|
it "should return something when indexed with a configured service" do
|
|
Vcloud[:ecloud].should_not be_nil
|
|
end
|
|
end
|
|
|
|
describe "with a service that does not exist" do
|
|
it "should raise an ArgumentError" do
|
|
lambda {Vcloud[:foozle]}.should raise_error(ArgumentError)
|
|
end
|
|
end
|
|
|
|
end
|
|
end
|