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
solutious-rudy-0.9.0 tryouts/25_ec2/40_volumes_tryouts.rb
solutious-rudy-0.9.1 tryouts/25_ec2/40_volumes_tryouts.rb
solutious-rudy-0.9.2 tryouts/25_ec2/40_volumes_tryouts.rb
solutious-rudy-0.9.3 tryouts/25_ec2/40_volumes_tryouts.rb
solutious-rudy-0.9.4 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.8.020 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.8.019 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.8.018 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.8.017 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.8.016 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.8.015 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.8.014 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.8.013 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.8.012 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.8.011 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.8.010 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.8.009 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.8.008 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.8.007 tryouts/25_ec2/40_volumes_tryouts.rb
rudy-0.9.8.006 tryouts/25_ec2/40_volumes_tryouts.rb