Permalink
Browse files

[ecloud|compute] skip more tests unless mocked

  • Loading branch information...
1 parent 2a02fdd commit 1bfc211758f1773ee0c1a8a67bf17ba31206fd00 @geemus geemus committed Feb 25, 2011
Showing with 24 additions and 21 deletions.
  1. +24 −21 spec/ecloud/requests/get_versions_spec.rb
@@ -1,39 +1,42 @@
require 'ecloud/spec_helper'
shared_examples_for "real or mock get_versions requests" do
+ if Fog.mocking?
- subject { @vcloud }
+ subject { @vcloud }
- it { should respond_to(:get_versions) }
+ it { should respond_to(:get_versions) }
- describe "#get_versions" do
- subject { @vcloud.get_versions( @vcloud.versions_uri ) }
+ describe "#get_versions" do
+ subject { @vcloud.get_versions( @vcloud.versions_uri ) }
- it_should_behave_like "all responses"
+ it_should_behave_like "all responses"
- describe "body" do
- subject { @vcloud.get_versions( @vcloud.versions_uri ).body }
+ describe "body" do
+ subject { @vcloud.get_versions( @vcloud.versions_uri ).body }
- it { should have(4).keys }
- it_should_behave_like "it has the standard xmlns attributes" # 2 keys
+ it { should have(4).keys }
+ it_should_behave_like "it has the standard xmlns attributes" # 2 keys
- its(:xmlns) { should == "http://www.vmware.com/vcloud/versions" }
+ its(:xmlns) { should == "http://www.vmware.com/vcloud/versions" }
- its(:VersionInfo) { should be_either_a_hash_or_array }
+ its(:VersionInfo) { should be_either_a_hash_or_array }
- describe ":VersionInfo" do
- subject { arrayify(@vcloud.get_versions( @vcloud.versions_uri ).body[:VersionInfo]) }
+ describe ":VersionInfo" do
+ subject { arrayify(@vcloud.get_versions( @vcloud.versions_uri ).body[:VersionInfo]) }
- specify {
- subject.each do |version_info|
- version_info.should include(:LoginUrl)
- version_info[:LoginUrl].should be_a_url
- version_info.should include(:Version)
- version_info[:Version].should be_an_instance_of(String)
- end
- }
+ specify {
+ subject.each do |version_info|
+ version_info.should include(:LoginUrl)
+ version_info[:LoginUrl].should be_a_url
+ version_info.should include(:Version)
+ version_info[:Version].should be_an_instance_of(String)
+ end
+ }
+ end
end
end
+
end
end

0 comments on commit 1bfc211

Please sign in to comment.