Sha256: b53101a48822d88db32dfc273e90006facd744d81575fd9111f8d9326720b76f

Contents?: true

Size: 1.42 KB

Versions: 36

Compression:

Stored size: 1.42 KB

Contents

group "EC2"
library :rudy, 'lib'

tryouts "Groups" do
  set :global, Rudy::Huxtable.global
  set :group_name, 'grp-' << Rudy::Utils.strand
  set :group_desc, 'desc-' << group_name
  setup do
    Rudy::Huxtable.update_config
    Rudy::AWS::EC2.connect global.accesskey, global.secretkey, global.region
  end
  
  dream :class, Rudy::AWS::EC2::Group
  dream :name, group_name
  dream :description, "Security Group #{group_name}"
  drill "create group with name" do
    Rudy::AWS::EC2::Groups.create group_name
  end
  
  dream :class, Rudy::AWS::EC2::Group
  dream :name, "#{group_name}2"
  dream :description, group_desc
  drill "create group with name and description" do
    Rudy::AWS::EC2::Groups.create "#{group_name}2", group_desc
  end
  
  drill "list as Array", :class, Array do
    Rudy::AWS::EC2::Groups.list
  end
  
  drill "list as Hash", :class, Hash do
    Rudy::AWS::EC2::Groups.list_as_hash
  end
  
  dream :size, 1  # will equal 2 if test fails
  drill "list returns Group objects" do
    list = Rudy::AWS::EC2::Groups.list
    list.collect! do |group|
      group.is_a?(Rudy::AWS::EC2::Group)
    end
    list.uniq
  end
  
  dream :class, Array
  dream :size, 1
  drill "destroy groups" do
    list = Rudy::AWS::EC2::Groups.list
    list.collect! do |group|
      next if group.name == "default" # can't delete this default group
      Rudy::AWS::EC2::Groups.destroy group.name
    end
    Rudy::AWS::EC2::Groups.list
  end
end


Version data entries

36 entries across 36 versions & 2 rubygems

Version Path
solutious-rudy-0.9.0 tryouts/25_ec2/20_groups_tryouts.rb
solutious-rudy-0.9.1 tryouts/25_ec2/20_groups_tryouts.rb
solutious-rudy-0.9.2 tryouts/25_ec2/20_groups_tryouts.rb
solutious-rudy-0.9.3 tryouts/25_ec2/20_groups_tryouts.rb
solutious-rudy-0.9.4 tryouts/25_ec2/20_groups_tryouts.rb
rudy-0.9.8.020 tryouts/25_ec2/20_groups_tryouts.rb
rudy-0.9.8.019 tryouts/25_ec2/20_groups_tryouts.rb
rudy-0.9.8.018 tryouts/25_ec2/20_groups_tryouts.rb
rudy-0.9.8.017 tryouts/25_ec2/20_groups_tryouts.rb
rudy-0.9.8.016 tryouts/25_ec2/20_groups_tryouts.rb
rudy-0.9.8.015 tryouts/25_ec2/20_groups_tryouts.rb
rudy-0.9.8.014 tryouts/25_ec2/20_groups_tryouts.rb
rudy-0.9.8.013 tryouts/25_ec2/20_groups_tryouts.rb
rudy-0.9.8.012 tryouts/25_ec2/20_groups_tryouts.rb
rudy-0.9.8.011 tryouts/25_ec2/20_groups_tryouts.rb
rudy-0.9.8.010 tryouts/25_ec2/20_groups_tryouts.rb
rudy-0.9.8.009 tryouts/25_ec2/20_groups_tryouts.rb
rudy-0.9.8.008 tryouts/25_ec2/20_groups_tryouts.rb
rudy-0.9.8.007 tryouts/25_ec2/20_groups_tryouts.rb
rudy-0.9.8.006 tryouts/25_ec2/20_groups_tryouts.rb