spec/spec_helper.rb in kumogata-0.2.12 vs spec/spec_helper.rb in kumogata-0.2.13

- old
+ new

@@ -22,10 +22,11 @@ $stdout = open('/dev/null', 'w') unless ENV['DEBUG'] kumogata_template = options[:template] kumogata_arguments = options[:arguments] || [] kumogata_options = Kumogata::ArgumentParser::DEFAULT_OPTIONS.merge(options[:options] || {}) + kumogata_options[:result_log] = '/dev/null' template_ext = options[:template_ext] || '.rb' client = Kumogata::Client.new(kumogata_options) cloud_formation = client.instance_variable_get(:@cloud_formation) yield(client, cloud_formation) if block_given? @@ -50,16 +51,29 @@ if options[:update_deletion_policy] update_deletion_policy(template) end + if options[:add_encryption_password] + add_encryption_password(template) + end + return template end def update_deletion_policy(template) template['Resources'].each do |k, v| v['DeletionPolicy'] = 'Retain' end +end + +def add_encryption_password(template) + template['Parameters'] ||= {} + + template['Parameters'][Kumogata::ENCRYPTION_PASSWORD] = { + 'Type' => 'String', + 'NoEcho' => 'true', + } end def make_double(name) obj = double(name) yield(obj)