Sha256: b9b5c5fa5897796a43b16d71276729a318afdbf51980e4c6db53ab79610a9ea3
Contents?: true
Size: 1008 Bytes
Versions: 1
Compression:
Stored size: 1008 Bytes
Contents
# frozen_string_literal: true module RSpec module Terraform module Helpers module Actions module Validate def validate(parameters) missing_parameters = required_parameters(execution_mode) .filter { |parameter| parameters[parameter].nil? } return if missing_parameters.empty? raise_missing_parameters(missing_parameters) end private def raise_missing_parameters(parameters) parameters = parameters.collect { |parameter| "`:#{parameter}`" } if parameters.count == 1 raise StandardError, "Required parameter: #{parameters[0]} missing." else parameters = "#{parameters[..-2].join(', ')} and #{parameters[-1]}" raise StandardError, "Required parameters: #{parameters} missing." end end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rspec-terraform-0.1.0.pre.47 | lib/rspec/terraform/helpers/actions/validate.rb |