lib/test-kitchen/platform.rb in test-kitchen-0.6.0 vs lib/test-kitchen/platform.rb in test-kitchen-0.7.0.beta.1

- old
+ new

@@ -39,16 +39,32 @@ class Version include Chef::Mixin::ParamsValidate attr_reader :name + + # Virtual Box Specific Attributes attr_writer :box, :box_url def initialize(name, &block) raise ArgumentError, "Version name must be specified" if name.nil? || name.empty? @name = name instance_eval(&block) if block_given? end + + OPENSTACK_OPTIONS = { + :image_id => nil, :flavor_id => nil, :install_chef => false, + :install_chef_cmd => "curl -L http://www.opscode.com/chef/install.sh | sudo bash", + :keyname => nil, :instance_name => nil, :ssh_user => "root", :ssh_key => nil} + + OPENSTACK_OPTIONS.each do |option, default| + attr_writer option + define_method(option) do |*args| + arg = args.first + set_or_return(option, arg, default.nil? ? {} : {:default => default}) + end + end + def box(arg=nil) set_or_return(:box, arg, {}) end