Sha256: 26a5b92ac7b2b7ceba7800e148c400bf9f7a9e8cfec349de068afd13687bb24f

Contents?: true

Size: 1.7 KB

Versions: 59

Compression:

Stored size: 1.7 KB

Contents

require File.dirname(__FILE__) + '/../../../spec_helper'

describe 'Fog::AWS::EC2::Volumes' do

  describe "#all" do

    it "should return a Fog::AWS::EC2::Volumes" do
      AWS[:ec2].volumes.all.should be_a(Fog::AWS::EC2::Volumes)
    end

    it "should include persisted volumes" do
      volume = AWS[:ec2].volumes.create(:availability_zone => 'us-east-1a', :size => 1, :device => 'dev/sdz1')
      AWS[:ec2].volumes.get(volume.id).should_not be_nil
      volume.destroy
    end

  end

  describe "#create" do

    before(:each) do
      @volume = AWS[:ec2].volumes.create(:availability_zone => 'us-east-1a', :size => 1, :device => 'dev/sdz1')
    end

    after(:each) do
      @volume.destroy
    end

    it "should return a Fog::AWS::EC2::Volume" do
      @volume.should be_a(Fog::AWS::EC2::Volume)
    end

    it "should exist on ec2" do
      AWS[:ec2].volumes.get(@volume.id).should_not be_nil
    end

  end

  describe "#get" do

    it "should return a Fog::AWS::EC2::Volume if a matching volume exists" do
      volume = AWS[:ec2].volumes.create(:availability_zone => 'us-east-1a', :size => 1, :device => 'dev/sdz1')
      volume.wait_for { ready? }
      get = AWS[:ec2].volumes.get(volume.id)
      volume.attributes.should == get.attributes
      volume.destroy
    end

    it "should return nil if no matching address exists" do
      AWS[:ec2].volumes.get('vol-00000000').should be_nil
    end

  end

  describe "#new" do

    it "should return a Fog::AWS::EC2::Volume" do
      AWS[:ec2].volumes.new.should be_a(Fog::AWS::EC2::Volume)
    end

  end

  describe "#reload" do

    it "should return a Fog::AWS::EC2::Volumes" do
      AWS[:ec2].volumes.all.reload.should be_a(Fog::AWS::EC2::Volumes)
    end

  end

end

Version data entries

59 entries across 59 versions & 2 rubygems

Version Path
fog-0.2.30 spec/aws/models/ec2/volumes_spec.rb
fog-0.2.28 spec/aws/models/ec2/volumes_spec.rb
fog-0.2.27 spec/aws/models/ec2/volumes_spec.rb
fog-0.2.26 spec/aws/models/ec2/volumes_spec.rb
fog-0.2.25 spec/aws/models/ec2/volumes_spec.rb
fog-0.2.24 spec/aws/models/ec2/volumes_spec.rb
tecnh-fog-0.2.23.vpc spec/aws/models/ec2/volumes_spec.rb
fog-0.2.23 spec/aws/models/ec2/volumes_spec.rb
fog-0.2.22 spec/aws/models/ec2/volumes_spec.rb
fog-0.2.21 spec/aws/models/ec2/volumes_spec.rb
fog-0.2.20 spec/aws/models/ec2/volumes_spec.rb
fog-0.2.19 spec/aws/models/ec2/volumes_spec.rb
fog-0.2.18 spec/aws/models/ec2/volumes_spec.rb
fog-0.2.17 spec/aws/models/ec2/volumes_spec.rb
fog-0.2.16 spec/aws/models/ec2/volumes_spec.rb
fog-0.2.15 spec/aws/models/ec2/volumes_spec.rb
fog-0.2.14 spec/aws/models/ec2/volumes_spec.rb
fog-0.2.13 spec/aws/models/ec2/volumes_spec.rb
fog-0.2.12 spec/aws/models/ec2/volumes_spec.rb
fog-0.2.11 spec/aws/models/ec2/volumes_spec.rb