Sha256: ff7c5da394d2d7b2baf3c7186d1fbd1d637033fb2b5b50f183ccbca50a896e89

Contents?: true

Size: 1.63 KB

Versions: 39

Compression:

Stored size: 1.63 KB

Contents

require 'ecloud/spec_helper'

shared_examples_for "real or mock get_versions requests" do
  if Fog.mocking?

    subject { @vcloud }

    it { should respond_to(:get_versions) }

    describe "#get_versions" do
      subject { @vcloud.get_versions( @vcloud.versions_uri ) }

      it_should_behave_like "all responses"

      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

        its(:xmlns) { should == "http://www.vmware.com/vcloud/versions" }

        its(:VersionInfo) { should be_either_a_hash_or_array }

        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
          }
        end
      end
    end

  end
end

if Fog.mocking?
  describe Fog::Ecloud, :type => :mock_tmrk_ecloud_request do

    it_should_behave_like "real or mock get_versions requests"

    describe "body" do
      subject { @vcloud.get_versions( @vcloud.versions_uri ).body }
      its(:VersionInfo) { should == { :LoginUrl => @mock_version.login_url , :Version => @mock_version.version } }
    end
  end
else
  describe Fog::Ecloud, :type => :mock_tmrk_ecloud_request do
    it_should_behave_like "real or mock get_versions requests"
  end
end

Version data entries

39 entries across 39 versions & 8 rubygems

Version Path
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/spec/ecloud/requests/get_versions_spec.rb
michiels-fog-1.3.1 spec/ecloud/requests/get_versions_spec.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/spec/ecloud/requests/get_versions_spec.rb
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/spec/ecloud/requests/get_versions_spec.rb
fog-1.3.1 spec/ecloud/requests/get_versions_spec.rb
fog-1.3.0 spec/ecloud/requests/get_versions_spec.rb
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/fog/spec/ecloud/requests/get_versions_spec.rb
fog-1.2.0 spec/ecloud/requests/get_versions_spec.rb
ktheory-fog-1.1.2 spec/ecloud/requests/get_versions_spec.rb
brightbox-cli-0.17.4 lib/brightbox-cli/vendor/fog/spec/ecloud/requests/get_versions_spec.rb
brightbox-cli-0.17.3 lib/brightbox-cli/vendor/fog/spec/ecloud/requests/get_versions_spec.rb
brightbox-cli-0.17.2 lib/brightbox-cli/vendor/fog/spec/ecloud/requests/get_versions_spec.rb
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/fog/spec/ecloud/requests/get_versions_spec.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/fog/spec/ecloud/requests/get_versions_spec.rb
fog-1.1.2 spec/ecloud/requests/get_versions_spec.rb
fog_tractical-1.1.4 spec/ecloud/requests/get_versions_spec.rb
fog_tractical-1.1.3 spec/ecloud/requests/get_versions_spec.rb
brightbox-cli-0.16.0 lib/brightbox-cli/vendor/fog/spec/ecloud/requests/get_versions_spec.rb
fog-1.1.1 spec/ecloud/requests/get_versions_spec.rb
fog-1.1.0 spec/ecloud/requests/get_versions_spec.rb