2010-06-17 19:58:09 -04:00
|
|
|
require File.join(File.dirname(__FILE__), '..', 'spec_helper')
|
2010-05-03 00:46:43 -04:00
|
|
|
|
2010-06-17 19:58:09 -04:00
|
|
|
if Fog.mocking?
|
|
|
|
describe Fog::Vcloud, :type => :mock_vcloud_request do
|
|
|
|
subject { @vcloud }
|
2010-05-03 00:46:43 -04:00
|
|
|
|
2010-06-17 19:58:09 -04:00
|
|
|
it { should respond_to :get_versions }
|
2010-05-03 00:46:43 -04:00
|
|
|
|
2010-06-17 19:58:09 -04:00
|
|
|
describe "#get_versions" do
|
|
|
|
before { @versions = @vcloud.get_versions( @vcloud.versions_uri ) }
|
|
|
|
subject { @versions }
|
2010-05-03 00:46:43 -04:00
|
|
|
|
2010-06-17 19:58:09 -04:00
|
|
|
it_should_behave_like "all responses"
|
2010-05-03 00:46:43 -04:00
|
|
|
|
2010-06-17 19:58:09 -04:00
|
|
|
describe "body" do
|
|
|
|
subject { @versions.body }
|
2010-05-03 00:46:43 -04:00
|
|
|
|
2010-06-17 19:58:09 -04:00
|
|
|
it { should have(4).keys }
|
|
|
|
it_should_behave_like "it has the standard xmlns attributes" # 2 keys
|
2010-05-03 00:46:43 -04:00
|
|
|
|
2010-06-17 19:58:09 -04:00
|
|
|
its(:xmlns) { should == "http://www.vmware.com/vcloud/versions" }
|
|
|
|
its(:VersionInfo) { should == { :LoginUrl => @mock_version[:login_url] , :Version => @mock_version[:version] } }
|
2010-05-03 00:46:43 -04:00
|
|
|
|
2010-06-17 19:58:09 -04:00
|
|
|
end
|
2010-05-03 00:46:43 -04:00
|
|
|
end
|
|
|
|
end
|
2010-06-17 19:58:09 -04:00
|
|
|
else
|
2010-05-03 00:46:43 -04:00
|
|
|
end
|