Sha256: fc3fec9a44c89fc14aa25a202ad840bcb075a6c813c657924e812286b72f876f

Contents?: true

Size: 1.31 KB

Versions: 36

Compression:

Stored size: 1.31 KB

Contents

group "EC2"
library :rudy, 'lib'

tryouts "Volumes" do
  set :global, Rudy::Huxtable.global
  setup do
    Rudy::Huxtable.update_config
    Rudy::AWS::EC2.connect global.accesskey, global.secretkey, global.region
  end
  
  drill "no existing volumes", false do
    Rudy::AWS::EC2::Volumes.any? :available
  end
  
  dream :class, Rudy::AWS::EC2::Volume
  dream :size, 2
  dream(:zone) { Rudy::Huxtable.global.zone }
  dream :proc, lambda { |v| !v.awsid.nil? }
  drill "create a 2GB volume" do
    Rudy::AWS::EC2::Volumes.create 2, Rudy::Huxtable.global.zone
  end
  
  dream :class, Array
  dream :empty?, false
  drill "list available volumes" do
    Rudy::AWS::EC2::Volumes.list :available
  end
  
  dream :class, Hash
  dream :empty?, false
  drill "list available volumes as hash" do
    Rudy::AWS::EC2::Volumes.list_as_hash :available
  end
  
  dream :class, Rudy::AWS::EC2::Volume
  dream :size, 2
  dream :available?, true
  drill "get a specific volume" do
    volid = Rudy::AWS::EC2::Volumes.list(:available).first.awsid
    Rudy::AWS::EC2::Volumes.get volid
  end
  
  drill "destroy all volumes", false do
    volumes = Rudy::AWS::EC2::Volumes.list
    volumes.each do |vol|
      next unless vol.available?
      Rudy::AWS::EC2::Volumes.destroy(vol.awsid)
    end
    Rudy::AWS::EC2::Volumes.any? :available
  end
  
  
end

Version data entries

36 entries across 36 versions & 2 rubygems

Version Path
rudy-0.9.8.005 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.8.004 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.8.003 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.8.002 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.8.001 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.7.001 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.6.001 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.5.004 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.5.003 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.5.002 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.5 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.4 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.3 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.2 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.0 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.1 tryouts/25_ec2/40_volumes_tryouts.rb