2010-05-03 00:46:43 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Vcloud do
|
|
|
|
it { should be_initialized }
|
|
|
|
|
2010-06-17 19:58:09 -04:00
|
|
|
it { should have(3).services }
|
2010-05-03 00:46:43 -04:00
|
|
|
|
|
|
|
describe "#registered_services" do
|
|
|
|
subject { Vcloud.registered_services }
|
|
|
|
|
2010-06-17 19:58:09 -04:00
|
|
|
it { should == ":ecloud, :etest, :vcloud" }
|
2010-05-03 00:46:43 -04:00
|
|
|
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
|