diff --git a/Gemfile b/Gemfile index 8244525c3..828a31f35 100644 --- a/Gemfile +++ b/Gemfile @@ -1,18 +1,19 @@ -source 'https://rubygems.org' +source "https://rubygems.org" -gem 'faraday' -gem 'faraday_middleware' -gem 'inspec-bin' -gem 'rake' +gem "faraday" +gem "faraday_middleware" +gem "inspec-bin" +gem "rake" group :development do - gem 'pry' - gem 'pry-byebug' + gem "pry" + gem "pry-byebug" end group :development, :test do - gem 'minitest' - gem 'rubocop', '~> 1.39.0' - gem 'simplecov', '~> 0.21' - gem 'simplecov_json_formatter' + gem "chefstyle", "~> 2.2.2" + gem "minitest" + gem "rubocop", "~> 1.25.1", require: false + gem "simplecov", "~> 0.21" + gem "simplecov_json_formatter" end diff --git a/Rakefile b/Rakefile index 458aeac3c..12f7cfec6 100644 --- a/Rakefile +++ b/Rakefile @@ -1,43 +1,57 @@ -require 'bundler' -require 'bundler/gem_helper' -require 'rake/testtask' -require 'rubocop/rake_task' -require 'fileutils' -require 'open3' +require "bundler" +require "bundler/gem_helper" +require "rake/testtask" +require "rubocop/rake_task" +require "fileutils" +require "open3" +require "chefstyle" -require_relative 'lib/attribute_file_writer' -require_relative 'lib/environment_file' +require_relative "lib/attribute_file_writer" +require_relative "lib/environment_file" RuboCop::RakeTask.new FIXTURE_DIR = "#{Dir.pwd}/test/fixtures".freeze -TERRAFORM_DIR = 'terraform'.freeze +TERRAFORM_DIR = "terraform".freeze REQUIRED_ENVS = %w{AZURE_CLIENT_ID AZURE_CLIENT_SECRET AZURE_TENANT_ID AZURE_SUBSCRIPTION_ID}.freeze -INTEGRATION_DIR = 'test/integration/verify'.freeze -TF_PLAN_FILE_NAME = 'inspec-azure.plan'.freeze +INTEGRATION_DIR = "test/integration/verify".freeze +TF_PLAN_FILE_NAME = "inspec-azure.plan".freeze TF_PLAN_FILE = File.join(TERRAFORM_DIR, TF_PLAN_FILE_NAME) -ATTRIBUTES_FILE_NAME = ''.freeze +ATTRIBUTES_FILE_NAME = "".freeze task default: :test -desc 'Testing tasks' +desc "Testing tasks" task test: %w{lint test:unit} -desc 'Linting tasks' -task lint: [:rubocop, :'syntax:ruby', :'syntax:inspec'] +desc "Linting tasks" +# task lint: [:rubocop, :'syntax:ruby', :'syntax:inspec'] + +desc "Run rubocop chefstyle linter + unit tests" +task default: [:lint, :test] + +# lint the project +# chefstyle +begin + RuboCop::RakeTask.new(:lint) do |task| + task.options += ["--display-cop-names", "--no-color", "--parallel"] + end +rescue LoadError + puts "rubocop is not available. Install the rubocop gem to run the lint tests." +end task :setup_env do - puts '-> Loading Environment Variables' - ENV['TF_VAR_subscription_id'] = ENV['AZURE_SUBSCRIPTION_ID'] - ENV['TF_VAR_tenant_id'] = ENV['AZURE_TENANT_ID'] - ENV['TF_VAR_client_id'] = ENV['AZURE_CLIENT_ID'] - ENV['TF_VAR_client_secret'] = ENV['AZURE_CLIENT_SECRET'] + puts "-> Loading Environment Variables" + ENV["TF_VAR_subscription_id"] = ENV["AZURE_SUBSCRIPTION_ID"] + ENV["TF_VAR_tenant_id"] = ENV["AZURE_TENANT_ID"] + ENV["TF_VAR_client_id"] = ENV["AZURE_CLIENT_ID"] + ENV["TF_VAR_client_secret"] = ENV["AZURE_CLIENT_SECRET"] - puts '-> Ensuring required Environment Variables are set' + puts "-> Ensuring required Environment Variables are set" missing = REQUIRED_ENVS.reject { |var| ENV.key?(var) } - abort("ENV missing: #{missing.join(', ')}") if missing.any? + abort("ENV missing: #{missing.join(", ")}") if missing.any? # Notify user which optional components they are using - options = EnvironmentFile.options('.envrc') + options = EnvironmentFile.options(".envrc") if options.empty? puts "-> You are not using any optional components. See the README for more information.\n\n" else @@ -50,9 +64,9 @@ task :setup_env do end namespace :syntax do - desc 'InSpec syntax check' + desc "InSpec syntax check" task :inspec do - puts '-> Checking InSpec Control Syntax' + puts "-> Checking InSpec Control Syntax" stdout, status = Open3.capture2("bundle exec inspec vendor #{INTEGRATION_DIR} --overwrite --chef-license accept-silent && bundle exec inspec check #{INTEGRATION_DIR}") puts stdout @@ -64,15 +78,15 @@ namespace :syntax do status.exitstatus end - desc 'Ruby syntax check' + desc "Ruby syntax check" task :ruby do - puts '-> Checking Ruby Syntax' - files = %w{Gemfile Rakefile} + Dir['./lib*/**/*.rb'] + Dir['./test/**/*.rb'] + puts "-> Checking Ruby Syntax" + files = %w{Gemfile Rakefile} + Dir["./lib*/**/*.rb"] + Dir["./test/**/*.rb"] files.each do |file| - sh('ruby', '-c', file) do |ok, res| + sh("ruby", "-c", file) do |ok, res| next if ok - puts 'Syntax check FAILED' + puts "Syntax check FAILED" exit res.exitstatus end end @@ -80,46 +94,46 @@ namespace :syntax do end namespace :azure do - desc 'Authenticate with the Azure CLI' + desc "Authenticate with the Azure CLI" task login: [:setup_env] do - puts '-> Logging into Azure' + puts "-> Logging into Azure" sh( - 'az', 'login', - '--service-principal', - '-u', ENV['AZURE_CLIENT_ID'], - '-p', ENV['AZURE_CLIENT_SECRET'], - '--tenant', ENV['AZURE_TENANT_ID'] + "az", "login", + "--service-principal", + "-u", ENV["AZURE_CLIENT_ID"], + "-p", ENV["AZURE_CLIENT_SECRET"], + "--tenant", ENV["AZURE_TENANT_ID"] ) - puts '-> Setting Subscription' + puts "-> Setting Subscription" sh( - 'az', 'account', 'set', - '-s', ENV['AZURE_SUBSCRIPTION_ID'] + "az", "account", "set", + "-s", ENV["AZURE_SUBSCRIPTION_ID"] ) end end namespace :test do # set env - ENV['RAKE_ENV'] = 'test' + ENV["RAKE_ENV"] = "test" # Minitest Rake::TestTask.new(:unit) do |t| - t.libs << 'test/unit' - t.libs << 'libraries' + t.libs << "test/unit" + t.libs << "libraries" t.verbose = true t.warning = false - t.test_files = FileList['test/unit/**/*_test.rb'] + t.test_files = FileList["test/unit/**/*_test.rb"] end - task :integration, [:controls] => ['tf:write_tf_output_to_file', :setup_env] do |_t, args| + task :integration, [:controls] => ["tf:write_tf_output_to_file", :setup_env] do |_t, args| cmd = %W( bundle exec inspec exec #{INTEGRATION_DIR} - --input-file terraform/#{ENV['ATTRIBUTES_FILE']} + --input-file terraform/#{ENV["ATTRIBUTES_FILE"]} --reporter cli --no-distinct-exit - -t azure://#{ENV['AZURE_SUBSCRIPTION_ID']} + -t azure://#{ENV["AZURE_SUBSCRIPTION_ID"]} --chef-license accept-silent ) if args[:controls] - sh(*cmd, '--controls', args[:controls], *args.extras) + sh(*cmd, "--controls", args[:controls], *args.extras) else sh(*cmd) end @@ -127,42 +141,42 @@ namespace :test do end namespace :tf do # rubocop:disable Metrics/BlockLength - workspace = ENV['WORKSPACE'] + workspace = ENV["WORKSPACE"] task init: [:'azure:login'] do - abort('$WORKSPACE not set. Please source .envrc.') if workspace.nil? - abort('$WORKSPACE has no content. Check .envrc.') if workspace.empty? + abort("$WORKSPACE not set. Please source .envrc.") if workspace.nil? + abort("$WORKSPACE has no content. Check .envrc.") if workspace.empty? Dir.chdir(TERRAFORM_DIR) do - sh('terraform', 'init') + sh("terraform", "init") end end task workspace: [:init] do Dir.chdir(TERRAFORM_DIR) do - sh('terraform', 'workspace', 'select', workspace) do |ok, _| + sh("terraform", "workspace", "select", workspace) do |ok, _| next if ok - sh('terraform', 'workspace', 'new', workspace) + sh("terraform", "workspace", "new", workspace) end end end - desc 'Creates a Terraform execution plan from the plan file' + desc "Creates a Terraform execution plan from the plan file" task :plan, [:optionals] => [:workspace] do |_t, args| if args[:optionals] ignore_list = Array(args[:optionals]) + args.extras ignore_list.each do |component| - ENV["TF_VAR_#{component}_count"] = '0' + ENV["TF_VAR_#{component}_count"] = "0" end end Dir.chdir(TERRAFORM_DIR) do - sh('terraform', 'get') - sh('terraform', 'plan', '-out', 'inspec-azure.plan') + sh("terraform", "get") + sh("terraform", "plan", "-out", "inspec-azure.plan") end - Rake::Task['tf:write_tf_output_to_file'].invoke + Rake::Task["tf:write_tf_output_to_file"].invoke end - desc 'Executes the Terraform plan' + desc "Executes the Terraform plan" task :apply, [:optionals] do |_t, args| if File.exist?(TF_PLAN_FILE) puts "-> Applying an existing terraform plan: #{TF_PLAN_FILE}" @@ -170,50 +184,50 @@ namespace :tf do # rubocop:disable Metrics/BlockLength puts "These arguments are ignored: #{Array(args[:optionals]) + args.extras}." end else - Rake::Task['tf:plan'].invoke(args[:optionals]) + Rake::Task["tf:plan"].invoke(args[:optionals]) end Dir.chdir(TERRAFORM_DIR) do - sh('terraform', 'apply', 'inspec-azure.plan') + sh("terraform", "apply", "inspec-azure.plan") end end - desc 'Destroys the Terraform environment' + desc "Destroys the Terraform environment" task destroy: [:workspace] do Dir.chdir(TERRAFORM_DIR) do - sh('terraform', 'destroy', '-force') + sh("terraform", "destroy", "-force") end end task write_tf_output_to_file: [:workspace] do Dir.chdir(TERRAFORM_DIR) do - stdout, stderr, status = Open3.capture3('terraform output -json') + stdout, stderr, status = Open3.capture3("terraform output -json") abort(stderr) unless status.success? - abort('$ATTRIBUTES_FILE not set. Please source .envrc.') if ENV['ATTRIBUTES_FILE'].nil? - abort('$ATTRIBUTES_FILE has no content. Check .envrc.') if ENV['ATTRIBUTES_FILE'].empty? + abort("$ATTRIBUTES_FILE not set. Please source .envrc.") if ENV["ATTRIBUTES_FILE"].nil? + abort("$ATTRIBUTES_FILE has no content. Check .envrc.") if ENV["ATTRIBUTES_FILE"].empty? - AttributeFileWriter.write_yaml(ENV['ATTRIBUTES_FILE'], stdout) + AttributeFileWriter.write_yaml(ENV["ATTRIBUTES_FILE"], stdout) end end end namespace :docs do - desc 'Prints markdown links for resource doc files to update the README' + desc "Prints markdown links for resource doc files to update the README" task :resource_links do puts "\n" - Dir.entries('docs/resources').sort - .reject { |file| File.directory?(file) } - .collect { |file| "- [#{file.split('.')[0]}](docs/resources/#{file})" } - .map { |link| puts link } + Dir.entries("docs/resources").sort + .reject { |file| File.directory?(file) } + .collect { |file| "- [#{file.split(".")[0]}](docs/resources/#{file})" } + .map { |link| puts link } puts "\n" end end namespace :attributes do - desc 'Create attributes used for integration testing' + desc "Create attributes used for integration testing" task :write do - abort('$ATTRIBUTES_FILE not set. Please source .envrc.') if ENV['ATTRIBUTES_FILE'].nil? - abort('$ATTRIBUTES_FILE has no content. Check .envrc.') if ENV['ATTRIBUTES_FILE'].empty? - Rake::Task['tf:write_tf_output_to_file'].invoke + abort("$ATTRIBUTES_FILE not set. Please source .envrc.") if ENV["ATTRIBUTES_FILE"].nil? + abort("$ATTRIBUTES_FILE has no content. Check .envrc.") if ENV["ATTRIBUTES_FILE"].empty? + Rake::Task["tf:write_tf_output_to_file"].invoke end end diff --git a/lib/attribute_file_writer.rb b/lib/attribute_file_writer.rb index 5c7560eac..2483d7c61 100644 --- a/lib/attribute_file_writer.rb +++ b/lib/attribute_file_writer.rb @@ -1,5 +1,5 @@ -require 'yaml' -require 'json' +require "yaml" +require "json" unless defined?(JSON) class AttributeFileWriter def self.write_yaml(file, content) @@ -20,12 +20,12 @@ def convert_to_yaml(content) json = JSON.parse(content) yaml = {} json.each_key do |key| - yaml[key] = json[key]['value'] + yaml[key] = json[key]["value"] end - File.open(@file, 'w') { |file| file.puts(yaml.to_yaml) } + File.open(@file, "w") { |file| file.puts(yaml.to_yaml) } end def append(content) - File.open(@file, 'a') { |file| file.puts(content) } + File.open(@file, "a") { |file| file.puts(content) } end end diff --git a/lib/environment_file.rb b/lib/environment_file.rb index 77301c6e7..cb10afcb5 100644 --- a/lib/environment_file.rb +++ b/lib/environment_file.rb @@ -21,7 +21,7 @@ def current_options end def synchronize(envs) - raise "The following options are unknown: #{unknown(envs)}. Please use only: #{OPTIONS.join(',')}." unless unknown(envs).empty? + raise "The following options are unknown: #{unknown(envs)}. Please use only: #{OPTIONS.join(",")}." unless unknown(envs).empty? add_vars(envs) remove_vars(OPTIONS - envs) @@ -49,7 +49,7 @@ def export_statement(key, value) "export #{key}=#{value}\n" end - def set_var(key, value = 'true') + def set_var(key, value = "true") found, new_content = replace_key(key, value) do |k, v| export_statement(k, v) end @@ -61,14 +61,14 @@ def set_var(key, value = 'true') def remove_var(key) _, new_content = replace_key(key) do |_key, _value| - '' + "" end File.write(@file.path, new_content) end def key?(key) - File.open(@file.path, 'r').each_line do |line| + File.open(@file.path, "r").each_line do |line| if match_export_statement(key, line) return true end @@ -78,10 +78,10 @@ def key?(key) end def replace_key(key, value = nil, &formatter) - new_content = '' + new_content = "" found = false - File.open(@file.path, 'r').each_line do |line| + File.open(@file.path, "r").each_line do |line| if match_export_statement(key, line) new_content << formatter.call(key, value) found = true diff --git a/libraries/azure_active_directory_domain_service.rb b/libraries/azure_active_directory_domain_service.rb index fe3aa7307..e753a53c1 100644 --- a/libraries/azure_active_directory_domain_service.rb +++ b/libraries/azure_active_directory_domain_service.rb @@ -1,8 +1,8 @@ -require 'azure_graph_generic_resource' +require "azure_graph_generic_resource" class AzureActiveDirectoryDomainService < AzureGraphGenericResource - name 'azure_active_directory_domain_service' - desc 'Verifies settings for an Azure AD Domain Service' + name "azure_active_directory_domain_service" + desc "Verifies settings for an Azure AD Domain Service" example <<-EXAMPLE describe azure_active_directory_domain_service(id: 'M365x214355.onmicrosoft.com') do it { should exist } @@ -10,9 +10,9 @@ class AzureActiveDirectoryDomainService < AzureGraphGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource] = 'domains' + opts[:resource] = "domains" opts[:resource_identifiers] = %i(id) super(opts, true) end diff --git a/libraries/azure_active_directory_domain_services.rb b/libraries/azure_active_directory_domain_services.rb index ef1053cd3..ebc798a9c 100644 --- a/libraries/azure_active_directory_domain_services.rb +++ b/libraries/azure_active_directory_domain_services.rb @@ -1,8 +1,8 @@ -require 'azure_graph_generic_resources' +require "azure_graph_generic_resources" class AzureActiveDirectoryDomainServices < AzureGraphGenericResources - name 'azure_active_directory_domain_services' - desc 'Verifies settings for all Azure Active Directory Domain Services' + name "azure_active_directory_domain_services" + desc "Verifies settings for all Azure Active Directory Domain Services" example <<-EXAMPLE describe azure_active_directory_domain_services do it { should exist } @@ -10,9 +10,9 @@ class AzureActiveDirectoryDomainServices < AzureGraphGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource] = 'domains' + opts[:resource] = "domains" opts[:select] = %w{id authenticationType availabilityStatus isAdminManaged isDefault isInitial isRoot isVerified supportedServices passwordNotificationWindowInDays passwordValidityPeriodInDays state} super(opts, true) diff --git a/libraries/azure_active_directory_object.rb b/libraries/azure_active_directory_object.rb index dfb4c533d..e5c7d80bc 100644 --- a/libraries/azure_active_directory_object.rb +++ b/libraries/azure_active_directory_object.rb @@ -1,8 +1,8 @@ -require 'azure_graph_generic_resource' +require "azure_graph_generic_resource" class AzureActiveDirectoryObject < AzureGraphGenericResource - name 'azure_active_directory_object' - desc 'Verifies settings for an Azure Active Directory Object' + name "azure_active_directory_object" + desc "Verifies settings for an Azure Active Directory Object" example <<-EXAMPLE describe azure_active_directory_object(id: '0bf29229-50d7-433c-b08e-2a5d8b293cb5') do it { should exist } @@ -10,9 +10,9 @@ class AzureActiveDirectoryObject < AzureGraphGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource] = 'directoryObjects' + opts[:resource] = "directoryObjects" opts[:resource_identifiers] = %i(id) super(opts, true) end diff --git a/libraries/azure_active_directory_objects.rb b/libraries/azure_active_directory_objects.rb index 90fbbf2a7..a4c8be3f8 100644 --- a/libraries/azure_active_directory_objects.rb +++ b/libraries/azure_active_directory_objects.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureActiveDirectoryObjects < AzureGraphGenericResources - name 'azure_active_directory_objects' - desc 'Retrieves and verifies all policy exemptions that apply to a subscription' + name "azure_active_directory_objects" + desc "Retrieves and verifies all policy exemptions that apply to a subscription" example <<-EXAMPLE describe azure_active_directory_objects do it { should exist } @@ -10,10 +10,10 @@ class AzureActiveDirectoryObjects < AzureGraphGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource] = 'me/getMemberObjects' - opts[:method] = 'post' + opts[:resource] = "me/getMemberObjects" + opts[:method] = "post" # At this point there is enough data to make the query. # super must be called with `static_resource => true` switch. diff --git a/libraries/azure_aks_cluster.rb b/libraries/azure_aks_cluster.rb index 08d80ba21..8c7563c35 100644 --- a/libraries/azure_aks_cluster.rb +++ b/libraries/azure_aks_cluster.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureAksCluster < AzureGenericResource - name 'azure_aks_cluster' - desc 'Verifies settings for AKS Clusters' + name "azure_aks_cluster" + desc "Verifies settings for AKS Clusters" example <<-EXAMPLE describe azure_aks_cluster(resource_group: 'example', name: 'name') do its(name) { should eq 'name'} @@ -11,9 +11,9 @@ class AzureAksCluster < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ContainerService/managedClusters', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.ContainerService/managedClusters", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -27,9 +27,9 @@ def diagnostic_settings return unless exists? additional_resource_properties( { - property_name: 'diagnostic_settings', + property_name: "diagnostic_settings", property_endpoint: "#{id}/providers/microsoft.insights/diagnosticSettings", - api_version: '2017-05-01-preview', + api_version: "2017-05-01-preview", }, ) end @@ -56,8 +56,8 @@ def disabled_logging_types # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermAksCluster < AzureAksCluster - name 'azurerm_aks_cluster' - desc 'Verifies settings for AKS Clusters' + name "azurerm_aks_cluster" + desc "Verifies settings for AKS Clusters" example <<-EXAMPLE describe azurerm_aks_cluster(resource_group: 'example', name: 'name') do its(name) { should eq 'name'} @@ -66,11 +66,11 @@ class AzurermAksCluster < AzureAksCluster def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureAksCluster.name) # For backward compatibility. - opts[:api_version] ||= '2018-03-31' + opts[:api_version] ||= "2018-03-31" super end end diff --git a/libraries/azure_aks_clusters.rb b/libraries/azure_aks_clusters.rb index 15767d220..0f0b86fa3 100644 --- a/libraries/azure_aks_clusters.rb +++ b/libraries/azure_aks_clusters.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureAksClusters < AzureGenericResources - name 'azure_aks_clusters' - desc 'Verifies settings for AKS Clusters' + name "azure_aks_clusters" + desc "Verifies settings for AKS Clusters" example <<-EXAMPLE azure_aks_clusters(resource_group: 'example') do it{ should exist } @@ -13,9 +13,9 @@ class AzureAksClusters < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ContainerService/managedClusters', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.ContainerService/managedClusters", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -47,8 +47,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermAksClusters < AzureAksClusters - name 'azurerm_aks_clusters' - desc 'Verifies settings for AKS Clusters' + name "azurerm_aks_clusters" + desc "Verifies settings for AKS Clusters" example <<-EXAMPLE azurerm_aks_clusters(resource_group: 'example') do it{ should exist } @@ -58,10 +58,10 @@ class AzurermAksClusters < AzureAksClusters def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureAksClusters.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2018-03-31' + opts[:api_version] ||= "2018-03-31" super end end diff --git a/libraries/azure_api_management.rb b/libraries/azure_api_management.rb index 0a8a8250c..9e7857e5e 100644 --- a/libraries/azure_api_management.rb +++ b/libraries/azure_api_management.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureApiManagement < AzureGenericResource - name 'azure_api_management' - desc 'Verifies settings for an Azure Api Management Service' + name "azure_api_management" + desc "Verifies settings for an Azure Api Management Service" example <<-EXAMPLE describe azure_api_management(resource_group: 'rg-1', name: 'apim01') do it { should exist } @@ -11,9 +11,9 @@ class AzureApiManagement < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ApiManagement/service', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.ApiManagement/service", opts) opts[:resource_identifiers] = %i(api_management_name) @@ -29,8 +29,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermApiManagement < AzureApiManagement - name 'azurerm_api_management' - desc 'Verifies settings for an Azure Api Management Service' + name "azurerm_api_management" + desc "Verifies settings for an Azure Api Management Service" example <<-EXAMPLE describe azurerm_api_management(resource_group: 'rg-1', api_management_name: 'apim01') do it { should exist } @@ -40,10 +40,10 @@ class AzurermApiManagement < AzureApiManagement def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureApiManagement.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2019-12-01' + opts[:api_version] ||= "2019-12-01" super end end diff --git a/libraries/azure_api_managements.rb b/libraries/azure_api_managements.rb index 65afd8eb5..faa6b184b 100644 --- a/libraries/azure_api_managements.rb +++ b/libraries/azure_api_managements.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureApiManagements < AzureGenericResources - name 'azure_api_managements' - desc 'Verifies settings for a collection of Azure Api Management Services' + name "azure_api_managements" + desc "Verifies settings for a collection of Azure Api Management Services" example <<-EXAMPLE describe azure_api_managements do it { should exist } @@ -13,9 +13,9 @@ class AzureApiManagements < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ApiManagement/service', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.ApiManagement/service", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -48,8 +48,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermApiManagements < AzureApiManagements - name 'azurerm_api_managements' - desc 'Verifies settings for a collection of Azure Api Management Services' + name "azurerm_api_managements" + desc "Verifies settings for a collection of Azure Api Management Services" example <<-EXAMPLE describe azurerm_api_managements do it { should exist } @@ -59,10 +59,10 @@ class AzurermApiManagements < AzureApiManagements def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureApiManagements.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2019-12-01' + opts[:api_version] ||= "2019-12-01" super end end diff --git a/libraries/azure_application_gateway.rb b/libraries/azure_application_gateway.rb index 0ec4fdfab..c73837362 100644 --- a/libraries/azure_application_gateway.rb +++ b/libraries/azure_application_gateway.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureApplicationGateway < AzureGenericResource - name 'azure_application_gateway' - desc 'Verifies settings for an Azure Application Gateway' + name "azure_application_gateway" + desc "Verifies settings for an Azure Application Gateway" example <<-EXAMPLE describe azure_application_gateway(resource_group: 'rg-1', name: 'lb-1') do it { should exist } @@ -11,9 +11,9 @@ class AzureApplicationGateway < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/applicationGateways', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/applicationGateways", opts) opts[:resource_identifiers] = %i(application_gateway_name) # static_resource parameter must be true for setting the resource_provider in the backend. @@ -28,8 +28,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermApplicationGateway < AzureApplicationGateway - name 'azurerm_application_gateway' - desc 'Verifies settings for an Azure Application Gateway' + name "azurerm_application_gateway" + desc "Verifies settings for an Azure Application Gateway" example <<-EXAMPLE describe azurerm_application_gateway(resource_group: 'rg-1', application_gateway_name: 'lb-1') do it { should exist } @@ -39,10 +39,10 @@ class AzurermApplicationGateway < AzureApplicationGateway def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureApplicationGateway.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2019-12-01' + opts[:api_version] ||= "2019-12-01" super end end diff --git a/libraries/azure_application_gateways.rb b/libraries/azure_application_gateways.rb index a031b7d89..687aa05b0 100644 --- a/libraries/azure_application_gateways.rb +++ b/libraries/azure_application_gateways.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureApplicationGateways < AzureGenericResources - name 'azure_application_gateways' - desc 'Verifies settings for a collection of Azure Application Gateways' + name "azure_application_gateways" + desc "Verifies settings for a collection of Azure Application Gateways" example <<-EXAMPLE describe azure_application_gateways do it { should exist } @@ -13,9 +13,9 @@ class AzureApplicationGateways < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/applicationGateways', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/applicationGateways", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -48,8 +48,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermApplicationGateways < AzureApplicationGateways - name 'azurerm_application_gateways' - desc 'Verifies settings for a collection of Azure Application Gateways' + name "azurerm_application_gateways" + desc "Verifies settings for a collection of Azure Application Gateways" example <<-EXAMPLE describe azurerm_application_gateways do it { should exist } @@ -59,10 +59,10 @@ class AzurermApplicationGateways < AzureApplicationGateways def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureApplicationGateways.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2019-12-01' + opts[:api_version] ||= "2019-12-01" super end end diff --git a/libraries/azure_backend.rb b/libraries/azure_backend.rb index c82c60a81..61bd90b06 100644 --- a/libraries/azure_backend.rb +++ b/libraries/azure_backend.rb @@ -1,4 +1,4 @@ -require 'backend/azure_require' +require "backend/azure_require" ENV_HASH = ENV.map { |k, v| [k.downcase, v] }.to_h @@ -17,7 +17,7 @@ # class AzureResourceBase < Inspec.resource(1) def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) @opts = opts # Populate client_args to specify AzureConnection @@ -31,7 +31,7 @@ def initialize(opts = {}) @client_args = {} # If not provided, the endpoint will be the Global Cloud portal. # https://azure.microsoft.com/en-gb/global-infrastructure/ - @client_args[:endpoint] = @opts[:endpoint] || ENV_HASH['endpoint'] || 'azure_cloud' + @client_args[:endpoint] = @opts[:endpoint] || ENV_HASH["endpoint"] || "azure_cloud" unless AzureEnvironments::ENDPOINTS.key?(@client_args[:endpoint]) raise ArgumentError, "Invalid endpoint: `#{@client_args[:endpoint]}`."\ " Expected one of the following options: #{AzureEnvironments::ENDPOINTS.keys}." @@ -41,9 +41,9 @@ def initialize(opts = {}) endpoint = AzureEnvironments.get_endpoint(@client_args[:endpoint]) @client_args[:endpoint] = endpoint # Set HTTP client retry parameters, defining the timeout exception behavior, if provided. - @client_args[:azure_retry_limit] = @opts[:azure_retry_limit] || ENV_HASH['azure_retry_limit'] - @client_args[:azure_retry_backoff] = @opts[:azure_retry_backoff] || ENV_HASH['azure_retry_backoff'] - @client_args[:azure_retry_backoff_factor] = @opts[:azure_retry_backoff_factor] || ENV_HASH['azure_retry_backoff_factor'] + @client_args[:azure_retry_limit] = @opts[:azure_retry_limit] || ENV_HASH["azure_retry_limit"] + @client_args[:azure_retry_backoff] = @opts[:azure_retry_backoff] || ENV_HASH["azure_retry_backoff"] + @client_args[:azure_retry_backoff_factor] = @opts[:azure_retry_backoff_factor] || ENV_HASH["azure_retry_backoff_factor"] # Fail resource if the http client is not properly set up. begin @@ -56,7 +56,7 @@ def initialize(opts = {}) # We can't raise an error due to `InSpec check` builds up a dummy backend and any error at this stage fails it. unless @azure.credentials.values.compact.delete_if(&:empty?).size == 4 - Inspec::Log.error 'The following must be set in the Environment:'\ + Inspec::Log.error "The following must be set in the Environment:"\ " #{@azure.credentials.keys}.\n"\ "Missing: #{@azure.credentials.keys.select { |key| @azure.credentials[key].nil? }}" end @@ -87,12 +87,12 @@ def resource_from_graph_api(opts) Validators.validate_parameters(resource_name: @__resource_name__, allow: %i(api_version query_parameters), required: %i(resource), opts: opts) api_version = opts[:api_version] || @azure.graph_api_endpoint_api_version - if api_version.size > 10 || api_version.include?('/') - raise ArgumentError, 'api version can not be longer than 10 characters and contain `/`.' + if api_version.size > 10 || api_version.include?("/") + raise ArgumentError, "api version can not be longer than 10 characters and contain `/`." end - resource_trimmed = opts[:resource].delete_suffix('/').delete_prefix('/') + resource_trimmed = opts[:resource].delete_suffix("/").delete_prefix("/") endpoint_url = @azure.graph_api_endpoint_url - url = [endpoint_url, api_version, resource_trimmed].join('/') + url = [endpoint_url, api_version, resource_trimmed].join("/") if opts[:query_parameters].nil? @azure.rest_api_call(url: url) else @@ -123,24 +123,24 @@ def resource_from_graph_api(opts) # - GET https://management.azure.com/subscriptions/{subscription_id}/resources?api-version=2019-10-01& # $filter=resourceGroup eq '{resource_group}' and name eq '{resource_name}' def resource_short(opts) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) url = Helpers.construct_url([ @azure.resource_manager_endpoint_url, - 'subscriptions', - @azure.credentials[:subscription_id], 'resources' + "subscriptions", + @azure.credentials[:subscription_id], "resources" ]) api_version = @azure.resource_manager_endpoint_api_version params = { - '$filter' => Helpers.odata_query(opts), - '$expand' => Helpers.odata_query(%w{createdTime changedTime provisioningState}), - 'api-version' => api_version, + "$filter" => Helpers.odata_query(opts), + "$expand" => Helpers.odata_query(%w{createdTime changedTime provisioningState}), + "api-version" => api_version, } short_description, suggested_api_version = rescue_wrong_api_call(url: url, params: params) # If suggested_api_version is not nil, then the resource manager api version should be updated. unless suggested_api_version.nil? @resource_manager_endpoint_api = suggested_api_version Inspec::Log.warn "Resource manager endpoint api version should be updated with #{suggested_api_version} in"\ - ' `libraries/backend/helpers.rb`' + " `libraries/backend/helpers.rb`" end short_description[:value] || [] end @@ -155,16 +155,16 @@ def rescue_wrong_api_call(opts) begin response = @azure.rest_api_call(opts) rescue UnsuccessfulAPIQuery::UnexpectedHTTPResponse::InvalidApiVersionParameter => e - api_version_suggested = e.suggested_api_version(opts[:params]['api-version']) - unless opts[:params]['api-version'] == 'failed_attempt' + api_version_suggested = e.suggested_api_version(opts[:params]["api-version"]) + unless opts[:params]["api-version"] == "failed_attempt" Inspec::Log.warn "Incompatible api version provided for the `#{@__resource_name__}` resource:"\ - " #{opts[:params]['api-version']}\n"\ + " #{opts[:params]["api-version"]}\n"\ "Trying with the latest api version suggested by the Azure Rest API: #{api_version_suggested}." end if api_version_suggested.nil? - Inspec::Log.warn 'Failed to acquire suggested api version from the Azure Rest API.' + Inspec::Log.warn "Failed to acquire suggested api version from the Azure Rest API." else - opts[:params].merge!({ 'api-version' => api_version_suggested }) + opts[:params].merge!({ "api-version" => api_version_suggested }) response = @azure.rest_api_call(opts) end end @@ -187,11 +187,11 @@ def construct_resource_id unless required_arguments.all? { |resource_provider| @opts.keys.include?(resource_provider) } id_in_list = [ "/subscriptions/#{@azure.credentials[:subscription_id]}", - 'resourceGroups', @opts[:resource_group], - 'providers', @opts[:resource_provider], @opts[:resource_path], + "resourceGroups", @opts[:resource_group], + "providers", @opts[:resource_provider], @opts[:resource_path], @opts[:name] ].compact - id_in_list.join('/').gsub('//', '/') + id_in_list.join("/").gsub("//", "/") end # Get the detailed information of an Azure cloud resource by its resource_id from resource manager endpoint. @@ -247,8 +247,8 @@ def get_resource(opts = {}) allow: %i(query_parameters headers method req_body is_uri_a_url audience), opts: opts) params = opts[:query_parameters] || {} - api_version = params['api-version'] || 'latest' - if opts[:resource_uri].scan('providers').size == 1 + api_version = params["api-version"] || "latest" + if opts[:resource_uri].scan("providers").size == 1 # If the resource provider is unknown then this method can't find the api_version. # The latest api_version will de acquired from the error message via #rescue_wrong_api_call method. _resource_group, provider, r_type = Helpers.res_group_provider_type_from_uri(opts[:resource_uri]) @@ -261,22 +261,22 @@ def get_resource(opts = {}) api_version_info = get_api_version(provider, r_type, api_version) if provider # Something was wrong at get_api_version, and we will try to get a valid api_version via rescue_wrong_api_call # by providing an invalid api_version intentionally. - api_version_info[:api_version] = 'failed_attempt' if api_version_info[:api_version].nil? + api_version_info[:api_version] = "failed_attempt" if api_version_info[:api_version].nil? else - api_version_info = { api_version: api_version, api_version_status: 'user_provided' } + api_version_info = { api_version: api_version, api_version_status: "user_provided" } end # Some resource names can contain spaces. Decode them before parsing with URI. if opts[:is_uri_a_url] - url = opts[:resource_uri].gsub(' ', '%20') + url = opts[:resource_uri].gsub(" ", "%20") else - url = Helpers.construct_url([@azure.resource_manager_endpoint_url, opts[:resource_uri].gsub(' ', '%20')]) + url = Helpers.construct_url([@azure.resource_manager_endpoint_url, opts[:resource_uri].gsub(" ", "%20")]) end - opts_call = { url: url, params: params.merge!({ 'api-version' => api_version_info[:api_version] }) } + opts_call = { url: url, params: params.merge!({ "api-version" => api_version_info[:api_version] }) } %i(headers method req_body audience).each { |param| opts_call[param] = opts[param] unless opts[param].nil? } long_description, suggested_api_version = rescue_wrong_api_call(opts_call) if long_description.is_a?(Hash) long_description[:api_version_used_for_query] = suggested_api_version || api_version_info[:api_version] - long_description[:api_version_used_for_query_state] = suggested_api_version.nil? ? api_version_info[:api_version_status] : 'latest' + long_description[:api_version_used_for_query_state] = suggested_api_version.nil? ? api_version_info[:api_version_status] : "latest" else raise StandardError, "Expected a Hash object for querying #{opts}, but received #{long_description.class}." end @@ -295,17 +295,17 @@ def get_resource(opts = {}) # @see https://docs.microsoft.com/en-us/rest/api/resources/providers/get # # TODO: Fix the disabled rubocop issues. - def get_api_version(provider, resource_type, api_version_status = 'latest') # rubocop:disable Metrics/AbcSize, Metrics/PerceivedComplexity + def get_api_version(provider, resource_type, api_version_status = "latest") # rubocop:disable Metrics/AbcSize, Metrics/PerceivedComplexity unless %w{latest default}.include?(api_version_status) raise ArgumentError, "The api version status should be either `latest` or `default`, given: #{api_version_status}." end response = { api_version: nil, api_version_status: nil } - resource_type_env = resource_type.gsub('/', '_') + resource_type_env = resource_type.gsub("/", "_") in_cache = ENV["#{provider}__#{resource_type_env}__#{api_version_status}"] unless in_cache.nil? - if in_cache == 'use_latest' + if in_cache == "use_latest" in_cache = ENV["#{provider}__#{resource_type}__latest"] - api_version_status = 'latest' + api_version_status = "latest" end response[:api_version] = in_cache response[:api_version_status] = api_version_status @@ -316,10 +316,10 @@ def get_api_version(provider, resource_type, api_version_status = 'latest') # ru if @azure.provider_details[provider.to_sym].nil? # If the resource manager api version is updated earlier, use that. api_version_mgm = @resource_manager_endpoint_api || @azure.resource_manager_endpoint_api_version - url = Helpers.construct_url([@azure.resource_manager_endpoint_url, 'subscriptions', - @azure.credentials[:subscription_id], 'providers', + url = Helpers.construct_url([@azure.resource_manager_endpoint_url, "subscriptions", + @azure.credentials[:subscription_id], "providers", provider]) - provider_details, suggested_api_version = rescue_wrong_api_call(url: url, params: { 'api-version' => api_version_mgm }) + provider_details, suggested_api_version = rescue_wrong_api_call(url: url, params: { "api-version" => api_version_mgm }) # If suggested_api_version is not nil, then the resource manager api version should be updated. unless suggested_api_version.nil? @resource_manager_endpoint_api = suggested_api_version @@ -331,28 +331,28 @@ def get_api_version(provider, resource_type, api_version_status = 'latest') # ru resource_type_details = provider_details[:resourceTypes].select { |rt| rt[:resourceType].upcase == resource_type.upcase }&.first # For some resource types the api version might be available with their parent resource. - if resource_type_details.nil? && resource_type.include?('/') - parent_resource_type = resource_type.split('/').first + if resource_type_details.nil? && resource_type.include?("/") + parent_resource_type = resource_type.split("/").first resource_type_details = provider_details[:resourceTypes].select { |rt| rt[:resourceType].upcase == parent_resource_type&.upcase }&.first end if resource_type_details.nil? || !resource_type_details.is_a?(Hash) Inspec::Log.warn "#{@__resource_name__}: Couldn't get the #{api_version_status} API version for `#{provider}/#{resource_type}`. " \ - 'Please make sure that the provider/resourceType are in the correct format, e.g. `Microsoft.Compute/virtualMachines`.' + "Please make sure that the provider/resourceType are in the correct format, e.g. `Microsoft.Compute/virtualMachines`." else # Caching provider details. @azure.provider_details[provider.to_sym] = provider_details if @azure.provider_details[provider.to_sym].nil? api_versions = resource_type_details[:apiVersions] - api_versions_stable = api_versions.reject { |a| a.include?('preview') } - api_versions_preview = api_versions.select { |a| a.include?('preview') } + api_versions_stable = api_versions.reject { |a| a.include?("preview") } + api_versions_preview = api_versions.select { |a| a.include?("preview") } # If the latest stable version is older than 2 years then use preview versions. latest_api_version = Helpers.normalize_api_list(2, api_versions_stable, api_versions_preview).first ENV["#{provider}__#{resource_type_env}__latest"] = latest_api_version ENV["#{provider}__#{resource_type_env}__default"] = \ - resource_type_details[:defaultApiVersion].nil? ? 'use_latest' : resource_type_details[:defaultApiVersion] - if api_version_status == 'default' + resource_type_details[:defaultApiVersion].nil? ? "use_latest" : resource_type_details[:defaultApiVersion] + if api_version_status == "default" if resource_type_details[:defaultApiVersion].nil? # This will be used to inform caller function about the actual status of the returned api version. - api_version_status = 'latest' + api_version_status = "latest" returned_api_version = latest_api_version else returned_api_version = resource_type_details[:defaultApiVersion] @@ -393,11 +393,11 @@ def validate_short_desc(resource_list, filter, singular = true) # rubocop:disabl def validate_resource_uri(opts = @opts) return true if opts[:is_uri_a_url] - opts[:resource_uri].prepend('/') unless opts[:resource_uri].start_with?('/') + opts[:resource_uri].prepend("/") unless opts[:resource_uri].start_with?("/") Validators.validate_params_required(%i(add_subscription_id), opts) if opts[:add_subscription_id] == true opts[:resource_uri] = "/subscriptions/#{@azure.credentials[:subscription_id]}/#{opts[:resource_uri]}" - .gsub('//', '/') + .gsub("//", "/") end opts[:resource_uri] end @@ -471,7 +471,7 @@ def catch_failed_resource_queries message = "Unable to get information from the REST API for #{@__resource_name__}: #{@display_name}.\n#{e.message}" resource_fail(message) rescue StandardError => e - message = "Resource is failed due to #{e}. Error backtrace:#{e.backtrace.join(' ')}" + message = "Resource is failed due to #{e}. Error backtrace:#{e.backtrace.join(" ")}" resource_fail(message) end @@ -501,9 +501,9 @@ def validate_parameters(allow: [], required: nil, require_any_of: nil) # @return [String] The reason of the failure. def resource_fail(message = nil) message ||= "#{@__resource_name__}: #{@display_name}. "\ - 'Multiple Azure resources were returned for the provided criteria. '\ - 'If you wish to test multiple entities, please use the plural resource. '\ - 'Otherwise, please provide more specific criteria to lookup the resource.' + "Multiple Azure resources were returned for the provided criteria. "\ + "If you wish to test multiple entities, please use the plural resource. "\ + "Otherwise, please provide more specific criteria to lookup the resource." # Fail resource in resource pack. `exists?` method will return `false`. @failed_resource = true # Fail resource in InSpec core. Tests in InSpec profile will return the message. @@ -601,23 +601,23 @@ def create_method(object, name, value) # Create the necessary method based on the var that has been passed # Test the value for its type so that the method can be setup correctly case value.class.to_s - when 'String', 'Integer', 'TrueClass', 'FalseClass', 'Fixnum', 'Time', 'Bignum', 'Float' + when "String", "Integer", "TrueClass", "FalseClass", "Fixnum", "Time", "Bignum", "Float" object.define_singleton_method name do value end - when 'Hash' + when "Hash" value.count.zero? ? return_value = value : return_value = AzureResourceProbe.new(value) object.define_singleton_method name do return_value end - when 'Array' + when "Array" # Some things are just string or integer arrays # Check this by seeing if the first element is a string / integer / boolean or # a hashtable # This may not be the best method, but short of testing all elements in the array, this is # the quickest test case value[0].class.to_s - when 'String', 'Integer', 'TrueClass', 'FalseClass', 'Fixnum' + when "String", "Integer", "TrueClass", "FalseClass", "Fixnum" probes = value else probes = [] @@ -682,10 +682,10 @@ def initialize(item) # @param [String, Hash] opt Name (or Name=>Value) of the item to look for in the @item property def include?(opt) unless opt.is_a?(Symbol) || opt.is_a?(Hash) || opt.is_a?(String) - raise ArgumentError, 'Key or Key:Value pair should be provided.' + raise ArgumentError, "Key or Key:Value pair should be provided." end if opt.is_a?(Hash) - raise ArgumentError, 'Only one item can be provided' if opt.keys.size > 1 + raise ArgumentError, "Only one item can be provided" if opt.keys.size > 1 return @item[opt.keys.first&.to_sym] == opt.values.first end @item.key?(opt.to_sym) diff --git a/libraries/azure_bastion_hosts_resource.rb b/libraries/azure_bastion_hosts_resource.rb index 5a3d8031e..f4a93804f 100644 --- a/libraries/azure_bastion_hosts_resource.rb +++ b/libraries/azure_bastion_hosts_resource.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureBastionHostsResource < AzureGenericResource - name 'azure_bastion_hosts_resource' - desc 'Azure Bastion to connect to a data lake hosts' + name "azure_bastion_hosts_resource" + desc "Azure Bastion to connect to a data lake hosts" example <<-EXAMPLE describe azure_bastion_hosts_resource(resource_group: 'example', name: 'host-name') do it { should exist } @@ -11,7 +11,7 @@ class AzureBastionHostsResource < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Azure REST API endpoint URL format for the resource: # GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ # providers/Microsoft.Network/bastionHosts/{bastionHostName}?api-version=2020-11-01 @@ -39,7 +39,7 @@ def initialize(opts = {}) # The `specific_resource_constraint` method will validate the user input # not to accept a different `resource_provider`. # - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/bastionHosts', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/bastionHosts", opts) opts[:required_parameters] = %i(name) # static_resource parameter must be true for setting the resource_provider in the backend. diff --git a/libraries/azure_bastion_hosts_resources.rb b/libraries/azure_bastion_hosts_resources.rb index 63185adaa..adf783850 100644 --- a/libraries/azure_bastion_hosts_resources.rb +++ b/libraries/azure_bastion_hosts_resources.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureBastionHostsResources < AzureGenericResources - name 'azure_bastion_hosts_resources' - desc 'Lists all Bastion Hosts in a subscription' + name "azure_bastion_hosts_resources" + desc "Lists all Bastion Hosts in a subscription" example <<-EXAMPLE azure_bastion_hosts_resources(resource_group: 'example') do it{ should exist } @@ -13,7 +13,7 @@ class AzureBastionHostsResources < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Azure REST API endpoint URL format listing the all resources for a given subscription: # GET https://management.azure.com/subscriptions/{subscriptionId}/providers @@ -40,7 +40,7 @@ def initialize(opts = {}) # The `specific_resource_constraint` method will validate the user input # not to accept a different `resource_provider`. # - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/bastionHosts', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/bastionHosts", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) diff --git a/libraries/azure_blob_service.rb b/libraries/azure_blob_service.rb index 6f2e762e4..cdc704744 100644 --- a/libraries/azure_blob_service.rb +++ b/libraries/azure_blob_service.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureBlobService < AzureGenericResource - name 'azure_blob_service' - desc 'Verifies settings for an Azure API Blob Service.' + name "azure_blob_service" + desc "Verifies settings for an Azure API Blob Service." example <<-EXAMPLE describe azure_blob_service(resource_group: 'resource-group-name', storage_account_name: 'storage-account-name') do it { should exist } @@ -10,12 +10,12 @@ class AzureBlobService < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Storage/storageAccounts', opts) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Storage/storageAccounts", opts) opts[:required_parameters] = %i(storage_account_name) - opts[:name] = 'default' - opts[:resource_path] = [opts[:storage_account_name], 'blobServices'].join('/') - opts[:method] = 'get' + opts[:name] = "default" + opts[:resource_path] = [opts[:storage_account_name], "blobServices"].join("/") + opts[:method] = "get" super(opts, true) end diff --git a/libraries/azure_blob_services.rb b/libraries/azure_blob_services.rb index 6c0dd9229..fa3919985 100644 --- a/libraries/azure_blob_services.rb +++ b/libraries/azure_blob_services.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureBlobServices< AzureGenericResources - name 'azure_blob_services' - desc 'Verifies settings for an Azure API Blob Services resource' + name "azure_blob_services" + desc "Verifies settings for an Azure API Blob Services resource" example <<-EXAMPLE describe azure_blob_services(resource_group: 'resource-group-name', storage_account_name: "storage-account-name") do it { should exist } @@ -10,11 +10,11 @@ class AzureBlobServices< AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Storage/storageAccounts', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Storage/storageAccounts", opts) opts[:required_parameters] = %i(storage_account_name) - opts[:resource_path] = [opts[:storage_account_name], 'blobServices'].join('/') + opts[:resource_path] = [opts[:storage_account_name], "blobServices"].join("/") super(opts, true) diff --git a/libraries/azure_cdn_profile.rb b/libraries/azure_cdn_profile.rb index 89f91dc52..8a3412a25 100644 --- a/libraries/azure_cdn_profile.rb +++ b/libraries/azure_cdn_profile.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureCDNProfile < AzureGenericResource - name 'azure_cdn_profile' - desc 'Verifies settings for a specific Azure CDN Profile.' + name "azure_cdn_profile" + desc "Verifies settings for a specific Azure CDN Profile." example <<-EXAMPLE describe azure_cdn_profile(resource_group: 'large_vms', name: 'demo1') do it { should exist } @@ -10,9 +10,9 @@ class AzureCDNProfile < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Cdn/profiles', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Cdn/profiles", opts) super(opts, true) end diff --git a/libraries/azure_cdn_profiles.rb b/libraries/azure_cdn_profiles.rb index 7a9f595fb..296b74e01 100644 --- a/libraries/azure_cdn_profiles.rb +++ b/libraries/azure_cdn_profiles.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureCDNProfiles < AzureGenericResources - name 'azure_cdn_profiles' - desc 'Verifies settings for a collection of Azure CDN Profiles.' + name "azure_cdn_profiles" + desc "Verifies settings for a collection of Azure CDN Profiles." example <<-EXAMPLE describe azure_cdn_profiles do it { should exist } @@ -10,9 +10,9 @@ class AzureCDNProfiles < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Cdn/profiles', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Cdn/profiles", opts) super(opts, true) return if failed_resource? diff --git a/libraries/azure_container_group.rb b/libraries/azure_container_group.rb index f920dc975..81a669013 100644 --- a/libraries/azure_container_group.rb +++ b/libraries/azure_container_group.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureContainerGroup < AzureGenericResource - name 'azure_container_group' - desc 'Retrieves and verifies the settings of a container group instance.' + name "azure_container_group" + desc "Retrieves and verifies the settings of a container group instance." example <<-EXAMPLE describe azure_container_group(resource_group: 'large_vms', name: 'demo1') do it { should exist } @@ -10,9 +10,9 @@ class AzureContainerGroup < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ContainerInstance/containerGroups', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.ContainerInstance/containerGroups", opts) super(opts, true) end diff --git a/libraries/azure_container_groups.rb b/libraries/azure_container_groups.rb index 3cdbfc0b0..23b522e86 100644 --- a/libraries/azure_container_groups.rb +++ b/libraries/azure_container_groups.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureContainerGroups < AzureGenericResources - name 'azure_container_groups' - desc 'Verifies settings for a list of azure container groups in a subscription' + name "azure_container_groups" + desc "Verifies settings for a list of azure container groups in a subscription" example <<-EXAMPLE describe azure_container_groups do it { should exist } @@ -12,9 +12,9 @@ class AzureContainerGroups < AzureGenericResources attr_reader :table def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ContainerInstance/containerGroups', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.ContainerInstance/containerGroups", opts) super(opts, true) return if failed_resource? diff --git a/libraries/azure_container_registries.rb b/libraries/azure_container_registries.rb index 342d76d52..a31b48a95 100644 --- a/libraries/azure_container_registries.rb +++ b/libraries/azure_container_registries.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureContainerRegistries < AzureGenericResources - name 'azure_container_registries' - desc 'Verifies settings for a collection of Azure Container Registries' + name "azure_container_registries" + desc "Verifies settings for a collection of Azure Container Registries" example <<-EXAMPLE describe azure_container_registries do it { should exist } @@ -13,9 +13,9 @@ class AzureContainerRegistries < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ContainerRegistry/registries', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.ContainerRegistry/registries", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -48,8 +48,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermContainerRegistries < AzureContainerRegistries - name 'azurerm_container_registries' - desc 'Verifies settings for a collection of Azure Container Registries' + name "azurerm_container_registries" + desc "Verifies settings for a collection of Azure Container Registries" example <<-EXAMPLE describe azurerm_container_registries do it { should exist } @@ -59,10 +59,10 @@ class AzurermContainerRegistries < AzureContainerRegistries def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureContainerRegistries.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2019-05-01' + opts[:api_version] ||= "2019-05-01" super end end diff --git a/libraries/azure_container_registry.rb b/libraries/azure_container_registry.rb index 0de447e48..a54f6e51b 100644 --- a/libraries/azure_container_registry.rb +++ b/libraries/azure_container_registry.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureContainerRegistry < AzureGenericResource - name 'azure_container_registry' - desc 'Verifies settings for an Azure Container Registry' + name "azure_container_registry" + desc "Verifies settings for an Azure Container Registry" example <<-EXAMPLE describe azure_container_registry(resource_group: 'rg-1', name: 'cr-1') do it { should exist } @@ -11,9 +11,9 @@ class AzureContainerRegistry < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ContainerRegistry/registries', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.ContainerRegistry/registries", opts) opts[:resource_identifiers] = %i(registry_name) # static_resource parameter must be true for setting the resource_provider in the backend. @@ -28,8 +28,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermContainerRegistry < AzureContainerRegistry - name 'azurerm_container_registry' - desc 'Verifies settings for an Azure Container Registry' + name "azurerm_container_registry" + desc "Verifies settings for an Azure Container Registry" example <<-EXAMPLE describe azurerm_container_registry(resource_group: 'rg-1', registry_name: 'lb-1') do it { should exist } @@ -39,10 +39,10 @@ class AzurermContainerRegistry < AzureContainerRegistry def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureContainerRegistry.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2019-05-01' + opts[:api_version] ||= "2019-05-01" super end end diff --git a/libraries/azure_cosmosdb_database_account.rb b/libraries/azure_cosmosdb_database_account.rb index 20124e711..7526bef7c 100644 --- a/libraries/azure_cosmosdb_database_account.rb +++ b/libraries/azure_cosmosdb_database_account.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureCosmosDbDatabaseAccount < AzureGenericResource - name 'azure_cosmosdb_database_account' - desc 'Verifies settings for CosmosDb Database Account' + name "azure_cosmosdb_database_account" + desc "Verifies settings for CosmosDb Database Account" example <<-EXAMPLE describe azure_cosmosdb_database_account(resource_group: 'example', name: 'my-cosmos-db-account') do its('name') { should eq 'my-cosmos-db-account'} @@ -11,9 +11,9 @@ class AzureCosmosDbDatabaseAccount < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.DocumentDB/databaseAccounts', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.DocumentDB/databaseAccounts", opts) opts[:resource_identifiers] = %i(cosmosdb_database_account) # static_resource parameter must be true for setting the resource_provider in the backend. @@ -28,8 +28,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermCosmosDbDatabaseAccount < AzureCosmosDbDatabaseAccount - name 'azurerm_cosmosdb_database_account' - desc 'Verifies settings for CosmosDb Database Account' + name "azurerm_cosmosdb_database_account" + desc "Verifies settings for CosmosDb Database Account" example <<-EXAMPLE describe azurerm_cosmosdb_database_account(resource_group: 'example', cosmosdb_database_account: 'my-cosmos-db-account') do its('name') { should eq 'my-cosmos-db-account'} @@ -39,10 +39,10 @@ class AzurermCosmosDbDatabaseAccount < AzureCosmosDbDatabaseAccount def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureCosmosDbDatabaseAccount.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2015-04-08' + opts[:api_version] ||= "2015-04-08" super end end diff --git a/libraries/azure_data_factories.rb b/libraries/azure_data_factories.rb index 65399497e..8097b10f1 100644 --- a/libraries/azure_data_factories.rb +++ b/libraries/azure_data_factories.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureDataFactories < AzureGenericResources - name 'azure_data_factories' - desc 'List azure data factories' + name "azure_data_factories" + desc "List azure data factories" example <<-EXAMPLE describe azure_data_factories(resource_group: 'example') do it { should exist } @@ -11,7 +11,7 @@ class AzureDataFactories < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Azure REST API endpoint URL format for the resource: # GET https://management.azure.com/subscriptions/{SubscriptionID}/ @@ -40,7 +40,7 @@ def initialize(opts = {}) # The `specific_resource_constraint` method will validate the user input # not to accept a different `resource_provider`. # - opts[:resource_provider] = specific_resource_constraint('Microsoft.DataFactory/factories', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.DataFactory/factories", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) # Check if the resource is failed. diff --git a/libraries/azure_data_factory.rb b/libraries/azure_data_factory.rb index 0f114fbe4..3db8a06ab 100644 --- a/libraries/azure_data_factory.rb +++ b/libraries/azure_data_factory.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureDataFactory < AzureGenericResource - name 'azure_data_factory' - desc 'Creates azure data factory' + name "azure_data_factory" + desc "Creates azure data factory" example <<-EXAMPLE describe azure_data_factory(resource_group: 'example', name: 'factoryName') do it { should have_monitoring_agent_installed } @@ -11,7 +11,7 @@ class AzureDataFactory < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Azure REST API endpoint URL format for the resource: # GET https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/ # providers/Microsoft.DataFactory/factories/${factoryName}?api-version=${apiVersion} @@ -39,7 +39,7 @@ def initialize(opts = {}) # The `specific_resource_constraint` method will validate the user input # not to accept a different `resource_provider`. # - opts[:resource_provider] = specific_resource_constraint('Microsoft.DataFactory/factories', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.DataFactory/factories", opts) opts[:required_parameters] = %i(name) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) diff --git a/libraries/azure_data_factory_dataset.rb b/libraries/azure_data_factory_dataset.rb index ac0a3a4ed..059fcb085 100644 --- a/libraries/azure_data_factory_dataset.rb +++ b/libraries/azure_data_factory_dataset.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureDataFactoryDataSet < AzureGenericResource - name 'azure_data_factory_dataset' - desc 'Verifies settings for an Azure DataSet' + name "azure_data_factory_dataset" + desc "Verifies settings for an Azure DataSet" example <<-EXAMPLE describe azure_data_factory_dataset(resource_group: 'example',factory_name: 'factory_name', dataset_name: 'ds-name') do it { should exists } @@ -11,11 +11,11 @@ class AzureDataFactoryDataSet < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.DataFactory/factories', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.DataFactory/factories", opts) opts[:required_parameters] = %i(factory_name) - opts[:resource_path] = [opts[:factory_name], 'datasets'].join('/') + opts[:resource_path] = [opts[:factory_name], "datasets"].join("/") opts[:resource_identifiers] = %i(dataset_name) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) diff --git a/libraries/azure_data_factory_datasets.rb b/libraries/azure_data_factory_datasets.rb index b7dbc5228..416f4821d 100644 --- a/libraries/azure_data_factory_datasets.rb +++ b/libraries/azure_data_factory_datasets.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureDataFactoryDataSets < AzureGenericResources - name 'azure_data_factory_datasets' - desc 'Lists DataFactoryDataSets' + name "azure_data_factory_datasets" + desc "Lists DataFactoryDataSets" example <<-EXAMPLE azure_data_factory_datasets(resource_group: 'example', factory_name: 'factory_name') do it{ should exist } @@ -13,11 +13,11 @@ class AzureDataFactoryDataSets < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.DataFactory/factories', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.DataFactory/factories", opts) opts[:required_parameters] = %i(factory_name) - opts[:resource_path] = [opts[:factory_name], 'datasets'].join('/') + opts[:resource_path] = [opts[:factory_name], "datasets"].join("/") # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) diff --git a/libraries/azure_data_factory_linked_service.rb b/libraries/azure_data_factory_linked_service.rb index 848226ca2..f40f0ce68 100644 --- a/libraries/azure_data_factory_linked_service.rb +++ b/libraries/azure_data_factory_linked_service.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureDataFactoryLinkedService < AzureGenericResource - name 'azure_data_factory_linked_service' - desc 'Checking azure data factory linked service' + name "azure_data_factory_linked_service" + desc "Checking azure data factory linked service" example <<-EXAMPLE describe azure_data_factory_linked_service(resource_group: resource_group, factory_name: factory_name, linked_service_name: linked_service_name) do it { should exist } @@ -11,15 +11,15 @@ class AzureDataFactoryLinkedService < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # # Azure REST API endpoint URL format for the resource: # GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ # providers/Microsoft.DataFactory/factories/{factoryName}/linkedservices/{linkedServiceName}?api-version=2018-06-01 # - opts[:resource_provider] = specific_resource_constraint('Microsoft.DataFactory/factories', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.DataFactory/factories", opts) opts[:required_parameters] = %i(factory_name) - opts[:resource_path] = [opts[:factory_name], 'linkedservices'].join('/') + opts[:resource_path] = [opts[:factory_name], "linkedservices"].join("/") opts[:resource_identifiers] = %i(linked_service_name) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) diff --git a/libraries/azure_data_factory_linked_services.rb b/libraries/azure_data_factory_linked_services.rb index 5323ff53b..8236e6831 100644 --- a/libraries/azure_data_factory_linked_services.rb +++ b/libraries/azure_data_factory_linked_services.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureDataFactoryLinkedServices < AzureGenericResources - name 'azure_data_factory_linked_services' - desc 'List azure linked services' + name "azure_data_factory_linked_services" + desc "List azure linked services" example <<-EXAMPLE describe azure_data_factory_linked_services(resource_group: 'example', factory_name: 'fn') do it { should exist } @@ -11,14 +11,14 @@ class AzureDataFactoryLinkedServices < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Azure REST API endpoint URL format for the resource: # GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ # providers/Microsoft.DataFactory/factories/{factoryName}/linkedservices?api-version=2018-06-01 # - opts[:resource_provider] = specific_resource_constraint('Microsoft.DataFactory/factories', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.DataFactory/factories", opts) opts[:required_parameters] = %i(factory_name) - opts[:resource_path] = [opts[:factory_name], 'linkedservices'].join('/') + opts[:resource_path] = [opts[:factory_name], "linkedservices"].join("/") # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) # Check if the resource is failed. diff --git a/libraries/azure_data_factory_pipeline.rb b/libraries/azure_data_factory_pipeline.rb index 6f7fc598d..7e009c6fc 100644 --- a/libraries/azure_data_factory_pipeline.rb +++ b/libraries/azure_data_factory_pipeline.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureDataFactoryPipeline < AzureGenericResource - name 'azure_data_factory_pipeline' - desc 'Verifies settings for Azure data factory pipeline ' + name "azure_data_factory_pipeline" + desc "Verifies settings for Azure data factory pipeline " example <<-EXAMPLE describe azure_data_factory_pipeline(resource_group: resource_group, factory_name: factory_name, pipeline_name: pipeline_name) do it { should exist } @@ -11,15 +11,15 @@ class AzureDataFactoryPipeline < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # # Azure REST API endpoint URL format for the resource: # GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ # providers/Microsoft.DataFactory/factories/{factoryName}/pipelines/{pipelineName}?api-version=2018-06-01 # - opts[:resource_provider] = specific_resource_constraint('Microsoft.DataFactory/factories', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.DataFactory/factories", opts) opts[:required_parameters] = %i(factory_name) - opts[:resource_path] = [opts[:factory_name], 'pipelines'].join('/') + opts[:resource_path] = [opts[:factory_name], "pipelines"].join("/") opts[:resource_identifiers] = %i(pipeline_name) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) diff --git a/libraries/azure_data_factory_pipeline_run_resource.rb b/libraries/azure_data_factory_pipeline_run_resource.rb index 8c691070a..9fb06445c 100644 --- a/libraries/azure_data_factory_pipeline_run_resource.rb +++ b/libraries/azure_data_factory_pipeline_run_resource.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureDataFactoryPipelineRunResource < AzureGenericResource - name 'azure_data_factory_pipeline_run_resource' - desc 'Verifies settings for an Azure DataSet' + name "azure_data_factory_pipeline_run_resource" + desc "Verifies settings for an Azure DataSet" example <<-EXAMPLE describe azure_data_factory_pipeline_run_resource(resource_group: 'example',factory_name: 'factory_name', run_id: 'run_id') do it { should exists } @@ -11,11 +11,11 @@ class AzureDataFactoryPipelineRunResource < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.DataFactory/factories', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.DataFactory/factories", opts) opts[:required_parameters] = %i(factory_name) - opts[:resource_path] = [opts[:factory_name], 'pipelineruns'].join('/') + opts[:resource_path] = [opts[:factory_name], "pipelineruns"].join("/") opts[:resource_identifiers] = %i(run_id) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) diff --git a/libraries/azure_data_factory_pipeline_run_resources.rb b/libraries/azure_data_factory_pipeline_run_resources.rb index 9af232611..489d5a6b9 100644 --- a/libraries/azure_data_factory_pipeline_run_resources.rb +++ b/libraries/azure_data_factory_pipeline_run_resources.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureDataFactoryPipelineRunResources < AzureGenericResources - name 'azure_data_factory_pipeline_run_resources' - desc 'Lists DataFactoryDataSets' + name "azure_data_factory_pipeline_run_resources" + desc "Lists DataFactoryDataSets" example <<-EXAMPLE azure_data_factory_pipeline_run_resources(resource_group: 'example', factory_name: 'factory_name') do it{ should exist } @@ -13,12 +13,12 @@ class AzureDataFactoryPipelineRunResources < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.DataFactory/factories', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.DataFactory/factories", opts) opts[:required_parameters] = %i(factory_name) - opts[:resource_path] = [opts[:factory_name], 'queryPipelineRuns'].join('/') - opts[:method] = 'post' + opts[:resource_path] = [opts[:factory_name], "queryPipelineRuns"].join("/") + opts[:method] = "post" # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) diff --git a/libraries/azure_data_factory_pipelines.rb b/libraries/azure_data_factory_pipelines.rb index 7887d371b..cbb9587ef 100644 --- a/libraries/azure_data_factory_pipelines.rb +++ b/libraries/azure_data_factory_pipelines.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureDataFactoryPipelines < AzureGenericResources - name 'azure_data_factory_pipelines' - desc 'List azure pipelines by data factory.' + name "azure_data_factory_pipelines" + desc "List azure pipelines by data factory." example <<-EXAMPLE describe azure_data_factory_pipelines(resource_group: 'example', factory_name: 'fn') do it { should exist } @@ -11,13 +11,13 @@ class AzureDataFactoryPipelines < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Azure REST API endpoint URL format for the resource: # GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ # providers/Microsoft.DataFactory/factories/{factoryName}/pipelines?api-version=2018-06-01 - opts[:resource_provider] = specific_resource_constraint('Microsoft.DataFactory/factories', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.DataFactory/factories", opts) opts[:required_parameters] = %i(factory_name) - opts[:resource_path] = [opts[:factory_name], 'pipelines'].join('/') + opts[:resource_path] = [opts[:factory_name], "pipelines"].join("/") # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) # Check if the resource is failed. diff --git a/libraries/azure_data_lake_storage_gen2_filesystem.rb b/libraries/azure_data_lake_storage_gen2_filesystem.rb index be78ac89e..4c0644a1a 100644 --- a/libraries/azure_data_lake_storage_gen2_filesystem.rb +++ b/libraries/azure_data_lake_storage_gen2_filesystem.rb @@ -1,24 +1,24 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureDataLakeStorageGen2Filesystem < AzureGenericResource - name 'azure_data_lake_storage_gen2_filesystem' - desc 'Retrieves and verifies the settings of a Data Lake Storage Gen2 file system' + name "azure_data_lake_storage_gen2_filesystem" + desc "Retrieves and verifies the settings of a Data Lake Storage Gen2 file system" example <<-EXAMPLE describe azure_data_lake_storage_gen2_filesystem(account_name: 'adls', name: 'filename1') do it { should exist } end EXAMPLE - API_VERSION = '2019-12-12'.freeze - AUDIENCE = 'https://storage.azure.com/'.freeze - RESOURCE = 'filesystem'.freeze - HTTP_METHOD = 'head'.freeze - DEFAULT_DFS = 'dfs.core.windows.net'.freeze + API_VERSION = "2019-12-12".freeze + AUDIENCE = "https://storage.azure.com/".freeze + RESOURCE = "filesystem".freeze + HTTP_METHOD = "head".freeze + DEFAULT_DFS = "dfs.core.windows.net".freeze attr_reader :table def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Validators.validate_parameters(resource_name: @__resource_name__, required: %i(account_name name), allow: %i(prefix dns_suffix), @@ -31,7 +31,7 @@ def initialize(opts = {}) recursive: false, } opts[:headers] = { - 'X-ms-date': Time.now.strftime('%Y-%m-%d'), + 'X-ms-date': Time.now.strftime("%Y-%m-%d"), 'X-ms-version': opts[:api_version] = API_VERSION, } opts[:method] = HTTP_METHOD diff --git a/libraries/azure_data_lake_storage_gen2_filesystems.rb b/libraries/azure_data_lake_storage_gen2_filesystems.rb index 8ab384d32..a7153e93e 100644 --- a/libraries/azure_data_lake_storage_gen2_filesystems.rb +++ b/libraries/azure_data_lake_storage_gen2_filesystems.rb @@ -1,23 +1,23 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureDataLakeStorageGen2Filesystems < AzureGenericResources - name 'azure_data_lake_storage_gen2_filesystems' - desc 'Verifies settings for a list of Data Lake Storage Gen2 file systems' + name "azure_data_lake_storage_gen2_filesystems" + desc "Verifies settings for a list of Data Lake Storage Gen2 file systems" example <<-EXAMPLE describe azure_data_lake_storage_gen2_filesystems(account_name: 'adls') do it { should exist } end EXAMPLE - API_VERSION = '2019-12-12'.freeze - AUDIENCE = 'https://storage.azure.com/'.freeze - RESOURCE = 'account'.freeze - DEFAULT_DFS = 'dfs.core.windows.net'.freeze + API_VERSION = "2019-12-12".freeze + AUDIENCE = "https://storage.azure.com/".freeze + RESOURCE = "account".freeze + DEFAULT_DFS = "dfs.core.windows.net".freeze attr_reader :table def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Validators.validate_parameters(resource_name: @__resource_name__, required: %i(account_name), allow: %i(prefix dns_suffix), @@ -30,7 +30,7 @@ def initialize(opts = {}) prefix: opts.delete(:prefix), } opts[:headers] = { - 'X-ms-date': Time.now.strftime('%Y-%m-%d'), + 'X-ms-date': Time.now.strftime("%Y-%m-%d"), 'X-ms-version': opts[:api_version] = API_VERSION, } opts[:audience] = AUDIENCE diff --git a/libraries/azure_data_lake_storage_gen2_path.rb b/libraries/azure_data_lake_storage_gen2_path.rb index eec846105..4ae3796dc 100644 --- a/libraries/azure_data_lake_storage_gen2_path.rb +++ b/libraries/azure_data_lake_storage_gen2_path.rb @@ -1,31 +1,31 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureDataLakeStorageGen2Path < AzureGenericResource - name 'azure_data_lake_storage_gen2_path' - desc 'Retrieves and verifies the settings of a Data Lake Storage Gen2 file system' + name "azure_data_lake_storage_gen2_path" + desc "Retrieves and verifies the settings of a Data Lake Storage Gen2 file system" example <<-EXAMPLE describe azure_data_lake_storage_gen2_filesystem(account_name: 'adls', filesystem: 'filename1', name: 'pathname') do it { should exist } end EXAMPLE - API_VERSION = '2019-12-12'.freeze - AUDIENCE = 'https://storage.azure.com/'.freeze - RESOURCE = 'filesystem'.freeze - HTTP_METHOD = 'head'.freeze - DEFAULT_DFS = 'dfs.core.windows.net'.freeze + API_VERSION = "2019-12-12".freeze + AUDIENCE = "https://storage.azure.com/".freeze + RESOURCE = "filesystem".freeze + HTTP_METHOD = "head".freeze + DEFAULT_DFS = "dfs.core.windows.net".freeze attr_reader :table def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Validators.validate_parameters(resource_name: @__resource_name__, required: %i(account_name filesystem name), allow: %i(dns_suffix action fsAction), opts: opts) account_name = opts.delete(:account_name) filesystem = opts.delete(:filesystem) - path = [filesystem, opts[:name]].join('/') + path = [filesystem, opts[:name]].join("/") dns_suffix = opts.delete(:dns_suffix) || DEFAULT_DFS opts[:resource_uri] = "https://#{account_name}.#{dns_suffix}/#{path}" opts[:query_parameters] = { @@ -33,7 +33,7 @@ def initialize(opts = {}) fsAction: opts.delete(:fsAction), } opts[:headers] = { - 'X-ms-date': Time.now.strftime('%Y-%m-%d'), + 'X-ms-date': Time.now.strftime("%Y-%m-%d"), 'X-ms-version': opts[:api_version] = API_VERSION, } opts[:method] = HTTP_METHOD diff --git a/libraries/azure_data_lake_storage_gen2_paths.rb b/libraries/azure_data_lake_storage_gen2_paths.rb index 22e883ce7..217ea54f4 100644 --- a/libraries/azure_data_lake_storage_gen2_paths.rb +++ b/libraries/azure_data_lake_storage_gen2_paths.rb @@ -1,23 +1,23 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureDataLakeStorageGen2Paths < AzureGenericResources - name 'azure_data_lake_storage_gen2_paths' - desc 'Verifies settings for a list of Data Lake Storage Gen2 Paths' + name "azure_data_lake_storage_gen2_paths" + desc "Verifies settings for a list of Data Lake Storage Gen2 Paths" example <<-EXAMPLE describe azure_data_lake_storage_gen2_paths(account_name: 'adls', filesystem: 'adls-filesystem') do it { should exist } end EXAMPLE - API_VERSION = '2019-12-12'.freeze - AUDIENCE = 'https://storage.azure.com/'.freeze - RESOURCE = 'filesystem'.freeze - DEFAULT_DFS = 'dfs.core.windows.net'.freeze + API_VERSION = "2019-12-12".freeze + AUDIENCE = "https://storage.azure.com/".freeze + RESOURCE = "filesystem".freeze + DEFAULT_DFS = "dfs.core.windows.net".freeze attr_reader :table def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Validators.validate_parameters(resource_name: @__resource_name__, required: %i(account_name filesystem), allow: %i(dns_suffix recursive directory), @@ -32,7 +32,7 @@ def initialize(opts = {}) directory: opts.delete(:directory), } opts[:headers] = { - 'X-ms-date': Time.now.strftime('%Y-%m-%d'), + 'X-ms-date': Time.now.strftime("%Y-%m-%d"), 'X-ms-version': opts[:api_version] = API_VERSION, } opts[:audience] = AUDIENCE diff --git a/libraries/azure_db_migration_service.rb b/libraries/azure_db_migration_service.rb index f926b5088..9efafac7b 100644 --- a/libraries/azure_db_migration_service.rb +++ b/libraries/azure_db_migration_service.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureDBMigrationService < AzureGenericResource - name 'azure_db_migration_service' - desc 'Verifies settings for a DB migration service resource in a resource group' + name "azure_db_migration_service" + desc "Verifies settings for a DB migration service resource in a resource group" example <<-EXAMPLE describe azure_db_migration_service(resource_group: 'rg-1', service_name: 'DmsSdkService') do it { should exist } @@ -10,9 +10,9 @@ class AzureDBMigrationService < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.DataMigration/services', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.DataMigration/services", opts) opts[:resource_identifiers] = %i(service_name) super(opts, true) end diff --git a/libraries/azure_db_migration_services.rb b/libraries/azure_db_migration_services.rb index 94c497c7a..d7e406bdc 100644 --- a/libraries/azure_db_migration_services.rb +++ b/libraries/azure_db_migration_services.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureDBMigrationServices < AzureGenericResources - name 'azure_db_migration_services' - desc 'Verifies settings for a list of DB migration service resources in a resource group' + name "azure_db_migration_services" + desc "Verifies settings for a list of DB migration service resources in a resource group" example <<-EXAMPLE describe azure_db_migration_services(resource_group: 'rg-1') do it { should exist } @@ -12,9 +12,9 @@ class AzureDBMigrationServices < AzureGenericResources attr_reader :table def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.DataMigration/services', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.DataMigration/services", opts) super return if failed_resource? diff --git a/libraries/azure_ddos_protection_resource.rb b/libraries/azure_ddos_protection_resource.rb index 7e9b044f1..a19b28a20 100644 --- a/libraries/azure_ddos_protection_resource.rb +++ b/libraries/azure_ddos_protection_resource.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureDdosProtectionResource < AzureGenericResource - name 'azure_ddos_protection_resource' - desc 'Verifies settings for Azure DDoS Protection Standard ' + name "azure_ddos_protection_resource" + desc "Verifies settings for Azure DDoS Protection Standard " example <<-EXAMPLE describe azure_ddos_protection_resource(resource_group: 'example', name: 'vm-name') do it { should exit } @@ -11,7 +11,7 @@ class AzureDdosProtectionResource < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Azure REST API endpoint URL format for the resource: # GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ @@ -40,7 +40,7 @@ def initialize(opts = {}) # The `specific_resource_constraint` method will validate the user input # not to accept a different `resource_provider`. # - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/ddosProtectionPlans', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/ddosProtectionPlans", opts) opts[:required_parameters] = %i(name) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) diff --git a/libraries/azure_ddos_protection_resources.rb b/libraries/azure_ddos_protection_resources.rb index 6888d54a0..3b968883e 100644 --- a/libraries/azure_ddos_protection_resources.rb +++ b/libraries/azure_ddos_protection_resources.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureDdosProtectionResources < AzureGenericResources - name 'azure_ddos_protection_resources' - desc 'Verifies settings for Azure DDoS Protection Standard ' + name "azure_ddos_protection_resources" + desc "Verifies settings for Azure DDoS Protection Standard " example <<-EXAMPLE azure_ddos_protection_resources(resource_group: 'rg') do it{ should exist } @@ -12,13 +12,13 @@ class AzureDdosProtectionResources < AzureGenericResources attr_reader :table def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Azure REST API endpoint URL format listing the all resources for a given subscription and resource group: # GET https://management.azure.com/subscriptions/{subscriptionId}/providers/ # Microsoft.Network/ddosProtectionPlans?api-version=2020-11-01 - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/ddosProtectionPlans', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/ddosProtectionPlans", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) diff --git a/libraries/azure_dns_zones_resource.rb b/libraries/azure_dns_zones_resource.rb index ddfe2856c..f6a5128cb 100644 --- a/libraries/azure_dns_zones_resource.rb +++ b/libraries/azure_dns_zones_resource.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureDNSZonesResource < AzureGenericResource - name 'azure_dns_zones_resource' - desc 'Verifies settings for an Azure DNS Zones' + name "azure_dns_zones_resource" + desc "Verifies settings for an Azure DNS Zones" example <<-EXAMPLE describe azure_dns_zones_resource(resource_group: 'example', name: 'dns-zones-name') do it { should exist } @@ -11,7 +11,7 @@ class AzureDNSZonesResource < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Azure REST API endpoint URL format for the resource: # GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName} @@ -40,7 +40,7 @@ def initialize(opts = {}) # The `specific_resource_constraint` method will validate the user input # not to accept a different `resource_provider`. # - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/dnsZones', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/dnsZones", opts) opts[:required_parameters] = %i(name) # static_resource parameter must be true for setting the resource_provider in the backend. diff --git a/libraries/azure_dns_zones_resources.rb b/libraries/azure_dns_zones_resources.rb index 74d1fd675..5757da5d7 100644 --- a/libraries/azure_dns_zones_resources.rb +++ b/libraries/azure_dns_zones_resources.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureDNSZonesResources < AzureGenericResources - name 'azure_dns_zones_resources' - desc 'Verifies settings for Azure DNS ZONES' + name "azure_dns_zones_resources" + desc "Verifies settings for Azure DNS ZONES" example <<-EXAMPLE describe azure_dns_zones_resources do it{ should exist } @@ -13,9 +13,9 @@ class AzureDNSZonesResources < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/dnszones', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/dnszones", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, false) diff --git a/libraries/azure_event_hub_authorization_rule.rb b/libraries/azure_event_hub_authorization_rule.rb index 43c2f3fb7..d126ef636 100644 --- a/libraries/azure_event_hub_authorization_rule.rb +++ b/libraries/azure_event_hub_authorization_rule.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureEventHubAuthorizationRule < AzureGenericResource - name 'azure_event_hub_authorization_rule' - desc 'Verifies settings for Event Hub Authorization Rule' + name "azure_event_hub_authorization_rule" + desc "Verifies settings for Event Hub Authorization Rule" example <<-EXAMPLE describe azure_event_hub_authorization_rule(resource_group: 'example', namespace_name: 'namespace-ns', event_hub_endpoint: 'eventhub', authorization_rule_name: 'auth-rule'") do its(name) { should eq 'name'} @@ -11,11 +11,11 @@ class AzureEventHubAuthorizationRule < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.EventHub/namespaces', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.EventHub/namespaces", opts) opts[:required_parameters] = %i(namespace_name event_hub_endpoint) - opts[:resource_path] = [opts[:namespace_name], 'eventhubs', opts[:event_hub_endpoint], 'authorizationRules'].join('/') + opts[:resource_path] = [opts[:namespace_name], "eventhubs", opts[:event_hub_endpoint], "authorizationRules"].join("/") opts[:resource_identifiers] = %i(authorization_rule) # static_resource parameter must be true for setting the resource_provider in the backend. @@ -30,8 +30,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermEventHubAuthorizationRule < AzureEventHubAuthorizationRule - name 'azurerm_event_hub_authorization_rule' - desc 'Verifies settings for Event Hub Authorization Rule' + name "azurerm_event_hub_authorization_rule" + desc "Verifies settings for Event Hub Authorization Rule" example <<-EXAMPLE describe azurerm_event_hub_authorization_rule(resource_group: 'example', namespace_name: 'namespace-ns', event_hub_endpoint: 'eventhub', authorization_rule_name: 'auth-rule'") do its(name) { should eq 'name'} @@ -41,10 +41,10 @@ class AzurermEventHubAuthorizationRule < AzureEventHubAuthorizationRule def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureEventHubAuthorizationRule.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2017-04-01' + opts[:api_version] ||= "2017-04-01" super end end diff --git a/libraries/azure_event_hub_event_hub.rb b/libraries/azure_event_hub_event_hub.rb index 242da4e16..ac9311246 100644 --- a/libraries/azure_event_hub_event_hub.rb +++ b/libraries/azure_event_hub_event_hub.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureEventHubEventHub < AzureGenericResource - name 'azure_event_hub_event_hub' - desc 'Verifies settings for Event Hub description' + name "azure_event_hub_event_hub" + desc "Verifies settings for Event Hub description" example <<-EXAMPLE describe azure_event_hub_event_hub(resource_group: 'example', namespace_name: 'namespace-ns', event_hub_name: 'eventHubName') do its(name) { should eq 'name'} @@ -11,11 +11,11 @@ class AzureEventHubEventHub < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.EventHub/namespaces', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.EventHub/namespaces", opts) opts[:required_parameters] = %i(namespace_name) - opts[:resource_path] = [opts[:namespace_name], 'eventhubs'].join('/') + opts[:resource_path] = [opts[:namespace_name], "eventhubs"].join("/") opts[:resource_identifiers] = %i(event_hub_name) # static_resource parameter must be true for setting the resource_provider in the backend. @@ -30,8 +30,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermEventHubEventHub < AzureEventHubEventHub - name 'azurerm_event_hub_event_hub' - desc 'Verifies settings for Event Hub description' + name "azurerm_event_hub_event_hub" + desc "Verifies settings for Event Hub description" example <<-EXAMPLE describe azurerm_event_hub_event_hub(resource_group: 'example', namespace_name: 'namespace-ns', event_hub_name: 'eventHubName') do its(name) { should eq 'name'} @@ -41,10 +41,10 @@ class AzurermEventHubEventHub < AzureEventHubEventHub def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureEventHubEventHub.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2017-04-01' + opts[:api_version] ||= "2017-04-01" super end end diff --git a/libraries/azure_event_hub_namespace.rb b/libraries/azure_event_hub_namespace.rb index 0e3579453..de503bedc 100644 --- a/libraries/azure_event_hub_namespace.rb +++ b/libraries/azure_event_hub_namespace.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureEventHubNamespace < AzureGenericResource - name 'azure_event_hub_namespace' - desc 'Verifies settings for Event Hub Namespace' + name "azure_event_hub_namespace" + desc "Verifies settings for Event Hub Namespace" example <<-EXAMPLE describe azure_event_hub_namespace(resource_group: 'example', name: 'namespace-ns') do its(name) { should eq 'name'} @@ -11,9 +11,9 @@ class AzureEventHubNamespace < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.EventHub/namespaces', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.EventHub/namespaces", opts) opts[:resource_identifiers] = %i(namespace_name) # static_resource parameter must be true for setting the resource_provider in the backend. @@ -28,8 +28,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermEventHubNamespace < AzureEventHubNamespace - name 'azurerm_event_hub_namespace' - desc 'Verifies settings for Event Hub Namespace' + name "azurerm_event_hub_namespace" + desc "Verifies settings for Event Hub Namespace" example <<-EXAMPLE describe azurerm_event_hub_namespace(resource_group: 'example', namespace_name: 'namespace-ns') do its(name) { should eq 'name'} @@ -39,10 +39,10 @@ class AzurermEventHubNamespace < AzureEventHubNamespace def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureEventHubNamespace.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2017-04-01' + opts[:api_version] ||= "2017-04-01" super end end diff --git a/libraries/azure_express_route_circuit.rb b/libraries/azure_express_route_circuit.rb index 1f3d8196a..736139bac 100644 --- a/libraries/azure_express_route_circuit.rb +++ b/libraries/azure_express_route_circuit.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureExpressRouteCircuit < AzureGenericResource - name 'azure_express_route_circuit' - desc 'ExpressRoute circuit connect your on-premises infrastructure to Microsoft through a connectivity provider' + name "azure_express_route_circuit" + desc "ExpressRoute circuit connect your on-premises infrastructure to Microsoft through a connectivity provider" example <<-EXAMPLE describe azure_express_route_circuit(resource_group: 'example', circuit_name: 'circuitName') do it { should exist } @@ -11,7 +11,7 @@ class AzureExpressRouteCircuit < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Azure REST API endpoint URL format for the resource: # GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ @@ -40,7 +40,7 @@ def initialize(opts = {}) # The `specific_resource_constraint` method will validate the user input # not to accept a different `resource_provider`. # - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/expressRouteCircuits', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/expressRouteCircuits", opts) opts[:resource_identifiers] = %i(circuit_name) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) diff --git a/libraries/azure_express_route_circuits.rb b/libraries/azure_express_route_circuits.rb index bceb80887..325555dc2 100644 --- a/libraries/azure_express_route_circuits.rb +++ b/libraries/azure_express_route_circuits.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureExpressRouteCircuits < AzureGenericResources - name 'azure_express_route_circuits' - desc 'ExpressRoute circuits connect your on-premises infrastructure to Microsoft through a connectivity provider' + name "azure_express_route_circuits" + desc "ExpressRoute circuits connect your on-premises infrastructure to Microsoft through a connectivity provider" example <<-EXAMPLE describe azure_express_route_circuits(resource_group: 'example') do it{ should exist } @@ -13,7 +13,7 @@ class AzureExpressRouteCircuits < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Azure REST API endpoint URL format listing the all resources for a given subscription: # GET https://management.azure.com/subscriptions/{subscriptionId}/providers/ @@ -40,7 +40,7 @@ def initialize(opts = {}) # The `specific_resource_constraint` method will validate the user input # not to accept a different `resource_provider`. # - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/expressRouteCircuits', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/expressRouteCircuits", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) diff --git a/libraries/azure_express_route_providers.rb b/libraries/azure_express_route_providers.rb index b4fade5a5..717640655 100644 --- a/libraries/azure_express_route_providers.rb +++ b/libraries/azure_express_route_providers.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureExpressRouteServiceProviders < AzureGenericResources - name 'azure_express_route_providers' - desc 'Verifies settings for Azure Virtual Machines' + name "azure_express_route_providers" + desc "Verifies settings for Azure Virtual Machines" example <<-EXAMPLE describe azure_express_route_providers(resource_group: 'example') do it{ should exist } @@ -13,7 +13,7 @@ class AzureExpressRouteServiceProviders < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Azure REST API endpoint URL format listing the all resources for a given subscription: # GET https://management.azure.com/subscriptions/{subscriptionId}/ @@ -43,7 +43,7 @@ def initialize(opts = {}) # The `specific_resource_constraint` method will validate the user input # not to accept a different `resource_provider`. # - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/expressRouteServiceProviders', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/expressRouteServiceProviders", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) diff --git a/libraries/azure_generic_resource.rb b/libraries/azure_generic_resource.rb index 647996ade..e7ad1fea6 100644 --- a/libraries/azure_generic_resource.rb +++ b/libraries/azure_generic_resource.rb @@ -1,12 +1,12 @@ -require 'azure_backend' +require "azure_backend" # The backend class for the singular static resources. # # @author omerdemirok # class AzureGenericResource < AzureResourceBase - name 'azure_generic_resource' - desc 'Inspec Resource to interrogate any resource type available through Azure Resource Manager' + name "azure_generic_resource" + desc "Inspec Resource to interrogate any resource type available through Azure Resource Manager" example <<-EXAMPLE describe azure_generic_resource(resource_group: 'example', name: 'my_resource') do its('name') { should eq 'my_resource' } @@ -15,7 +15,7 @@ class AzureGenericResource < AzureResourceBase def initialize(opts = {}, static_resource = false) # rubocop:disable Style/OptionalBooleanParameter TODO: Fix disabled rubocop issue. super(opts) - @resource_id = '' + @resource_id = "" if @opts.key?(:resource_provider) validate_resource_provider end @@ -27,7 +27,7 @@ def initialize(opts = {}, static_resource = false) # rubocop:disable Style/Optio end @display_name = if @opts[:display_name].nil? @opts.slice(:resource_group, :resource_provider, :name, :tag_name, :tag_value, :resource_id, - :resource_uri).values.join(' ') + :resource_uri).values.join(" ") else @opts[:display_name] end @@ -37,14 +37,14 @@ def initialize(opts = {}, static_resource = false) # rubocop:disable Style/Optio @opts[:resource_data] = @opts[:resource_data].to_h query_params = { resource_uri: @resource_id, resource_data: @opts[:resource_data] } else - resource_fail('There is not enough input to create an Azure resource ID.') if @resource_id.empty? + resource_fail("There is not enough input to create an Azure resource ID.") if @resource_id.empty? # This is the last check on resource_id before talking to resource manager endpoint to get the detailed information. Validators.validate_resource_uri(@resource_id) query_params = { resource_uri: @resource_id } end query_params[:query_parameters] = {} # Use the latest api_version unless provided. - query_params[:query_parameters]['api-version'] = @opts[:api_version] || 'latest' + query_params[:query_parameters]["api-version"] = @opts[:api_version] || "latest" %i(is_uri_a_url headers method req_body audience).each do |param| query_params[param] = @opts[param] unless @opts[param].nil? end @@ -82,9 +82,9 @@ def exists? def to_s(class_name = nil) api_info = "- api_version: #{api_version_used_for_query} #{api_version_used_for_query_state}" if defined?(api_version_used_for_query) if class_name.nil? - "#{AzureGenericResource.name.split('_').map(&:capitalize).join(' ')} #{api_info}: #{@display_name}" + "#{AzureGenericResource.name.split("_").map(&:capitalize).join(" ")} #{api_info}: #{@display_name}" else - "#{class_name.name.split('_').map(&:capitalize).join(' ')} #{api_info}: #{@display_name}" + "#{class_name.name.split("_").map(&:capitalize).join(" ")} #{api_info}: #{@display_name}" end end @@ -130,9 +130,9 @@ def additional_resource_properties(opts = {}) query_params = { resource_uri: opts[:property_endpoint] } query_params[:query_parameters] = {} unless opts[:filter_free_text].nil? - query_params[:query_parameters]['$filter'] = opts[:filter_free_text] + query_params[:query_parameters]["$filter"] = opts[:filter_free_text] end - query_params[:query_parameters]['api-version'] = opts[:api_version] || 'latest' + query_params[:query_parameters]["api-version"] = opts[:api_version] || "latest" %i(is_uri_a_url headers method req_body audience).each do |param| query_params[param] = opts[param] unless opts[param].nil? @@ -166,7 +166,7 @@ def validate_static_resource end if @opts[:resource_identifiers] - raise ArgumentError, '`:resource_identifiers` should be a list.' unless @opts[:resource_identifiers].is_a?(Array) + raise ArgumentError, "`:resource_identifiers` should be a list." unless @opts[:resource_identifiers].is_a?(Array) # The `name` parameter should have been required in the static resource. # Since it is a mandatory field, it is better to make sure that it is in the required list before validations. @opts[:resource_identifiers] << :name unless @opts[:resource_identifiers].include?(:name) @@ -183,7 +183,7 @@ def validate_static_resource validate_resource_uri validate_parameters(required: %i(resource_uri name add_subscription_id), allow: allowed_parameters + required_parameters) - @resource_id = [@opts[:resource_uri], @opts[:name]].join('/').gsub('//', '/') + @resource_id = [@opts[:resource_uri], @opts[:name]].join("/").gsub("//", "/") return end @@ -199,7 +199,7 @@ def validate_generic_resource if @opts.key?(:resource_uri) validate_parameters(required: %i(resource_uri add_subscription_id name), allow: %i(query_parameters is_uri_a_url audience headers transform_keys)) validate_resource_uri - @resource_id = [@opts[:resource_uri], @opts[:name]].join('/').gsub('//', '/') + @resource_id = [@opts[:resource_uri], @opts[:name]].join("/").gsub("//", "/") elsif @opts.key?(:resource_id) validate_parameters(required: %i(resource_id), allow: %i(transform_keys)) @resource_id = @opts[:resource_id] diff --git a/libraries/azure_generic_resources.rb b/libraries/azure_generic_resources.rb index af40c4211..854cfe016 100644 --- a/libraries/azure_generic_resources.rb +++ b/libraries/azure_generic_resources.rb @@ -1,12 +1,12 @@ -require 'azure_backend' +require "azure_backend" # The backend class for the plural static resources. # # @author omerdemirok # class AzureGenericResources < AzureResourceBase - name 'azure_generic_resources' - desc 'Inspec Resource to interrogate any resource type in bulk available through Azure resource manager.' + name "azure_generic_resources" + desc "Inspec Resource to interrogate any resource type in bulk available through Azure resource manager." example <<-EXAMPLE describe azure_static_resources(resource_group: 'my_group') do it { should exist } @@ -22,7 +22,7 @@ def initialize(opts = {}, static_resource = false) # rubocop:disable Style/Optio :tag_name, :tag_value, :resource_uri) - .values.join(' ') + .values.join(" ") table_schema = [ { column: :ids, field: :id }, { column: :names, field: :name }, @@ -84,9 +84,9 @@ def to_s(class_name = nil) api_info = "- api_version: #{api_version_used_for_query} #{api_version_used_for_query_state}" end if class_name.nil? - "#{AzureGenericResources.name.split('_').map(&:capitalize).join(' ')} #{@display_name}" + "#{AzureGenericResources.name.split("_").map(&:capitalize).join(" ")} #{@display_name}" else - "#{class_name.name.split('_').map(&:capitalize).join(' ')} #{api_info} #{@display_name}" + "#{class_name.name.split("_").map(&:capitalize).join(" ")} #{api_info} #{@display_name}" end end @@ -148,18 +148,18 @@ def collect_resources else resource_uri = ["/subscriptions/#{@azure.credentials[:subscription_id]}/providers", @opts[:resource_provider], - @opts[:resource_path]].compact.join('/').gsub('//', '/') + @opts[:resource_path]].compact.join("/").gsub("//", "/") unless @opts[:resource_group].nil? - resource_uri = resource_uri.sub('/providers/', "/resourceGroups/#{@opts[:resource_group]}/providers/") + resource_uri = resource_uri.sub("/providers/", "/resourceGroups/#{@opts[:resource_group]}/providers/") end query_params = { resource_uri: resource_uri } end query_params[:query_parameters] = @opts[:query_parameters].presence || {} unless @opts[:filter_free_text].nil? - query_params[:query_parameters]['$filter'] = @opts[:filter_free_text] + query_params[:query_parameters]["$filter"] = @opts[:filter_free_text] end # Use the latest api_version unless provided. - query_params[:query_parameters]['api-version'] = @opts[:api_version] || 'latest' + query_params[:query_parameters]["api-version"] = @opts[:api_version] || "latest" %i(is_uri_a_url headers method req_body audience).each do |param| query_params[param] = @opts[param] unless @opts[param].nil? end @@ -197,11 +197,11 @@ def collect_resources end def validate_static_resource - raise ArgumentError, 'Warning for the resource author: `resource_provider` must be defined.' \ + raise ArgumentError, "Warning for the resource author: `resource_provider` must be defined." \ unless @opts.key?(:resource_provider) @table = [] @resources = {} - @opts[:api_version] = 'latest' unless @opts.key?(:api_version) + @opts[:api_version] = "latest" unless @opts.key?(:api_version) # These are the parameters created in the static resource code, NOT provided by the user. allowed_params = %i(resource_path resource_group resource_provider add_subscription_id resource_uri is_uri_a_url audience) diff --git a/libraries/azure_graph_generic_resource.rb b/libraries/azure_graph_generic_resource.rb index 195a6ce62..1bd3c3d5b 100644 --- a/libraries/azure_graph_generic_resource.rb +++ b/libraries/azure_graph_generic_resource.rb @@ -1,12 +1,12 @@ -require 'azure_backend' +require "azure_backend" # The backend class for the singular static resources from the GRAPH API. # # @author omerdemirok # class AzureGraphGenericResource < AzureResourceBase - name 'azure_graph_generic_resource' - desc 'Inspec Resource to interrogate any resource type available through Azure Graph API' + name "azure_graph_generic_resource" + desc "Inspec Resource to interrogate any resource type available through Azure Graph API" example <<-EXAMPLE describe azure_graph_generic_resource(resource_provider: 'users', name: 'jdoe@contoso.com') do its('display_name') { should eq 'John Doe' } @@ -31,7 +31,7 @@ def initialize(opts = {}, static_resource = false) # rubocop:disable Style/Optio # If the queried entity does not exist, this resource will pass `it { should_not exist }` test. # if static_resource - raise ArgumentError, '`:resource_identifiers` have to be provided within a list' unless @opts[:resource_identifiers] + raise ArgumentError, "`:resource_identifiers` have to be provided within a list" unless @opts[:resource_identifiers] provided = Validators.validate_params_only_one_of(@__resource_name__, @opts[:resource_identifiers], @opts) # We should remove resource identifiers other than `:id`. unless provided == :id @@ -44,15 +44,15 @@ def initialize(opts = {}, static_resource = false) # rubocop:disable Style/Optio required: %i(resource id), allow: %i(select resource_identifiers), ) - @display_name = @opts.slice(:resource, :id).values.join(' ') + @display_name = @opts.slice(:resource, :id).values.join(" ") query = {} - query[:resource] = [@opts[:resource], @opts[:id]].join('/') + query[:resource] = [@opts[:resource], @opts[:id]].join("/") query[:api_version] = @opts[:api_version] unless @opts[:api_version].nil? query_parameters = {} if @opts[:select] - query_parameters['$select'] = Helpers.odata_query(@opts[:select]) + query_parameters["$select"] = Helpers.odata_query(@opts[:select]) end query[:query_parameters] = query_parameters unless query_parameters.empty? @@ -75,9 +75,9 @@ def to_s(class_name = nil) api_version = @opts[:api_version] || @azure.graph_api_endpoint_api_version api_info = "- api_version: #{api_version} " if class_name.nil? - "#{AzureGraphGenericResource.name.split('_').map(&:capitalize).join(' ')} #{api_info}: #{@display_name}" + "#{AzureGraphGenericResource.name.split("_").map(&:capitalize).join(" ")} #{api_info}: #{@display_name}" else - "#{class_name.name.split('_').map(&:capitalize).join(' ')} #{api_info}: #{@display_name}" + "#{class_name.name.split("_").map(&:capitalize).join(" ")} #{api_info}: #{@display_name}" end end diff --git a/libraries/azure_graph_generic_resources.rb b/libraries/azure_graph_generic_resources.rb index 86d4a92c7..46216789d 100644 --- a/libraries/azure_graph_generic_resources.rb +++ b/libraries/azure_graph_generic_resources.rb @@ -1,12 +1,12 @@ -require 'azure_backend' +require "azure_backend" # The backend class for the plural static resources from the GRAPH API. # # @author omerdemirok # class AzureGraphGenericResources < AzureResourceBase - name 'azure_graph_generic_resources' - desc 'Inspec plural resource to interrogate any resource type available through Azure Graph API' + name "azure_graph_generic_resources" + desc "Inspec plural resource to interrogate any resource type available through Azure Graph API" example <<-EXAMPLE describe azure_graph_generic_resources(resource_provider: 'users', filter: {given_name: 'John'}) do it { should exist } @@ -42,7 +42,7 @@ def initialize(opts = {}, static_resource = false) # rubocop:disable Style/Optio required: %i(resource), allow: %i(select filter filter_free_text), ) - @display_name = @opts.slice(:resource, :filter, :filter_free_text).values.join(' ') + @display_name = @opts.slice(:resource, :filter, :filter_free_text).values.join(" ") query = {} query[:resource] = @opts[:resource] @@ -50,17 +50,17 @@ def initialize(opts = {}, static_resource = false) # rubocop:disable Style/Optio query_parameters = {} # Ensure that `id` of the resource is returned from the API. - query_parameters['$select'] = 'id,' + query_parameters["$select"] = "id," if @opts[:select] # Remove `id` if it is duplicated in user supplied 'select' parameters. - @opts[:select].delete('id') - query_parameters['$select'] += Helpers.odata_query(@opts[:select]) + @opts[:select].delete("id") + query_parameters["$select"] += Helpers.odata_query(@opts[:select]) end if %i(filter filter_free_text).all? { |a| @opts.keys.include?(a) } - raise ArgumentError, 'Either `:filter` or `:filter_free_text` should be provided.' + raise ArgumentError, "Either `:filter` or `:filter_free_text` should be provided." end if @opts[:filter] - query_parameters['$filter'] = Helpers.odata_query(@opts[:filter]) + query_parameters["$filter"] = Helpers.odata_query(@opts[:filter]) end # This will allow passing: @@ -69,7 +69,7 @@ def initialize(opts = {}, static_resource = false) # rubocop:disable Style/Optio # @see # https://docs.microsoft.com/en-us/graph/query-parameters#filter-parameter if @opts[:filter_free_text] - query_parameters['$filter'] = @opts[:filter_free_text] + query_parameters["$filter"] = @opts[:filter_free_text] end query[:query_parameters] = query_parameters unless query_parameters.empty? @@ -113,9 +113,9 @@ def to_s(class_name = nil) api_version = @opts[:api_version] || @azure.graph_api_endpoint_api_version api_info = "- api_version: #{api_version} " if class_name.nil? - "#{AzureGraphGenericResources.name.split('_').map(&:capitalize).join(' ')} #{api_info}: #{@display_name}" + "#{AzureGraphGenericResources.name.split("_").map(&:capitalize).join(" ")} #{api_info}: #{@display_name}" else - "#{class_name.name.split('_').map(&:capitalize).join(' ')} #{api_info}: #{@display_name}" + "#{class_name.name.split("_").map(&:capitalize).join(" ")} #{api_info}: #{@display_name}" end end diff --git a/libraries/azure_graph_user.rb b/libraries/azure_graph_user.rb index c1a777144..4f1add80a 100644 --- a/libraries/azure_graph_user.rb +++ b/libraries/azure_graph_user.rb @@ -1,8 +1,8 @@ -require 'azure_graph_generic_resource' +require "azure_graph_generic_resource" class AzureGraphUser < AzureGraphGenericResource - name 'azure_graph_user' - desc 'Verifies settings for an Azure Active Directory User' + name "azure_graph_user" + desc "Verifies settings for an Azure Active Directory User" example <<-EXAMPLE describe azure_graph_user(user_id: 'userId') do it { should exist } @@ -11,7 +11,7 @@ class AzureGraphUser < AzureGraphGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby error will be raised. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # @see # https://docs.microsoft.com/en-us/graph/api/user-get?view=graph-rest-1.0&tabs=http#examples @@ -37,12 +37,12 @@ def initialize(opts = {}) opts[:resource_identifiers] = %i(user_principal_name user_id id) # Define the resource. - opts[:resource] = 'users' + opts[:resource] = "users" # Properties to expose. - opts[:select] = 'objectId,accountEnabled,city,country,department,displayName,givenName,jobTitle,mail,'\ - 'mailNickname,mobilePhone,passwordPolicies,passwordProfile,postalCode,state,streetAddress,surname,'\ - 'businessPhones,usageLocation,userPrincipalName,userType,faxNumber,id'.split(',') + opts[:select] = "objectId,accountEnabled,city,country,department,displayName,givenName,jobTitle,mail,"\ + "mailNickname,mobilePhone,passwordPolicies,passwordProfile,postalCode,state,streetAddress,surname,"\ + "businessPhones,usageLocation,userPrincipalName,userType,faxNumber,id".split(",") # At this point there is enough data to make the query. # super must be called with `static_resource => true` switch. @@ -84,7 +84,7 @@ def display_name end def guest? - userType == 'Guest' + userType == "Guest" end # Methods for backward compatibility ends here <<<< end @@ -92,8 +92,8 @@ def guest? # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermAdUser < AzureGraphUser - name 'azurerm_ad_user' - desc 'Verifies settings for an Azure Active Directory User' + name "azurerm_ad_user" + desc "Verifies settings for an Azure Active Directory User" example <<-EXAMPLE describe azurerm_ad_user(user_id: 'userId') do it { should exist } diff --git a/libraries/azure_graph_users.rb b/libraries/azure_graph_users.rb index ca36b3337..aac1e53a7 100644 --- a/libraries/azure_graph_users.rb +++ b/libraries/azure_graph_users.rb @@ -1,8 +1,8 @@ -require 'azure_graph_generic_resources' +require "azure_graph_generic_resources" class AzureGraphUsers < AzureGraphGenericResources - name 'azure_graph_users' - desc 'Verifies settings for an Azure Active Directory User' + name "azure_graph_users" + desc "Verifies settings for an Azure Active Directory User" example <<-EXAMPLE describe azure_graph_users do it { should exist } @@ -11,7 +11,7 @@ class AzureGraphUsers < AzureGraphGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby error will be raised. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # @see # https://docs.microsoft.com/en-us/graph/api/user-get?view=graph-rest-1.0&tabs=http#examples @@ -38,10 +38,10 @@ def initialize(opts = {}) # # Define the resource. - opts[:resource] = 'users' + opts[:resource] = "users" # Properties to expose. - opts[:select] = 'id,displayName,givenName,jobTitle,mail,userType,userPrincipalName'.split(',') + opts[:select] = "id,displayName,givenName,jobTitle,mail,userType,userPrincipalName".split(",") # At this point there is enough data to make the query. # super must be called with `static_resource => true` switch. @@ -52,7 +52,7 @@ def initialize(opts = {}) end def guest_accounts - @guest_accounts ||= where(userType: 'Guest').mails + @guest_accounts ||= where(userType: "Guest").mails rescue NoMethodError [] end @@ -72,8 +72,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermAdUsers < AzureGraphUsers - name 'azurerm_ad_users' - desc 'Verifies settings for an Azure Active Directory User' + name "azurerm_ad_users" + desc "Verifies settings for an Azure Active Directory User" example <<-EXAMPLE describe azurerm_ad_users do it { should exist } diff --git a/libraries/azure_hdinsight_cluster.rb b/libraries/azure_hdinsight_cluster.rb index fbb703e53..368f0a827 100644 --- a/libraries/azure_hdinsight_cluster.rb +++ b/libraries/azure_hdinsight_cluster.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureHdinsightCluster < AzureGenericResource - name 'azure_hdinsight_cluster' - desc 'Verifies settings for HDInsight Clusters' + name "azure_hdinsight_cluster" + desc "Verifies settings for HDInsight Clusters" example <<-EXAMPLE describe azure_hdinsight_cluster(resource_group: 'example', name: 'name') do its(name) { should eq 'name'} @@ -11,9 +11,9 @@ class AzureHdinsightCluster < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.HDInsight/clusters', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.HDInsight/clusters", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -27,8 +27,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermHdinsightCluster < AzureHdinsightCluster - name 'azurerm_hdinsight_cluster' - desc 'Verifies settings for HDInsight Clusters' + name "azurerm_hdinsight_cluster" + desc "Verifies settings for HDInsight Clusters" example <<-EXAMPLE describe azurerm_hdinsight_cluster(resource_group: 'example', name: 'name') do its(name) { should eq 'name'} @@ -38,10 +38,10 @@ class AzurermHdinsightCluster < AzureHdinsightCluster def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureHdinsightCluster.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2015-03-01-preview' + opts[:api_version] ||= "2015-03-01-preview" super end end diff --git a/libraries/azure_hpc_asc_operation.rb b/libraries/azure_hpc_asc_operation.rb index da9d3eaec..e750ba071 100644 --- a/libraries/azure_hpc_asc_operation.rb +++ b/libraries/azure_hpc_asc_operation.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureHPCASCOperation < AzureGenericResource - name 'azure_hpc_asc_operation' - desc 'Retrieves and verifies the settings of an Azure HPC ASC Operation' + name "azure_hpc_asc_operation" + desc "Retrieves and verifies the settings of an Azure HPC ASC Operation" example <<-EXAMPLE describe azure_hpc_asc_operation(location: 'westus', operation_id: 'testoperationid') do it { should exist } @@ -10,11 +10,11 @@ class AzureHPCASCOperation < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.StorageCache/locations', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.StorageCache/locations", opts) opts[:required_parameters] = %i(location operation_id) - opts[:resource_path] = [opts[:location], 'ascOperations', opts[:operation_id]].join('/') + opts[:resource_path] = [opts[:location], "ascOperations", opts[:operation_id]].join("/") super(opts, true) end diff --git a/libraries/azure_hpc_cache.rb b/libraries/azure_hpc_cache.rb index a1be091ec..c4caf0bbe 100644 --- a/libraries/azure_hpc_cache.rb +++ b/libraries/azure_hpc_cache.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureHPCCache < AzureGenericResource - name 'azure_hpc_cache' - desc 'Retrieves and verifies the settings of an Azure HPC Cache.' + name "azure_hpc_cache" + desc "Retrieves and verifies the settings of an Azure HPC Cache." example <<-EXAMPLE describe azure_hpc_cache(resource_group: 'inspec-rg', name: 'sc1') do it { should exist } @@ -10,9 +10,9 @@ class AzureHPCCache < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.StorageCache/caches', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.StorageCache/caches", opts) super(opts, true) end diff --git a/libraries/azure_hpc_cache_skus.rb b/libraries/azure_hpc_cache_skus.rb index 95294f0c5..1b50bd759 100644 --- a/libraries/azure_hpc_cache_skus.rb +++ b/libraries/azure_hpc_cache_skus.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureHPCCacheSKUs < AzureGenericResources - name 'azure_hpc_cache_skus' - desc 'Verifies settings for a collection of Azure HPC Storage SKUs' + name "azure_hpc_cache_skus" + desc "Verifies settings for a collection of Azure HPC Storage SKUs" example <<-EXAMPLE describe azure_hpc_cache_skus do it { should exist } @@ -10,9 +10,9 @@ class AzureHPCCacheSKUs < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.StorageCache/skus', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.StorageCache/skus", opts) super(opts, true) return if failed_resource? diff --git a/libraries/azure_hpc_caches.rb b/libraries/azure_hpc_caches.rb index bff80ff5b..0a3001b98 100644 --- a/libraries/azure_hpc_caches.rb +++ b/libraries/azure_hpc_caches.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureHPCCaches < AzureGenericResources - name 'azure_hpc_caches' - desc 'Verifies settings for a collection of Azure HPC Caches' + name "azure_hpc_caches" + desc "Verifies settings for a collection of Azure HPC Caches" example <<-EXAMPLE describe azure_hpc_caches do it { should exist } @@ -10,9 +10,9 @@ class AzureHPCCaches < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.StorageCache/caches', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.StorageCache/caches", opts) super(opts, true) return if failed_resource? diff --git a/libraries/azure_hpc_storage_target.rb b/libraries/azure_hpc_storage_target.rb index aef6a9363..5fc76e72b 100644 --- a/libraries/azure_hpc_storage_target.rb +++ b/libraries/azure_hpc_storage_target.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureHPCStorageTarget < AzureGenericResource - name 'azure_hpc_storage_target' - desc 'Retrieves and verifies the settings of an Azure HPC Storage Target' + name "azure_hpc_storage_target" + desc "Retrieves and verifies the settings of an Azure HPC Storage Target" example <<-EXAMPLE describe azure_hpc_storage_target(resource_group: 'inspec-rg', cache_name: 'sc1', name: 'st1') do it { should exist } @@ -10,11 +10,11 @@ class AzureHPCStorageTarget < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.StorageCache/caches', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.StorageCache/caches", opts) opts[:resource_identifiers] = [:cache_name] - opts[:resource_path] = [opts[:cache_name], 'storageTargets', opts[:name]].join('/') + opts[:resource_path] = [opts[:cache_name], "storageTargets", opts[:name]].join("/") super(opts, true) end diff --git a/libraries/azure_hpc_storage_targets.rb b/libraries/azure_hpc_storage_targets.rb index 0da03ed8d..2aa4248bc 100644 --- a/libraries/azure_hpc_storage_targets.rb +++ b/libraries/azure_hpc_storage_targets.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureHPCStorageTargets < AzureGenericResources - name 'azure_hpc_storage_targets' - desc 'Verifies settings for a collection of Azure HPC Storage Targets' + name "azure_hpc_storage_targets" + desc "Verifies settings for a collection of Azure HPC Storage Targets" example <<-EXAMPLE describe azure_hpc_storage_targets(resource_group: 'inspec-rg', cache_name: 'sc1') do it { should exist } @@ -10,11 +10,11 @@ class AzureHPCStorageTargets < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.StorageCache/caches', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.StorageCache/caches", opts) opts[:required_parameters] = %i(resource_group cache_name) - opts[:resource_path] = [opts[:cache_name], 'storageTargets'].join('/') + opts[:resource_path] = [opts[:cache_name], "storageTargets"].join("/") super(opts, true) return if failed_resource? diff --git a/libraries/azure_iothub.rb b/libraries/azure_iothub.rb index 2d6534ed3..7a413a262 100644 --- a/libraries/azure_iothub.rb +++ b/libraries/azure_iothub.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureIotHub < AzureGenericResource - name 'azure_iothub' - desc 'Verifies settings for Iot Hub' + name "azure_iothub" + desc "Verifies settings for Iot Hub" example <<-EXAMPLE describe azure_iothub(resource_group: 'example', name: 'my-iot-hub') do its(name) { should eq 'my-iot-hub'} @@ -11,9 +11,9 @@ class AzureIotHub < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Devices/IotHubs', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Devices/IotHubs", opts) opts[:resource_identifiers] = %i(resource_name) @@ -29,8 +29,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermIotHub < AzureIotHub - name 'azurerm_iothub' - desc 'Verifies settings for Iot Hub' + name "azurerm_iothub" + desc "Verifies settings for Iot Hub" example <<-EXAMPLE describe azurerm_iothub(resource_group: 'example', resource_name: 'my-iot-hub') do its(name) { should eq 'my-iot-hub'} @@ -40,10 +40,10 @@ class AzurermIotHub < AzureIotHub def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureIotHub.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2018-04-01' + opts[:api_version] ||= "2018-04-01" super end end diff --git a/libraries/azure_iothub_event_hub_consumer_group.rb b/libraries/azure_iothub_event_hub_consumer_group.rb index e74fa84bd..03ebcff93 100644 --- a/libraries/azure_iothub_event_hub_consumer_group.rb +++ b/libraries/azure_iothub_event_hub_consumer_group.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureIotHubEventHubConsumerGroup < AzureGenericResource - name 'azure_iothub_event_hub_consumer_group' - desc 'Verifies settings for Iot Hub Event HUb Consumer Group' + name "azure_iothub_event_hub_consumer_group" + desc "Verifies settings for Iot Hub Event HUb Consumer Group" example <<-EXAMPLE describe azure_iothub_event_hub_consumer_group(resource_group: 'my-rg', resource_name: 'my-iot-hub', event_hub_endpoint: 'myeventhub', consumer_group: 'my-consumer-group') do its(name) { should eq 'my-consumer-group'} @@ -11,11 +11,11 @@ class AzureIotHubEventHubConsumerGroup < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Devices/IotHubs', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Devices/IotHubs", opts) opts[:required_parameters] = %i(resource_name event_hub_endpoint) - opts[:resource_path] = [opts[:resource_name], 'eventHubEndpoints', opts[:event_hub_endpoint], 'ConsumerGroups'].join('/') + opts[:resource_path] = [opts[:resource_name], "eventHubEndpoints", opts[:event_hub_endpoint], "ConsumerGroups"].join("/") opts[:resource_identifiers] = %i(consumer_group) # static_resource parameter must be true for setting the resource_provider in the backend. @@ -30,8 +30,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermIotHubEventHubConsumerGroup < AzureIotHubEventHubConsumerGroup - name 'azurerm_iothub_event_hub_consumer_group' - desc 'Verifies settings for Iot Hub Event HUb Consumer Group' + name "azurerm_iothub_event_hub_consumer_group" + desc "Verifies settings for Iot Hub Event HUb Consumer Group" example <<-EXAMPLE describe azurerm_iothub_event_hub_consumer_group(resource_group: 'my-rg', resource_name: 'my-iot-hub', event_hub_endpoint: 'myeventhub', consumer_group: 'my-consumer-group') do its(name) { should eq 'my-consumer-group'} @@ -41,10 +41,10 @@ class AzurermIotHubEventHubConsumerGroup < AzureIotHubEventHubConsumerGroup def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureIotHubEventHubConsumerGroup.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2018-04-01' + opts[:api_version] ||= "2018-04-01" super end end diff --git a/libraries/azure_iothub_event_hub_consumer_groups.rb b/libraries/azure_iothub_event_hub_consumer_groups.rb index f666c7eba..c93c53445 100644 --- a/libraries/azure_iothub_event_hub_consumer_groups.rb +++ b/libraries/azure_iothub_event_hub_consumer_groups.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureIotHubEventHubConsumerGroups < AzureGenericResources - name 'azure_iothub_event_hub_consumer_groups' - desc 'Verifies settings for Iot Hub Event Hub Consumer Groups' + name "azure_iothub_event_hub_consumer_groups" + desc "Verifies settings for Iot Hub Event Hub Consumer Groups" example <<-EXAMPLE describe azure_iothub_event_hub_consumer_groups(resource_group: 'my-rg', resource_name: 'my-iot-hub', event_hub_endpoint: 'myeventhub') do it { should exist } @@ -13,11 +13,11 @@ class AzureIotHubEventHubConsumerGroups < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Devices/IotHubs', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Devices/IotHubs", opts) opts[:required_parameters] = %i(resource_group resource_name event_hub_endpoint) - opts[:resource_path] = [opts[:resource_name], 'eventHubEndpoints', opts[:event_hub_endpoint], 'ConsumerGroups'].join('/') + opts[:resource_path] = [opts[:resource_name], "eventHubEndpoints", opts[:event_hub_endpoint], "ConsumerGroups"].join("/") # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -51,8 +51,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermIotHubEventHubConsumerGroups < AzureIotHubEventHubConsumerGroups - name 'azurerm_iothub_event_hub_consumer_groups' - desc 'Verifies settings for Iot Hub Event Hub Consumer Groups' + name "azurerm_iothub_event_hub_consumer_groups" + desc "Verifies settings for Iot Hub Event Hub Consumer Groups" example <<-EXAMPLE describe azurerm_iothub_event_hub_consumer_groups(resource_group: 'my-rg', resource_name: 'my-iot-hub', event_hub_endpoint: 'myeventhub') do it { should exist } @@ -62,10 +62,10 @@ class AzurermIotHubEventHubConsumerGroups < AzureIotHubEventHubConsumerGroups def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureIotHubEventHubConsumerGroups.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2018-04-01' + opts[:api_version] ||= "2018-04-01" super end end diff --git a/libraries/azure_key_vault.rb b/libraries/azure_key_vault.rb index 549514919..fdd4a04c0 100644 --- a/libraries/azure_key_vault.rb +++ b/libraries/azure_key_vault.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureKeyVault < AzureGenericResource - name 'azure_key_vault' - desc 'Verifies settings and configuration for an Azure Key Vault' + name "azure_key_vault" + desc "Verifies settings and configuration for an Azure Key Vault" example <<-EXAMPLE describe azure_key_vault(resource_group: 'rg-1', vault_name: 'vault-1') do it { should exist } @@ -12,7 +12,7 @@ class AzureKeyVault < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Azure REST API endpoint URL format for the resource: # GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/ @@ -43,7 +43,7 @@ def initialize(opts = {}) # The `specific_resource_constraint` method will validate the user input # not to accept a different `resource_provider`. # - opts[:resource_provider] = specific_resource_constraint('Microsoft.KeyVault/vaults', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.KeyVault/vaults", opts) # Key vault name can be accepted with a different keyword, `vault_name`. `name` is default accepted. opts[:resource_identifiers] = %i(vault_name) opts[:allowed_parameters] = %i(diagnostic_settings_api_version) @@ -52,7 +52,7 @@ def initialize(opts = {}) super(opts, true) # `api_version` is fixed for backward compatibility. - @opts[:diagnostic_settings_api_version] ||= '2017-05-01-preview' + @opts[:diagnostic_settings_api_version] ||= "2017-05-01-preview" end def to_s @@ -82,7 +82,7 @@ def diagnostic_settings # and make api response available through this property. additional_resource_properties( { - property_name: 'diagnostic_settings', + property_name: "diagnostic_settings", property_endpoint: "#{id}/providers/microsoft.insights/diagnosticSettings", api_version: @opts[:diagnostic_settings_api_version], }, @@ -103,7 +103,7 @@ def diagnostic_settings_logs def has_logging_enabled? return false if diagnostic_settings.nil? || diagnostic_settings.empty? log = diagnostic_settings.each do |setting| - log = setting.properties&.logs&.detect { |l| l.category == 'AuditEvent' } + log = setting.properties&.logs&.detect { |l| l.category == "AuditEvent" } break log if log.present? end log&.enabled @@ -113,8 +113,8 @@ def has_logging_enabled? # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermKeyVault < AzureKeyVault - name 'azurerm_key_vault' - desc 'Verifies settings and configuration for an Azure Key Vault' + name "azurerm_key_vault" + desc "Verifies settings and configuration for an Azure Key Vault" example <<-EXAMPLE describe azurerm_key_vault(resource_group: 'rg-1', vault_name: 'vault-1') do it { should exist } @@ -125,10 +125,10 @@ class AzurermKeyVault < AzureKeyVault def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureKeyVault.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2016-10-01' + opts[:api_version] ||= "2016-10-01" super end end diff --git a/libraries/azure_key_vault_key.rb b/libraries/azure_key_vault_key.rb index 8a43462a0..e330272cf 100644 --- a/libraries/azure_key_vault_key.rb +++ b/libraries/azure_key_vault_key.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureKeyVaultKey < AzureGenericResource - name 'azure_key_vault_key' - desc 'Verifies configuration for an Azure Key within a Vault' + name "azure_key_vault_key" + desc "Verifies configuration for an Azure Key within a Vault" example <<-EXAMPLE describe azure_key_vault_key(vault_name: 'vault-101', key_name: 'key') do it { should exist } @@ -12,10 +12,10 @@ class AzureKeyVaultKey < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # This part is normally done in the backend; however, we need to get the `key_vault_dns_suffix` at the initiation. - opts[:endpoint] ||= ENV_HASH['endpoint'] || 'azure_cloud' + opts[:endpoint] ||= ENV_HASH["endpoint"] || "azure_cloud" unless AzureEnvironments::ENDPOINTS.key?(opts[:endpoint]) raise ArgumentError, "Invalid endpoint: `#{opts[:endpoint]}`."\ " Expected one of the following options: #{AzureEnvironments::ENDPOINTS.keys}." @@ -39,7 +39,7 @@ def initialize(opts = {}) end end opts[:is_uri_a_url] = true - opts[:audience] = "https://#{key_vault_dns_suffix.delete_prefix('.')}" + opts[:audience] = "https://#{key_vault_dns_suffix.delete_prefix(".")}" # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) rotation_policy @@ -59,13 +59,13 @@ def has_rotation_policy_enabled? is_uri_a_url: true, audience: @opts[:audience], } - query[:query_parameters]['api-version'] = @opts[:api_version] + query[:query_parameters]["api-version"] = @opts[:api_version] policy = get_resource(query) rotation_policy_enabled = false if !policy.nil? policy[:lifetimeActions].each do |value| - rotation_policy_enabled = true if value[:action][:type] == 'Rotate' + rotation_policy_enabled = true if value[:action][:type] == "Rotate" end end rotation_policy_enabled @@ -73,7 +73,7 @@ def has_rotation_policy_enabled? private - VALID_VERSION_REGEX = Regexp.new('^([0-9a-f]{32})$') + VALID_VERSION_REGEX = Regexp.new("^([0-9a-f]{32})$") def valid_version?(version) version.downcase.scan(VALID_VERSION_REGEX).any? @@ -83,8 +83,8 @@ def valid_version?(version) # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermKeyVaultKey < AzureKeyVaultKey - name 'azurerm_key_vault_key' - desc 'Verifies configuration for an Azure Key within a Vault' + name "azurerm_key_vault_key" + desc "Verifies configuration for an Azure Key within a Vault" example <<-EXAMPLE describe azurerm_key_vault_key('vault-101', 'key') do it { should exist } @@ -98,7 +98,7 @@ def initialize(vault_name, key_name, key_version = nil) opts = { vault_name: vault_name, key_name: key_name, - api_version: '2016-10-01', + api_version: "2016-10-01", } opts[:key_version] = key_version unless key_version.nil? super(opts) diff --git a/libraries/azure_key_vault_keys.rb b/libraries/azure_key_vault_keys.rb index 351ef3312..fe181c840 100644 --- a/libraries/azure_key_vault_keys.rb +++ b/libraries/azure_key_vault_keys.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureKeyVaultKeys < AzureGenericResources - name 'azure_key_vault_keys' - desc 'Verifies settings for a collection of Azure Keys belonging to a Vault' + name "azure_key_vault_keys" + desc "Verifies settings for a collection of Azure Keys belonging to a Vault" example <<-EXAMPLE describe azure_key_vault_keys(vault_name: 'vault-101') do it { should exist } @@ -14,9 +14,9 @@ class AzureKeyVaultKeys < AzureGenericResources def initialize(opts = {}) opts = { vault_name: opts } if opts.is_a?(String) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:endpoint] ||= ENV_HASH['endpoint'] || 'azure_cloud' + opts[:endpoint] ||= ENV_HASH["endpoint"] || "azure_cloud" unless AzureEnvironments::ENDPOINTS.key?(opts[:endpoint]) raise ArgumentError, "Invalid endpoint: `#{opts[:endpoint]}`."\ " Expected one of the following options: #{AzureEnvironments::ENDPOINTS.keys}." @@ -27,7 +27,7 @@ def initialize(opts = {}) opts[:required_parameters] = %i(vault_name) opts[:resource_uri] = "https://#{opts[:vault_name]}#{key_vault_dns_suffix}/keys" opts[:is_uri_a_url] = true - opts[:audience] = "https://#{key_vault_dns_suffix.delete_prefix('.')}" + opts[:audience] = "https://#{key_vault_dns_suffix.delete_prefix(".")}" super(opts, true) return if failed_resource? @@ -71,8 +71,8 @@ def populate_table # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermKeyVaultKeys < AzureKeyVaultKeys - name 'azurerm_key_vault_keys' - desc 'Verifies settings for a collection of Azure Keys belonging to a Vault' + name "azurerm_key_vault_keys" + desc "Verifies settings for a collection of Azure Keys belonging to a Vault" example <<-EXAMPLE describe azurerm_key_vault_keys('vault-101') do it { should exist } @@ -84,7 +84,7 @@ def initialize(vault_name) # This is for backward compatibility. opts = { vault_name: vault_name, - api_version: '2016-10-01', + api_version: "2016-10-01", } super(opts) end diff --git a/libraries/azure_key_vault_rotation_key.rb b/libraries/azure_key_vault_rotation_key.rb index b0da4a6f8..58dc3cfef 100644 --- a/libraries/azure_key_vault_rotation_key.rb +++ b/libraries/azure_key_vault_rotation_key.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureKeyVaultRotationKey < AzureGenericResource - name 'azure_key_vault_rotation_key' - desc 'Verifies configuration for an Azure Rotation Key within a Vault.' + name "azure_key_vault_rotation_key" + desc "Verifies configuration for an Azure Rotation Key within a Vault." example <<-EXAMPLE describe azure_key_vault_rotation_key(vault_name: 'KEY_VAULT_NAME', key_name: 'KEY_NAME') do it { should exist } @@ -11,10 +11,10 @@ class AzureKeyVaultRotationKey < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # This part is normally done in the backend; however, we need to get the `key_vault_dns_suffix` at the initiation. - opts[:endpoint] ||= ENV_HASH['endpoint'] || 'azure_cloud' + opts[:endpoint] ||= ENV_HASH["endpoint"] || "azure_cloud" unless AzureEnvironments::ENDPOINTS.key?(opts[:endpoint]) raise ArgumentError, "Invalid endpoint: `#{opts[:endpoint]}`."\ " Expected one of the following options: #{AzureEnvironments::ENDPOINTS.keys}." @@ -27,7 +27,7 @@ def initialize(opts = {}) opts[:resource_identifiers] = %i(key_name) opts[:resource_uri] = "https://#{opts[:vault_name]}#{key_vault_dns_suffix}/keys/#{opts[:key_name]}/rotationpolicy" opts[:is_uri_a_url] = true - opts[:audience] = "https://#{key_vault_dns_suffix.delete_prefix('.')}" + opts[:audience] = "https://#{key_vault_dns_suffix.delete_prefix(".")}" super(opts, true) end diff --git a/libraries/azure_key_vault_secret.rb b/libraries/azure_key_vault_secret.rb index 815b174fb..88096fcd7 100644 --- a/libraries/azure_key_vault_secret.rb +++ b/libraries/azure_key_vault_secret.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureKeyVaultSecret < AzureGenericResource - name 'azure_key_vault_secret' - desc 'Verifies configuration for a Secret within a Vault' + name "azure_key_vault_secret" + desc "Verifies configuration for a Secret within a Vault" example <<-EXAMPLE describe azure_key_vault_secret(vault_name: 'vault-name', secret_name: 'secret-name') do it { should exist } @@ -12,10 +12,10 @@ class AzureKeyVaultSecret < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # This part is normally done in the backend; however, we need to get the `key_vault_dns_suffix` at the initiation. - opts[:endpoint] ||= ENV_HASH['endpoint'] || 'azure_cloud' + opts[:endpoint] ||= ENV_HASH["endpoint"] || "azure_cloud" unless AzureEnvironments::ENDPOINTS.key?(opts[:endpoint]) raise ArgumentError, "Invalid endpoint: `#{opts[:endpoint]}`."\ " Expected one of the following options: #{AzureEnvironments::ENDPOINTS.keys}." @@ -40,7 +40,7 @@ def initialize(opts = {}) end end opts[:is_uri_a_url] = true - opts[:audience] = "https://#{key_vault_dns_suffix.delete_prefix('.')}" + opts[:audience] = "https://#{key_vault_dns_suffix.delete_prefix(".")}" # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) end @@ -56,7 +56,7 @@ def content_type private - VALID_VERSION_REGEX = Regexp.new('^([0-9a-f]{32})$') + VALID_VERSION_REGEX = Regexp.new("^([0-9a-f]{32})$") def valid_version?(version) version.downcase.scan(VALID_VERSION_REGEX).any? @@ -66,8 +66,8 @@ def valid_version?(version) # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermKeyVaultSecret < AzureKeyVaultSecret - name 'azurerm_key_vault_secret' - desc 'Verifies configuration for a Secret within a Vault' + name "azurerm_key_vault_secret" + desc "Verifies configuration for a Secret within a Vault" example <<-EXAMPLE describe azurerm_key_vault_secret('vault-name', 'secret-name') do it { should exist } @@ -81,7 +81,7 @@ def initialize(vault_name, secret_name, secret_version = nil) opts = { vault_name: vault_name, secret_name: secret_name, - api_version: '2016-10-01', + api_version: "2016-10-01", } opts[:secret_version] = secret_version unless secret_version.nil? super(opts) diff --git a/libraries/azure_key_vault_secrets.rb b/libraries/azure_key_vault_secrets.rb index 389bceaa0..dddf84e7e 100644 --- a/libraries/azure_key_vault_secrets.rb +++ b/libraries/azure_key_vault_secrets.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureKeyVaultSecrets < AzureGenericResources - name 'azure_key_vault_secrets' - desc 'Verifies settings for a collection of Azure Secrets within to a Vault' + name "azure_key_vault_secrets" + desc "Verifies settings for a collection of Azure Secrets within to a Vault" example <<-EXAMPLE describe azure_key_vault_secrets(vault_name: 'vault-101') do it { should exist } @@ -14,9 +14,9 @@ class AzureKeyVaultSecrets < AzureGenericResources def initialize(opts = {}) opts = { vault_name: opts } if opts.is_a?(String) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:endpoint] ||= ENV_HASH['endpoint'] || 'azure_cloud' + opts[:endpoint] ||= ENV_HASH["endpoint"] || "azure_cloud" unless AzureEnvironments::ENDPOINTS.key?(opts[:endpoint]) raise ArgumentError, "Invalid endpoint: `#{opts[:endpoint]}`."\ " Expected one of the following options: #{AzureEnvironments::ENDPOINTS.keys}." @@ -27,7 +27,7 @@ def initialize(opts = {}) opts[:required_parameters] = %i(vault_name) opts[:resource_uri] = "https://#{opts[:vault_name]}#{key_vault_dns_suffix}/secrets" opts[:is_uri_a_url] = true - opts[:audience] = "https://#{key_vault_dns_suffix.delete_prefix('.')}" + opts[:audience] = "https://#{key_vault_dns_suffix.delete_prefix(".")}" super(opts, true) return if failed_resource? @@ -73,8 +73,8 @@ def populate_table # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermKeyVaultSecrets < AzureKeyVaultSecrets - name 'azurerm_key_vault_secrets' - desc 'Verifies settings for a collection of Azure Secrets within to a Vault' + name "azurerm_key_vault_secrets" + desc "Verifies settings for a collection of Azure Secrets within to a Vault" example <<-EXAMPLE describe azurerm_key_vault_secrets('vault-101') do it { should exist } @@ -86,7 +86,7 @@ def initialize(vault_name) # This is for backward compatibility. opts = { vault_name: vault_name, - api_version: '2016-10-01', + api_version: "2016-10-01", } super(opts) super diff --git a/libraries/azure_key_vaults.rb b/libraries/azure_key_vaults.rb index e0121a96b..5b9dd90ed 100644 --- a/libraries/azure_key_vaults.rb +++ b/libraries/azure_key_vaults.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureKeyVaults < AzureGenericResources - name 'azure_key_vaults' - desc 'Verifies settings for a collection of Azure Key Vaults' + name "azure_key_vaults" + desc "Verifies settings for a collection of Azure Key Vaults" example <<-EXAMPLE describe azurerm_key_vaults(resource_group: 'rg-1') do it { should exist } @@ -14,7 +14,7 @@ class AzureKeyVaults < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Azure REST API endpoint URL format listing the all resources for a given subscription: # GET https://management.azure.com/subscriptions/{subscriptionId}/providers/ @@ -44,7 +44,7 @@ def initialize(opts = {}) # The `specific_resource_constraint` method will validate the user input # not to accept a different `resource_provider`. - opts[:resource_provider] = specific_resource_constraint('Microsoft.KeyVault/vaults', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.KeyVault/vaults", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -77,8 +77,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermKeyVaults < AzureKeyVaults - name 'azurerm_key_vaults' - desc 'Verifies settings for a collection of Azure Key Vaults' + name "azurerm_key_vaults" + desc "Verifies settings for a collection of Azure Key Vaults" example <<-EXAMPLE describe azurerm_key_vaults(resource_group: 'rg-1') do it { should exist } @@ -89,10 +89,10 @@ class AzurermKeyVaults < AzureKeyVaults def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureKeyVaults.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2016-10-01' + opts[:api_version] ||= "2016-10-01" super end end diff --git a/libraries/azure_load_balancer.rb b/libraries/azure_load_balancer.rb index cb7ebb8e7..dcfc08779 100644 --- a/libraries/azure_load_balancer.rb +++ b/libraries/azure_load_balancer.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureLoadBalancer < AzureGenericResource - name 'azure_load_balancer' - desc 'Verifies settings for an Azure Load Balancer' + name "azure_load_balancer" + desc "Verifies settings for an Azure Load Balancer" example <<-EXAMPLE describe azure_load_balancer(resource_group: 'rg-1', name: 'lb-1') do it { should exist } @@ -11,9 +11,9 @@ class AzureLoadBalancer < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/loadBalancers', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/loadBalancers", opts) opts[:resource_identifiers] = %i(loadbalancer_name) # static_resource parameter must be true for setting the resource_provider in the backend.\ @@ -28,8 +28,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermLoadBalancer < AzureLoadBalancer - name 'azurerm_load_balancer' - desc 'Verifies settings for an Azure Load Balancer' + name "azurerm_load_balancer" + desc "Verifies settings for an Azure Load Balancer" example <<-EXAMPLE describe azurerm_load_balancer(resource_group: 'rg-1', loadbalancer_name: 'lb-1') do it { should exist } @@ -39,10 +39,10 @@ class AzurermLoadBalancer < AzureLoadBalancer def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureLoadBalancer.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2018-11-01' + opts[:api_version] ||= "2018-11-01" super end end diff --git a/libraries/azure_load_balancers.rb b/libraries/azure_load_balancers.rb index a6b1d1637..45fd2a2c2 100644 --- a/libraries/azure_load_balancers.rb +++ b/libraries/azure_load_balancers.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureLoadBalancers < AzureGenericResources - name 'azure_load_balancers' - desc 'Verifies settings for a collection of Azure Load Balancers' + name "azure_load_balancers" + desc "Verifies settings for a collection of Azure Load Balancers" example <<-EXAMPLE describe azure_load_balancers do it { should exist } @@ -13,9 +13,9 @@ class AzureLoadBalancers < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/loadBalancers', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/loadBalancers", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -49,8 +49,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermLoadBalancers < AzureLoadBalancers - name 'azurerm_load_balancers' - desc 'Verifies settings for a collection of Azure Load Balancers' + name "azurerm_load_balancers" + desc "Verifies settings for a collection of Azure Load Balancers" example <<-EXAMPLE describe azurerm_load_balancers do it { should exist } @@ -60,10 +60,10 @@ class AzurermLoadBalancers < AzureLoadBalancers def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureLoadBalancers.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2018-11-01' + opts[:api_version] ||= "2018-11-01" super end end diff --git a/libraries/azure_lock.rb b/libraries/azure_lock.rb index 3e0a7a49d..79f3b05af 100644 --- a/libraries/azure_lock.rb +++ b/libraries/azure_lock.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureLock < AzureGenericResource - name 'azure_lock' - desc 'Verifies settings for an Azure Lock' + name "azure_lock" + desc "Verifies settings for an Azure Lock" example <<-EXAMPLE describe azure_lock(resource_group: 'rg-1', name: 'my-lock-name') do it { should exist } @@ -11,13 +11,13 @@ class AzureLock < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) - raise ArgumentError, '`resource_id` must be provided.' if opts[:resource_id].nil? + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) + raise ArgumentError, "`resource_id` must be provided." if opts[:resource_id].nil? unless opts.slice(:name, :resource_group).keys.empty? - raise ArgumentError, '`name` and `resource_group` parameters are not allowed.' + raise ArgumentError, "`name` and `resource_group` parameters are not allowed." end - opts[:resource_provider] = specific_resource_constraint('Microsoft.Authorization/locks', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Authorization/locks", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) diff --git a/libraries/azure_locks.rb b/libraries/azure_locks.rb index 1e8028194..9feb63c51 100644 --- a/libraries/azure_locks.rb +++ b/libraries/azure_locks.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureLocks < AzureGenericResources - name 'azure_locks' - desc 'Verifies settings for an Azure Lock on a Resource' + name "azure_locks" + desc "Verifies settings for an Azure Lock on a Resource" example <<-EXAMPLE describe azure_locks(resource_group: 'my-rg', resource_name: 'my-vm', resource_type: 'Microsoft.Compute/virtualMachines') do it { should exist } @@ -13,13 +13,13 @@ class AzureLocks < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Resource level parameter validation is done here due to `resource_type` is a special parameter in the backend. if opts[:resource_id] - opts[:resource_name] = opts[:resource_id].split('/').last + opts[:resource_name] = opts[:resource_id].split("/").last opts[:resource_group], provider, r_type = Helpers.res_group_provider_type_from_uri(opts[:resource_id]) - opts[:type] = [provider, r_type].join('/') + opts[:type] = [provider, r_type].join("/") # `resource_id` is not allowed for plural resources in the backend opts.delete(:resource_id) elsif opts[:resource_name] @@ -33,7 +33,7 @@ def initialize(opts = {}) end # This validation is done at this point due to the `resource_type` => `type` conversion has to happen before - opts[:resource_provider] = specific_resource_constraint('Microsoft.Authorization/locks', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Authorization/locks", opts) # This is for passing the validation in the backend. opts[:allowed_parameters] = %i(resoure_id resource_group resource_name type) @@ -69,8 +69,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermLocks < AzureLocks - name 'azurerm_locks' - desc 'Verifies settings for an Azure Lock on a Resource' + name "azurerm_locks" + desc "Verifies settings for an Azure Lock on a Resource" example <<-EXAMPLE describe azurerm_locks(resource_group: 'my-rg', resource_name: 'my-vm', resource_type: 'Microsoft.Compute/virtualMachines') do it { should exist } @@ -80,10 +80,10 @@ class AzurermLocks < AzureLocks def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureLocks.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2016-09-01' + opts[:api_version] ||= "2016-09-01" super end end diff --git a/libraries/azure_managed_application.rb b/libraries/azure_managed_application.rb index d5e114b16..2661ca11c 100644 --- a/libraries/azure_managed_application.rb +++ b/libraries/azure_managed_application.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureManagedApplication < AzureGenericResource - name 'azure_managed_application' - desc 'Retrieves and verifies the settings of an Azure Managed Application.' + name "azure_managed_application" + desc "Retrieves and verifies the settings of an Azure Managed Application." example <<-EXAMPLE describe azure_managed_application(resource_group: 'inspec-rg', name: 'app_name') do it { should exist } @@ -10,9 +10,9 @@ class AzureManagedApplication < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Solutions/applications', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Solutions/applications", opts) super(opts, true) end diff --git a/libraries/azure_managed_applications.rb b/libraries/azure_managed_applications.rb index 466185534..d3a7b814f 100644 --- a/libraries/azure_managed_applications.rb +++ b/libraries/azure_managed_applications.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureManagedApplications < AzureGenericResources - name 'azure_managed_applications' - desc 'Verifies settings for a collection of Azure Managed Applications.' + name "azure_managed_applications" + desc "Verifies settings for a collection of Azure Managed Applications." example <<-EXAMPLE describe azure_managed_applications do it { should exist } @@ -10,9 +10,9 @@ class AzureManagedApplications < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Solutions/applications', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Solutions/applications", opts) super(opts, true) return if failed_resource? diff --git a/libraries/azure_management_group.rb b/libraries/azure_management_group.rb index 2bcb3872f..a1240946f 100644 --- a/libraries/azure_management_group.rb +++ b/libraries/azure_management_group.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureManagementGroup < AzureGenericResource - name 'azure_management_group' - desc 'Verifies settings for an Azure Management Group' + name "azure_management_group" + desc "Verifies settings for an Azure Management Group" example <<-EXAMPLE describe azure_management_group(group_id: 'example-group') do it { should exist } @@ -11,23 +11,23 @@ class AzureManagementGroup < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Management/managementGroups', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Management/managementGroups", opts) opts[:resource_uri] = "providers/#{opts[:resource_provider]}" opts[:add_subscription_id] = false opts[:resource_identifiers] = %i(group_id) opts[:allowed_parameters] = %i(expand recurse filter) # For backward compatibility. opts[:query_parameters] = { - '$recurse' => opts[:recurse] || false, + "$recurse" => opts[:recurse] || false, } - opts[:query_parameters].merge!('$expand' => opts[:expand]) unless opts[:expand].nil? + opts[:query_parameters].merge!("$expand" => opts[:expand]) unless opts[:expand].nil? # Note that $expand=children must be passed up if $recurse is set to true. - if opts[:query_parameters]['$recurse'] - opts[:query_parameters]['$expand'] = 'children' + if opts[:query_parameters]["$recurse"] + opts[:query_parameters]["$expand"] = "children" end - opts[:query_parameters].merge!('$filter' => opts[:filter]) unless opts[:filter].nil? + opts[:query_parameters].merge!("$filter" => opts[:filter]) unless opts[:filter].nil? # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -112,8 +112,8 @@ def children_types # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermManagementGroup < AzureManagementGroup - name 'azurerm_management_group' - desc 'Verifies settings for an Azure Management Group' + name "azurerm_management_group" + desc "Verifies settings for an Azure Management Group" example <<-EXAMPLE describe azurerm_management_group(group_id: 'example-group') do it { should exist } @@ -122,11 +122,11 @@ class AzurermManagementGroup < AzureManagementGroup def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureManagementGroup.name) # For backward compatibility. - opts[:api_version] ||= '2018-03-01-preview' + opts[:api_version] ||= "2018-03-01-preview" super end end diff --git a/libraries/azure_management_groups.rb b/libraries/azure_management_groups.rb index 1d4b983b2..d4bfbbff5 100644 --- a/libraries/azure_management_groups.rb +++ b/libraries/azure_management_groups.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureManagementGroups < AzureGenericResources - name 'azure_management_groups' - desc 'Verifies settings for an Azure Management Groups' + name "azure_management_groups" + desc "Verifies settings for an Azure Management Groups" example <<-EXAMPLE describe azure_management_groups do its('names') { should include 'example-group' } @@ -13,9 +13,9 @@ class AzureManagementGroups < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Management/managementGroups', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Management/managementGroups", opts) opts[:resource_uri] = "providers/#{opts[:resource_provider]}" opts[:add_subscription_id] = false @@ -66,8 +66,8 @@ def populate_table # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermManagementGroups < AzureManagementGroups - name 'azurerm_management_groups' - desc 'Verifies settings for an Azure Management Groups' + name "azurerm_management_groups" + desc "Verifies settings for an Azure Management Groups" example <<-EXAMPLE describe azurerm_management_groups do its('names') { should include 'example-group' } @@ -77,10 +77,10 @@ class AzurermManagementGroups < AzureManagementGroups def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureManagementGroups.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2018-03-01-preview' + opts[:api_version] ||= "2018-03-01-preview" super end end diff --git a/libraries/azure_mariadb_server.rb b/libraries/azure_mariadb_server.rb index 21b0258f6..e2c5c5da6 100644 --- a/libraries/azure_mariadb_server.rb +++ b/libraries/azure_mariadb_server.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureMariaDBServer < AzureGenericResource - name 'azure_mariadb_server' - desc 'Verifies settings for an Azure MariaDB Server' + name "azure_mariadb_server" + desc "Verifies settings for an Azure MariaDB Server" example <<-EXAMPLE describe azure_mariadb_server(resource_group: 'rg-1', name: 'my-server-name') do it { should exist } @@ -11,16 +11,16 @@ class AzureMariaDBServer < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.DBforMariaDB/servers', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.DBforMariaDB/servers", opts) opts[:resource_identifiers] = %i(server_name) opts[:allowed_parameters] = %i(firewall_rules_api_version) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) - @opts[:firewall_rules_api_version] ||= 'latest' + @opts[:firewall_rules_api_version] ||= "latest" end def to_s @@ -38,7 +38,7 @@ def firewall_rules return unless exists? additional_resource_properties( { - property_name: 'firewall_rules', + property_name: "firewall_rules", property_endpoint: "#{id}/firewallRules", api_version: @opts[:firewall_rules_api_version], }, @@ -49,8 +49,8 @@ def firewall_rules # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermMariaDBServer < AzureMariaDBServer - name 'azurerm_mariadb_server' - desc 'Verifies settings for an Azure MariaDB Server' + name "azurerm_mariadb_server" + desc "Verifies settings for an Azure MariaDB Server" example <<-EXAMPLE describe azurerm_mariadb_server(resource_group: 'rg-1', server_name: 'my-server-name') do it { should exist } @@ -60,10 +60,10 @@ class AzurermMariaDBServer < AzureMariaDBServer def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureMariaDBServer.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2018-06-01-preview' + opts[:api_version] ||= "2018-06-01-preview" super end end diff --git a/libraries/azure_mariadb_servers.rb b/libraries/azure_mariadb_servers.rb index b96479fd1..5a15c879e 100644 --- a/libraries/azure_mariadb_servers.rb +++ b/libraries/azure_mariadb_servers.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureMariaDBServers < AzureGenericResources - name 'azure_mariadb_servers' - desc 'Verifies settings for a collection of Azure MariaDB Servers' + name "azure_mariadb_servers" + desc "Verifies settings for a collection of Azure MariaDB Servers" example <<-EXAMPLE describe azure_mariadb_servers do its('names') { should include 'mariadb-server' } @@ -13,9 +13,9 @@ class AzureMariaDBServers < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.DBforMariaDB/servers', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.DBforMariaDB/servers", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -49,8 +49,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermMariaDBServers < AzureMariaDBServers - name 'azurerm_mariadb_servers' - desc 'Verifies settings for a collection of Azure MariaDB Servers' + name "azurerm_mariadb_servers" + desc "Verifies settings for a collection of Azure MariaDB Servers" example <<-EXAMPLE describe azurerm_mariadb_servers do its('names') { should include 'mariadb-server' } @@ -60,10 +60,10 @@ class AzurermMariaDBServers < AzureMariaDBServers def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureMariaDBServers.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2018-06-01-preview' + opts[:api_version] ||= "2018-06-01-preview" super end end diff --git a/libraries/azure_microsoft_defender_pricing.rb b/libraries/azure_microsoft_defender_pricing.rb index 118c9df6e..91ee6a3e6 100644 --- a/libraries/azure_microsoft_defender_pricing.rb +++ b/libraries/azure_microsoft_defender_pricing.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureMicrosoftDefenderPricing < AzureGenericResource - name 'azure_microsoft_defender_pricing' - desc 'Retrieves and verifies the settings of an Azure Microsoft Defender Name.' + name "azure_microsoft_defender_pricing" + desc "Retrieves and verifies the settings of an Azure Microsoft Defender Name." example <<-EXAMPLE describe azure_microsoft_defender_pricing(name: 'DEFENDER_PRICING_NAME') do it { should exist } @@ -11,13 +11,13 @@ class AzureMicrosoftDefenderPricing < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) - raise ArgumentError, '`resource_group` is not allowed.' if opts.key(:resource_group) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) + raise ArgumentError, "`resource_group` is not allowed." if opts.key(:resource_group) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Security/pricings', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Security/pricings", opts) opts[:allowed_parameters] = %i(built_in) - opts[:resource_uri] = '/providers/Microsoft.Security/pricings' + opts[:resource_uri] = "/providers/Microsoft.Security/pricings" opts[:add_subscription_id] = opts[:built_in] != true super(opts, true) diff --git a/libraries/azure_microsoft_defender_pricings.rb b/libraries/azure_microsoft_defender_pricings.rb index 15512516f..090a8a30b 100644 --- a/libraries/azure_microsoft_defender_pricings.rb +++ b/libraries/azure_microsoft_defender_pricings.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureMicrosoftDefenderPricings < AzureGenericResources - name 'azure_microsoft_defender_pricings' - desc 'Verifies settings for microsoft defender pricings.' + name "azure_microsoft_defender_pricings" + desc "Verifies settings for microsoft defender pricings." example <<-EXAMPLE describe azure_microsoft_defender_pricings(built_in_only: true) do it { should exist } @@ -12,15 +12,15 @@ class AzureMicrosoftDefenderPricings < AzureGenericResources attr_reader :table def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) - raise ArgumentError, '`resource_group` is not allowed.' if opts.key(:resource_group) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) + raise ArgumentError, "`resource_group` is not allowed." if opts.key(:resource_group) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Security/pricings', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Security/pricings", opts) # `built_in_only` is a resource specific parameter as oppose to the `api_version`. # That's why it should be put in allowed_parameters to be able to pass the parameter validation in the backend. opts[:allowed_parameters] = %i(built_in_only) - opts[:resource_uri] = '/providers/Microsoft.Security/pricings' + opts[:resource_uri] = "/providers/Microsoft.Security/pricings" opts[:add_subscription_id] = opts[:built_in_only] != true # static_resource parameter must be true for setting the resource_provider in the backend. diff --git a/libraries/azure_microsoft_defender_security_contact.rb b/libraries/azure_microsoft_defender_security_contact.rb index a59ec9bfa..dc5f96aac 100644 --- a/libraries/azure_microsoft_defender_security_contact.rb +++ b/libraries/azure_microsoft_defender_security_contact.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureMicrosoftDefenderSecurityContact < AzureGenericResource - name 'azure_microsoft_defender_security_contact' - desc 'Retrieves and verifies the settings of an Azure Microsoft Defender Security Contact.' + name "azure_microsoft_defender_security_contact" + desc "Retrieves and verifies the settings of an Azure Microsoft Defender Security Contact." example <<-EXAMPLE describe azure_microsoft_defender_security_contact(name: 'SECURITY_CONTACT_NAME') do it { should exist } @@ -11,13 +11,13 @@ class AzureMicrosoftDefenderSecurityContact < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) - raise ArgumentError, '`resource_group` is not allowed.' if opts.key(:resource_group) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) + raise ArgumentError, "`resource_group` is not allowed." if opts.key(:resource_group) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Security/securityContacts', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Security/securityContacts", opts) opts[:allowed_parameters] = %i(built_in) - opts[:resource_uri] = '/providers/Microsoft.Security/securityContacts' + opts[:resource_uri] = "/providers/Microsoft.Security/securityContacts" opts[:add_subscription_id] = opts[:built_in] != true super(opts, true) diff --git a/libraries/azure_microsoft_defender_setting.rb b/libraries/azure_microsoft_defender_setting.rb index 21e30eb6c..8f404c1fc 100644 --- a/libraries/azure_microsoft_defender_setting.rb +++ b/libraries/azure_microsoft_defender_setting.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureMicrosoftDefenderSetting < AzureGenericResource - name 'azure_microsoft_defender_setting' - desc 'Retrieves and verifies the settings of an Azure Microsoft Defender Setting.' + name "azure_microsoft_defender_setting" + desc "Retrieves and verifies the settings of an Azure Microsoft Defender Setting." example <<-EXAMPLE describe azure_microsoft_defender_setting(name: 'SETTING_NAME') do it { should exist } @@ -11,13 +11,13 @@ class AzureMicrosoftDefenderSetting < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) - raise ArgumentError, '`resource_group` is not allowed.' if opts.key(:resource_group) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) + raise ArgumentError, "`resource_group` is not allowed." if opts.key(:resource_group) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Security/settings', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Security/settings", opts) opts[:allowed_parameters] = %i(built_in) - opts[:resource_uri] = '/providers/Microsoft.Security/settings' + opts[:resource_uri] = "/providers/Microsoft.Security/settings" opts[:add_subscription_id] = opts[:built_in] != true super(opts, true) diff --git a/libraries/azure_microsoft_defender_settings.rb b/libraries/azure_microsoft_defender_settings.rb index 7cb6e840a..09012129e 100644 --- a/libraries/azure_microsoft_defender_settings.rb +++ b/libraries/azure_microsoft_defender_settings.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureMicrosoftDefenderSettings < AzureGenericResources - name 'azure_microsoft_defender_settings' - desc 'Verifies settings for microsoft defender settings.' + name "azure_microsoft_defender_settings" + desc "Verifies settings for microsoft defender settings." example <<-EXAMPLE describe azure_microsoft_defender_settings do it { should exist } @@ -12,15 +12,15 @@ class AzureMicrosoftDefenderSettings < AzureGenericResources attr_reader :table def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) - raise ArgumentError, '`resource_group` is not allowed.' if opts.key(:resource_group) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) + raise ArgumentError, "`resource_group` is not allowed." if opts.key(:resource_group) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Security/settings', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Security/settings", opts) # `built_in_only` is a resource specific parameter as oppose to the `api_version`. # That's why it should be put in allowed_parameters to be able to pass the parameter validation in the backend. opts[:allowed_parameters] = %i(built_in_only) - opts[:resource_uri] = '/providers/Microsoft.Security/settings' + opts[:resource_uri] = "/providers/Microsoft.Security/settings" opts[:add_subscription_id] = opts[:built_in_only] != true # static_resource parameter must be true for setting the resource_provider in the backend. diff --git a/libraries/azure_migrate_assessment.rb b/libraries/azure_migrate_assessment.rb index 79ffb62be..cf7b820ae 100644 --- a/libraries/azure_migrate_assessment.rb +++ b/libraries/azure_migrate_assessment.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureMigrateAssessment < AzureGenericResource - name 'azure_migrate_assessment' - desc 'Retrieves and verifies the settings of a container group instance.' + name "azure_migrate_assessment" + desc "Retrieves and verifies the settings of a container group instance." example <<-EXAMPLE describe azure_migrate_assessment(resource_group: 'migrated_vms', project_name: 'zoneA_migrate_assessment_project', group_name: 'zoneA_machines_group', name: 'zoneA_machines_migrate_assessment') do it { should exist } @@ -10,11 +10,11 @@ class AzureMigrateAssessment < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Migrate/assessmentProjects', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Migrate/assessmentProjects", opts) opts[:required_parameters] = %i(project_name group_name name) - opts[:resource_path] = [opts[:project_name], 'groups', opts[:group_name], 'assessments'].join('/') + opts[:resource_path] = [opts[:project_name], "groups", opts[:group_name], "assessments"].join("/") super(opts, true) end diff --git a/libraries/azure_migrate_assessment_group.rb b/libraries/azure_migrate_assessment_group.rb index e53d536ab..1280c05ec 100644 --- a/libraries/azure_migrate_assessment_group.rb +++ b/libraries/azure_migrate_assessment_group.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureMigrateAssessmentGroup < AzureGenericResource - name 'azure_migrate_assessment_group' - desc 'Retrieves and verifies the settings of a container group instance.' + name "azure_migrate_assessment_group" + desc "Retrieves and verifies the settings of a container group instance." example <<-EXAMPLE describe azure_migrate_assessment_groups(resource_group: 'migrated_vms', project_name: 'zoneA_migrate_assessment_project', name: 'zoneA_machines_group') do it { should exist } @@ -10,11 +10,11 @@ class AzureMigrateAssessmentGroup < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Migrate/assessmentProjects', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Migrate/assessmentProjects", opts) opts[:required_parameters] = %i(project_name name) - opts[:resource_path] = [opts[:project_name], 'groups'].join('/') + opts[:resource_path] = [opts[:project_name], "groups"].join("/") super(opts, true) end diff --git a/libraries/azure_migrate_assessment_groups.rb b/libraries/azure_migrate_assessment_groups.rb index 8775d6e51..adad89061 100644 --- a/libraries/azure_migrate_assessment_groups.rb +++ b/libraries/azure_migrate_assessment_groups.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureMigrateAssessmentGroups < AzureGenericResources - name 'azure_migrate_assessment_groups' - desc 'Verifies settings for a collection of Azure Migrate Assessment Groups in an Assessment Project' + name "azure_migrate_assessment_groups" + desc "Verifies settings for a collection of Azure Migrate Assessment Groups in an Assessment Project" example <<-EXAMPLE describe azure_migrate_assessment_groups(resource_group: 'migrated_vms', project_name: 'zoneA_migrate_assessment_project') do it { should exist } @@ -10,11 +10,11 @@ class AzureMigrateAssessmentGroups < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Migrate/assessmentProjects', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Migrate/assessmentProjects", opts) opts[:required_parameters] = %i(project_name) - opts[:resource_path] = [opts[:project_name], 'groups'].join('/') + opts[:resource_path] = [opts[:project_name], "groups"].join("/") super(opts, true) return if failed_resource? diff --git a/libraries/azure_migrate_assessment_machine.rb b/libraries/azure_migrate_assessment_machine.rb index cd92a0150..fc4c27269 100644 --- a/libraries/azure_migrate_assessment_machine.rb +++ b/libraries/azure_migrate_assessment_machine.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureMigrateAssessmentMachine < AzureGenericResource - name 'azure_migrate_assessment_machine' - desc 'Verifies settings for a collection of Azure Migrate Assessments in a project' + name "azure_migrate_assessment_machine" + desc "Verifies settings for a collection of Azure Migrate Assessments in a project" example <<-EXAMPLE describe azure_migrate_assessment_machine(resource_group: 'migrated_vms', project_name: 'zoneA_migrate_assessment_project', name: '77ce79088311') do it { should exist } @@ -10,11 +10,11 @@ class AzureMigrateAssessmentMachine < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Migrate/assessmentProjects', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Migrate/assessmentProjects", opts) opts[:required_parameters] = %i(project_name) - opts[:resource_path] = [opts[:project_name], 'machines'].join('/') + opts[:resource_path] = [opts[:project_name], "machines"].join("/") super(opts, true) end diff --git a/libraries/azure_migrate_assessment_machines.rb b/libraries/azure_migrate_assessment_machines.rb index 3bd943298..806f6309e 100644 --- a/libraries/azure_migrate_assessment_machines.rb +++ b/libraries/azure_migrate_assessment_machines.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureMigrateAssessmentMachines < AzureGenericResources - name 'azure_migrate_assessment_machines' - desc 'Verifies settings for a collection of Azure Migrate Assessments in a project' + name "azure_migrate_assessment_machines" + desc "Verifies settings for a collection of Azure Migrate Assessments in a project" example <<-EXAMPLE describe azure_migrate_assessment_machines(resource_group: 'migrated_vms', project_name: 'zoneA_migrate_assessment_project') do it { should exist } @@ -10,10 +10,10 @@ class AzureMigrateAssessmentMachines < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Migrate/assessmentProjects', opts) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Migrate/assessmentProjects", opts) opts[:required_parameters] = %i(project_name) - opts[:resource_path] = [opts[:project_name], 'machines'].join('/') + opts[:resource_path] = [opts[:project_name], "machines"].join("/") super(opts, true) return if failed_resource? diff --git a/libraries/azure_migrate_assessment_project.rb b/libraries/azure_migrate_assessment_project.rb index e1920658d..dc5f0fbd6 100644 --- a/libraries/azure_migrate_assessment_project.rb +++ b/libraries/azure_migrate_assessment_project.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureMigrateAssessmentProject < AzureGenericResource - name 'azure_migrate_assessment_project' - desc 'Retrieves and verifies the settings of a Azure Migrate Assessment Project' + name "azure_migrate_assessment_project" + desc "Retrieves and verifies the settings of a Azure Migrate Assessment Project" example <<-EXAMPLE describe azure_migrate_assessment(resource_group: 'migrated_vms', name: 'zoneA_migrate_assessment_project') do it { should exist } @@ -10,9 +10,9 @@ class AzureMigrateAssessmentProject < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Migrate/assessmentProjects', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Migrate/assessmentProjects", opts) super(opts, true) end diff --git a/libraries/azure_migrate_assessment_projects.rb b/libraries/azure_migrate_assessment_projects.rb index e7100eae3..fa87026c0 100644 --- a/libraries/azure_migrate_assessment_projects.rb +++ b/libraries/azure_migrate_assessment_projects.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureMigrateAssessmentProjects < AzureGenericResources - name 'azure_migrate_assessment_projects' - desc 'Verifies settings for a collection of Azure Migrate Assessment Projects in a subscription' + name "azure_migrate_assessment_projects" + desc "Verifies settings for a collection of Azure Migrate Assessment Projects in a subscription" example <<-EXAMPLE describe azure_migrate_assessment_projects do it { should exist } @@ -10,9 +10,9 @@ class AzureMigrateAssessmentProjects < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Migrate/assessmentProjects', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Migrate/assessmentProjects", opts) super(opts, true) return if failed_resource? diff --git a/libraries/azure_migrate_assessments.rb b/libraries/azure_migrate_assessments.rb index b53a8e704..340915368 100644 --- a/libraries/azure_migrate_assessments.rb +++ b/libraries/azure_migrate_assessments.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureMigrateAssessments < AzureGenericResources - name 'azure_migrate_assessments' - desc 'Verifies settings for a collection of Azure Migrate Assessments in a project' + name "azure_migrate_assessments" + desc "Verifies settings for a collection of Azure Migrate Assessments in a project" example <<-EXAMPLE describe azure_migrate_assessments(resource_group: 'migrated_vms', project_name: 'zoneA_migrate_assessment_project') do it { should exist } @@ -10,10 +10,10 @@ class AzureMigrateAssessments < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Migrate/assessmentProjects', opts) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Migrate/assessmentProjects", opts) opts[:required_parameters] = %i(project_name) - opts[:resource_path] = [opts[:project_name], 'assessments'].join('/') + opts[:resource_path] = [opts[:project_name], "assessments"].join("/") super(opts, true) return if failed_resource? diff --git a/libraries/azure_migrate_project.rb b/libraries/azure_migrate_project.rb index 5f2a3525a..8a2ad85ae 100644 --- a/libraries/azure_migrate_project.rb +++ b/libraries/azure_migrate_project.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureMigrateProject < AzureGenericResource - name 'azure_migrate_project' - desc 'Retrieves and verifies the settings of an Azure Migrate Project.' + name "azure_migrate_project" + desc "Retrieves and verifies the settings of an Azure Migrate Project." example <<-EXAMPLE describe azure_migrate_project(resource_group: 'migrated_vms', name: 'zoneA_migrate_assessment_project') do it { should exist } @@ -10,9 +10,9 @@ class AzureMigrateProject < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Migrate/migrateProjects', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Migrate/migrateProjects", opts) super(opts, true) end diff --git a/libraries/azure_migrate_project_database.rb b/libraries/azure_migrate_project_database.rb index 2d581477a..3443fa798 100644 --- a/libraries/azure_migrate_project_database.rb +++ b/libraries/azure_migrate_project_database.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureMigrateProjectDatabase < AzureGenericResource - name 'azure_migrate_project_database' - desc 'Retrieves and verifies the settings of an Azure Migrate Project Database.' + name "azure_migrate_project_database" + desc "Retrieves and verifies the settings of an Azure Migrate Project Database." example <<-EXAMPLE describe azure_migrate_project_database(resource_group: 'migrated_vms', project_name: 'zoneA_migrate_assessment_project', name: 'sql_db') do it { should exist } @@ -10,11 +10,11 @@ class AzureMigrateProjectDatabase < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Migrate/assessmentProjects', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Migrate/assessmentProjects", opts) opts[:required_parameters] = %i(project_name) - opts[:resource_path] = [opts[:project_name], 'groups'].join('/') + opts[:resource_path] = [opts[:project_name], "groups"].join("/") super(opts, true) assessment_data_hash = properties.assessmentData.each_with_object(Hash.new { |h, k| h[k] = [] }) do |assessment_data, hash| assessment_data.each_pair { |key, value| hash[key.to_s.pluralize.to_sym] << value } diff --git a/libraries/azure_migrate_project_database_instance.rb b/libraries/azure_migrate_project_database_instance.rb index 8f0473b9d..cef8d656d 100644 --- a/libraries/azure_migrate_project_database_instance.rb +++ b/libraries/azure_migrate_project_database_instance.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureMigrateProjectDatabaseInstance < AzureGenericResource - name 'azure_migrate_project_database_instance' - desc 'Retrieves and verifies the settings of an Azure Migrate Project Database.' + name "azure_migrate_project_database_instance" + desc "Retrieves and verifies the settings of an Azure Migrate Project Database." example <<-EXAMPLE describe azure_migrate_project_database_instance(resource_group: 'migrated_vms', project_name: 'zoneA_migrate_assessment_project', name: 'sql_db') do it { should exist } @@ -10,11 +10,11 @@ class AzureMigrateProjectDatabaseInstance < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Migrate/migrateProjects', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Migrate/migrateProjects", opts) opts[:required_parameters] = %i(project_name) - opts[:resource_path] = [opts[:project_name], 'databaseInstances'].join('/') + opts[:resource_path] = [opts[:project_name], "databaseInstances"].join("/") super(opts, true) discovery_data_hash = properties.discoveryData.each_with_object(Hash.new { |h, k| h[k] = [] }) do |discovery_data, hash| discovery_data.each_pair { |key, value| hash[key.to_s.pluralize.to_sym] << value } diff --git a/libraries/azure_migrate_project_database_instances.rb b/libraries/azure_migrate_project_database_instances.rb index 687b1cd87..41c096e33 100644 --- a/libraries/azure_migrate_project_database_instances.rb +++ b/libraries/azure_migrate_project_database_instances.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureMigrateProjectDatabaseInstances < AzureGenericResources - name 'azure_migrate_project_database_instances' - desc 'Verifies settings for a collection of Azure Migrate Project Databases for a Azure Migrate Project in a Resource Group' + name "azure_migrate_project_database_instances" + desc "Verifies settings for a collection of Azure Migrate Project Databases for a Azure Migrate Project in a Resource Group" example <<-EXAMPLE describe azure_migrate_project_database_instances(resource_group: 'migrated_vms', project_name: 'zoneA_migrate_project') do it { should exist } @@ -10,11 +10,11 @@ class AzureMigrateProjectDatabaseInstances < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Migrate/migrateProjects', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Migrate/migrateProjects", opts) opts[:required_parameters] = %i(project_name) - opts[:resource_path] = [opts[:project_name], 'databaseInstances'].join('/') + opts[:resource_path] = [opts[:project_name], "databaseInstances"].join("/") super(opts, true) return if failed_resource? diff --git a/libraries/azure_migrate_project_databases.rb b/libraries/azure_migrate_project_databases.rb index 261565019..d40fa98ae 100644 --- a/libraries/azure_migrate_project_databases.rb +++ b/libraries/azure_migrate_project_databases.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureMigrateProjectDatabases < AzureGenericResources - name 'azure_migrate_project_databases' - desc 'Verifies settings for a collection of Azure Migrate Project Databases for a Azure Migrate Project in a Resource Group' + name "azure_migrate_project_databases" + desc "Verifies settings for a collection of Azure Migrate Project Databases for a Azure Migrate Project in a Resource Group" example <<-EXAMPLE describe azure_migrate_project_databases(resource_group: 'migrated_vms', project_name: 'zoneA_migrate_project') do it { should exist } @@ -10,11 +10,11 @@ class AzureMigrateProjectDatabases < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Migrate/migrateProjects', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Migrate/migrateProjects", opts) opts[:required_parameters] = %i(project_name) - opts[:resource_path] = [opts[:project_name], 'databases'].join('/') + opts[:resource_path] = [opts[:project_name], "databases"].join("/") super(opts, true) return if failed_resource? diff --git a/libraries/azure_migrate_project_event.rb b/libraries/azure_migrate_project_event.rb index 7231bd864..d539c1894 100644 --- a/libraries/azure_migrate_project_event.rb +++ b/libraries/azure_migrate_project_event.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureMigrateProjectEvent < AzureGenericResource - name 'azure_migrate_project_event' - desc 'Retrieves and verifies the settings of an Azure Migrate Project Machine.' + name "azure_migrate_project_event" + desc "Retrieves and verifies the settings of an Azure Migrate Project Machine." example <<-EXAMPLE describe azure_migrate_project_event(resource_group: 'migrate_vms', project_name: 'zoneA_migrate_project', name: 'MigrateEvent01') do it { should exist } @@ -10,11 +10,11 @@ class AzureMigrateProjectEvent < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Migrate/migrateProjects', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Migrate/migrateProjects", opts) opts[:required_parameters] = %i(project_name) - opts[:resource_path] = [opts[:project_name], 'migrateEvents'].join('/') + opts[:resource_path] = [opts[:project_name], "migrateEvents"].join("/") super(opts, true) end diff --git a/libraries/azure_migrate_project_events.rb b/libraries/azure_migrate_project_events.rb index 56bd2aeb5..0961240de 100644 --- a/libraries/azure_migrate_project_events.rb +++ b/libraries/azure_migrate_project_events.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureMigrateProjectEvents < AzureGenericResources - name 'azure_migrate_project_events' - desc 'Verifies settings for a collection of Azure Migrate Project Events for a Azure Migrate Project in a Resource Group' + name "azure_migrate_project_events" + desc "Verifies settings for a collection of Azure Migrate Project Events for a Azure Migrate Project in a Resource Group" example <<-EXAMPLE describe azure_migrate_project_events(resource_group: 'migrated_vms', project_name: 'zoneA_migrate_project') do it { should exist } @@ -10,11 +10,11 @@ class AzureMigrateProjectEvents < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Migrate/migrateProjects', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Migrate/migrateProjects", opts) opts[:required_parameters] = %i(project_name) - opts[:resource_path] = [opts[:project_name], 'migrateEvents'].join('/') + opts[:resource_path] = [opts[:project_name], "migrateEvents"].join("/") super(opts, true) return if failed_resource? diff --git a/libraries/azure_migrate_project_machine.rb b/libraries/azure_migrate_project_machine.rb index f70371640..cf32586e3 100644 --- a/libraries/azure_migrate_project_machine.rb +++ b/libraries/azure_migrate_project_machine.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureMigrateProjectMachine < AzureGenericResource - name 'azure_migrate_project_machine' - desc 'Retrieves and verifies the settings of an Azure Migrate Project Machine.' + name "azure_migrate_project_machine" + desc "Retrieves and verifies the settings of an Azure Migrate Project Machine." example <<-EXAMPLE describe azure_migrate_project_machine(resource_group: 'migrate_vms', project_name: 'zoneA_migrate_project', name: 'c042be9e-3d93-42cf-917f-b92c68318ded') do it { should exist } @@ -10,11 +10,11 @@ class AzureMigrateProjectMachine < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Migrate/migrateProjects', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Migrate/migrateProjects", opts) opts[:required_parameters] = %i(project_name) - opts[:resource_path] = [opts[:project_name], 'machines'].join('/') + opts[:resource_path] = [opts[:project_name], "machines"].join("/") super(opts, true) end diff --git a/libraries/azure_migrate_project_machines.rb b/libraries/azure_migrate_project_machines.rb index 66a7acf08..424731c17 100644 --- a/libraries/azure_migrate_project_machines.rb +++ b/libraries/azure_migrate_project_machines.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureMigrateProjectMachines < AzureGenericResources - name 'azure_migrate_project_machines' - desc 'Verifies settings for a collection of Azure Migrate Project Machines for a Azure Migrate Project in a Resource Group' + name "azure_migrate_project_machines" + desc "Verifies settings for a collection of Azure Migrate Project Machines for a Azure Migrate Project in a Resource Group" example <<-EXAMPLE describe azure_migrate_project_machines(resource_group: 'migrated_vms', project_name: 'zoneA_migrate_project') do it { should exist } @@ -10,11 +10,11 @@ class AzureMigrateProjectMachines < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Migrate/migrateProjects', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Migrate/migrateProjects", opts) opts[:required_parameters] = %i(project_name) - opts[:resource_path] = [opts[:project_name], 'machines'].join('/') + opts[:resource_path] = [opts[:project_name], "machines"].join("/") super(opts, true) return if failed_resource? diff --git a/libraries/azure_migrate_project_solution.rb b/libraries/azure_migrate_project_solution.rb index b810d88b2..3cdc80c39 100644 --- a/libraries/azure_migrate_project_solution.rb +++ b/libraries/azure_migrate_project_solution.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureMigrateProjectSolution < AzureGenericResource - name 'azure_migrate_project_solution' - desc 'Retrieves and verifies the settings of an Azure Migrate Project Solution' + name "azure_migrate_project_solution" + desc "Retrieves and verifies the settings of an Azure Migrate Project Solution" example <<-EXAMPLE describe azure_migrate_project_solution(resource_group: 'migrated_vms', project_name: 'zoneA_migrate_project', name: 'zoneA_machines_migrate_solution') do it { should exist } @@ -10,11 +10,11 @@ class AzureMigrateProjectSolution < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Migrate/migrateProjects', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Migrate/migrateProjects", opts) opts[:required_parameters] = %i(project_name) - opts[:resource_path] = [opts[:project_name], 'solutions'].join('/') + opts[:resource_path] = [opts[:project_name], "solutions"].join("/") super(opts, true) end diff --git a/libraries/azure_migrate_project_solutions.rb b/libraries/azure_migrate_project_solutions.rb index 8ef5bc90f..c1c96c68d 100644 --- a/libraries/azure_migrate_project_solutions.rb +++ b/libraries/azure_migrate_project_solutions.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureMigrateProjectSolutions < AzureGenericResources - name 'azure_migrate_project_solutions' - desc 'Verifies settings for a collection of Azure Migrate Project Solutions for a Azure Migrate Project in a Resource Group' + name "azure_migrate_project_solutions" + desc "Verifies settings for a collection of Azure Migrate Project Solutions for a Azure Migrate Project in a Resource Group" example <<-EXAMPLE describe azure_migrate_project_solutions(resource_group: 'migrated_vms', project_name: 'zoneA_migrate_project') do it { should exist } @@ -10,11 +10,11 @@ class AzureMigrateProjectSolutions < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Migrate/migrateProjects', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Migrate/migrateProjects", opts) opts[:required_parameters] = %i(project_name) - opts[:resource_path] = [opts[:project_name], 'solutions'].join('/') + opts[:resource_path] = [opts[:project_name], "solutions"].join("/") super(opts, true) return if failed_resource? diff --git a/libraries/azure_monitor_activity_log_alert.rb b/libraries/azure_monitor_activity_log_alert.rb index 6bd447167..20fcffb63 100644 --- a/libraries/azure_monitor_activity_log_alert.rb +++ b/libraries/azure_monitor_activity_log_alert.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureMonitorActivityLogAlert < AzureGenericResource - name 'azure_monitor_activity_log_alert' - desc 'Verifies settings for a Azure Monitor Activity Log Alert' + name "azure_monitor_activity_log_alert" + desc "Verifies settings for a Azure Monitor Activity Log Alert" example <<-EXAMPLE describe azure_monitor_activity_log_alert(resource_group: 'example', name: 'AlertName') do it { should exist } @@ -12,13 +12,13 @@ class AzureMonitorActivityLogAlert < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Insights/activityLogAlerts', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Insights/activityLogAlerts", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) - properties&.scopes&.map { |scope| scope.delete_suffix!('/') } + properties&.scopes&.map { |scope| scope.delete_suffix!("/") } end def conditions @@ -28,7 +28,7 @@ def conditions def operations return unless exists? - conditions&.select { |x| x.field == 'operationName' }&.collect(&:equals) + conditions&.select { |x| x.field == "operationName" }&.collect(&:equals) end def scopes @@ -49,8 +49,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermMonitorActivityLogAlert < AzureMonitorActivityLogAlert - name 'azurerm_monitor_activity_log_alert' - desc 'Verifies settings for a Azure Monitor Activity Log Alert' + name "azurerm_monitor_activity_log_alert" + desc "Verifies settings for a Azure Monitor Activity Log Alert" example <<-EXAMPLE describe azurerm_monitor_activity_log_alert(resource_group: 'example', name: 'AlertName') do it { should exist } @@ -61,10 +61,10 @@ class AzurermMonitorActivityLogAlert < AzureMonitorActivityLogAlert def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureMonitorActivityLogAlert.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2017-04-01' + opts[:api_version] ||= "2017-04-01" super end end diff --git a/libraries/azure_monitor_activity_log_alerts.rb b/libraries/azure_monitor_activity_log_alerts.rb index 2c52372d6..36433224e 100644 --- a/libraries/azure_monitor_activity_log_alerts.rb +++ b/libraries/azure_monitor_activity_log_alerts.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureMonitorActivityLogAlerts < AzureGenericResources - name 'azure_monitor_activity_log_alerts' - desc 'Verifies settings for Azure Monitor Activity Log Alerts' + name "azure_monitor_activity_log_alerts" + desc "Verifies settings for Azure Monitor Activity Log Alerts" example <<-EXAMPLE describe azure_monitor_activity_log_alerts do its('names') { should include('example-log-alert') } @@ -13,9 +13,9 @@ class AzureMonitorActivityLogAlerts < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Insights/activityLogAlerts', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Insights/activityLogAlerts", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -52,7 +52,7 @@ def populate_table return [] if @resources.empty? @resources.each do |resource| operations = resource[:properties].dig(:condition, :allOf) - &.select { |alert| alert[:field] == 'operationName' }&.collect { |al| al[:equals] } + &.select { |alert| alert[:field] == "operationName" }&.collect { |al| al[:equals] } resource_group, _provider, _r_type = Helpers.res_group_provider_type_from_uri(resource[:id]) @table << { id: resource[:id], @@ -69,8 +69,8 @@ def populate_table # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermMonitorActivityLogAlerts < AzureMonitorActivityLogAlerts - name 'azurerm_monitor_activity_log_alerts' - desc 'Verifies settings for Azure Monitor Activity Log Alerts' + name "azurerm_monitor_activity_log_alerts" + desc "Verifies settings for Azure Monitor Activity Log Alerts" example <<-EXAMPLE describe azurerm_monitor_activity_log_alerts do its('names') { should include('example-log-alert') } @@ -80,10 +80,10 @@ class AzurermMonitorActivityLogAlerts < AzureMonitorActivityLogAlerts def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureMonitorActivityLogAlerts.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2017-04-01' + opts[:api_version] ||= "2017-04-01" super end end diff --git a/libraries/azure_monitor_log_profile.rb b/libraries/azure_monitor_log_profile.rb index 700fbd96d..4e0be8997 100644 --- a/libraries/azure_monitor_log_profile.rb +++ b/libraries/azure_monitor_log_profile.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureMonitorLogProfile < AzureGenericResource - name 'azure_monitor_log_profile' - desc 'Verifies settings for a Azure Monitor Log Profile' + name "azure_monitor_log_profile" + desc "Verifies settings for a Azure Monitor Log Profile" example <<-EXAMPLE describe azure_monitor_log_profile(name: 'default') do it { should exist } @@ -13,11 +13,11 @@ class AzureMonitorLogProfile < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Insights/logProfiles', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Insights/logProfiles", opts) # See azure_policy_definition for more info on the usage of `resource_uri` parameter. - opts[:resource_uri] = '/providers/microsoft.insights/logprofiles/' + opts[:resource_uri] = "/providers/microsoft.insights/logprofiles/" opts[:add_subscription_id] = true opts[:display_name] = "#{opts[:name]} Log Profile" @@ -53,15 +53,15 @@ def storage_account return unless exists? sa = properties.storageAccountId resource_group, _provider, _r_type = Helpers.res_group_provider_type_from_uri(sa) - { name: sa.split('/').last, resource_group: resource_group } + { name: sa.split("/").last, resource_group: resource_group } end end # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermMonitorLogProfile < AzureMonitorLogProfile - name 'azurerm_monitor_log_profile' - desc 'Verifies settings for a Azure Monitor Log Profile' + name "azurerm_monitor_log_profile" + desc "Verifies settings for a Azure Monitor Log Profile" example <<-EXAMPLE describe azurerm_monitor_log_profile(name: 'default') do it { should exist } @@ -73,10 +73,10 @@ class AzurermMonitorLogProfile < AzureMonitorLogProfile def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureMonitorLogProfile.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2016-03-01' + opts[:api_version] ||= "2016-03-01" super end end diff --git a/libraries/azure_monitor_log_profiles.rb b/libraries/azure_monitor_log_profiles.rb index 035d405f0..7d1958230 100644 --- a/libraries/azure_monitor_log_profiles.rb +++ b/libraries/azure_monitor_log_profiles.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureMonitorLogProfiles < AzureGenericResources - name 'azure_monitor_log_profiles' - desc 'Fetches all Azure Monitor Log Profiles' + name "azure_monitor_log_profiles" + desc "Fetches all Azure Monitor Log Profiles" example <<-EXAMPLE describe azure_monitor_log_profiles do its('names') { should include('default') } @@ -13,11 +13,11 @@ class AzureMonitorLogProfiles < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Insights/logProfiles', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Insights/logProfiles", opts) # See azure_policy_definition for more info on the usage of `resource_uri` parameter. - opts[:resource_uri] = '/providers/Microsoft.Insights/logProfiles' + opts[:resource_uri] = "/providers/Microsoft.Insights/logProfiles" opts[:add_subscription_id] = true # static_resource parameter must be true for setting the resource_provider in the backend. @@ -47,8 +47,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermMonitorLogProfiles < AzureMonitorLogProfiles - name 'azurerm_monitor_log_profiles' - desc 'Fetches all Azure Monitor Log Profiles' + name "azurerm_monitor_log_profiles" + desc "Fetches all Azure Monitor Log Profiles" example <<-EXAMPLE describe azurerm_monitor_log_profiles do its('names') { should include('default') } @@ -58,10 +58,10 @@ class AzurermMonitorLogProfiles < AzureMonitorLogProfiles def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureMonitorLogProfiles.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2016-03-01' + opts[:api_version] ||= "2016-03-01" super end end diff --git a/libraries/azure_mysql_database.rb b/libraries/azure_mysql_database.rb index 8842805c0..a055ecfc8 100644 --- a/libraries/azure_mysql_database.rb +++ b/libraries/azure_mysql_database.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureMySqlDatabase < AzureGenericResource - name 'azure_mysql_database' - desc 'Verifies settings for an Azure MySQL Database' + name "azure_mysql_database" + desc "Verifies settings for an Azure MySQL Database" example <<-EXAMPLE describe azure_mysql_database(resource_group: 'rg-1', server_name: 'mysql-server-1' name: 'customer-db') do it { should exist } @@ -11,11 +11,11 @@ class AzureMySqlDatabase < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.DBforMySQL/servers', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.DBforMySQL/servers", opts) opts[:required_parameters] = %i(server_name) - opts[:resource_path] = [opts[:server_name], 'databases'].join('/') + opts[:resource_path] = [opts[:server_name], "databases"].join("/") opts[:resource_identifiers] = %i(database_name) # static_resource parameter must be true for setting the resource_provider in the backend. @@ -30,8 +30,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermMySqlDatabase < AzureMySqlDatabase - name 'azurerm_mysql_database' - desc 'Verifies settings for an Azure MySQL Database' + name "azurerm_mysql_database" + desc "Verifies settings for an Azure MySQL Database" example <<-EXAMPLE describe azurerm_mysql_database(resource_group: 'rg-1', server_name: 'mysql-server-1' database_name: 'customer-db') do it { should exist } @@ -41,10 +41,10 @@ class AzurermMySqlDatabase < AzureMySqlDatabase def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureMySqlDatabase.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2017-12-01' + opts[:api_version] ||= "2017-12-01" super end end diff --git a/libraries/azure_mysql_database_configuration.rb b/libraries/azure_mysql_database_configuration.rb index 338e7eb19..851759edd 100644 --- a/libraries/azure_mysql_database_configuration.rb +++ b/libraries/azure_mysql_database_configuration.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureMySqlDatabaseConfiguration < AzureGenericResource - name 'azure_mysql_database_configuration' - desc 'Verifies settings for an Azure MySQL Database Configuration.' + name "azure_mysql_database_configuration" + desc "Verifies settings for an Azure MySQL Database Configuration." example <<-EXAMPLE describe azure_mysql_database_configuration(resource_group: 'rg-1', server_name: 'mysql-server-1', name: 'configuration-name') do it { should exist } @@ -11,11 +11,11 @@ class AzureMySqlDatabaseConfiguration < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.DBforMySQL/servers', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.DBforMySQL/servers", opts) opts[:required_parameters] = %i(server_name) - opts[:resource_path] = [opts[:server_name], 'configurations'].join('/') + opts[:resource_path] = [opts[:server_name], "configurations"].join("/") opts[:resource_identifiers] = %i(configuration_name) # static_resource parameter must be true for setting the resource_provider in the backend. diff --git a/libraries/azure_mysql_database_configurations.rb b/libraries/azure_mysql_database_configurations.rb index 004c5513a..bd330d6fc 100644 --- a/libraries/azure_mysql_database_configurations.rb +++ b/libraries/azure_mysql_database_configurations.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureMySqlDatabaseConfigurations < AzureGenericResources - name 'azure_mysql_database_configurations' - desc 'Verifies settings for an Azure MySQL Database Configurations.' + name "azure_mysql_database_configurations" + desc "Verifies settings for an Azure MySQL Database Configurations." example <<-EXAMPLE describe azure_mysql_database_configurations(resource_group: 'my-rg', server_name: 'server-1') do it { should exist } @@ -14,13 +14,13 @@ class AzureMySqlDatabaseConfigurations < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.DBforMySQL/servers', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.DBforMySQL/servers", opts) opts[:required_parameters] = %i(resource_group server_name) # Unless provided here, a generic display name will be created in the backend. opts[:display_name] = "Configurations on #{opts[:server_name]} MySQL Server:" - opts[:resource_path] = [opts[:server_name], 'configurations'].join('/') + opts[:resource_path] = [opts[:server_name], "configurations"].join("/") # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) diff --git a/libraries/azure_mysql_databases.rb b/libraries/azure_mysql_databases.rb index 87c68a3d3..c680252d4 100644 --- a/libraries/azure_mysql_databases.rb +++ b/libraries/azure_mysql_databases.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureMySqlDatabases < AzureGenericResources - name 'azure_mysql_databases' - desc 'Verifies settings for a collection of Azure MySQL Databases on a MySQL Server' + name "azure_mysql_databases" + desc "Verifies settings for a collection of Azure MySQL Databases on a MySQL Server" example <<-EXAMPLE describe azure_mysql_databases(resource_group: 'my-rg', server_name: 'server-1') do it { should exist } @@ -14,13 +14,13 @@ class AzureMySqlDatabases < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.DBforMySQL/servers', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.DBforMySQL/servers", opts) opts[:required_parameters] = %i(resource_group server_name) # Unless provided here, a generic display name will be created in the backend. opts[:display_name] = "Databases on #{opts[:server_name]} MySQL Server" - opts[:resource_path] = [opts[:server_name], 'databases'].join('/') + opts[:resource_path] = [opts[:server_name], "databases"].join("/") # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -52,8 +52,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermMySqlDatabases < AzureMySqlDatabases - name 'azurerm_mysql_databases' - desc 'Verifies settings for a collection of Azure MySQL Databases on a MySQL Server' + name "azurerm_mysql_databases" + desc "Verifies settings for a collection of Azure MySQL Databases on a MySQL Server" example <<-EXAMPLE describe azurerm_mysql_databases(resource_group: 'my-rg', server_name: 'server-1') do it { should exist } @@ -64,10 +64,10 @@ class AzurermMySqlDatabases < AzureMySqlDatabases def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureMySqlDatabases.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2017-12-01' + opts[:api_version] ||= "2017-12-01" super end end diff --git a/libraries/azure_mysql_server.rb b/libraries/azure_mysql_server.rb index f5ddae4d7..f2330223a 100644 --- a/libraries/azure_mysql_server.rb +++ b/libraries/azure_mysql_server.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureMysqlServer < AzureGenericResource - name 'azure_mysql_server' - desc 'Verifies settings for an Azure My SQL Server' + name "azure_mysql_server" + desc "Verifies settings for an Azure My SQL Server" example <<-EXAMPLE describe azurerm_mysql_server(resource_group: 'example', server_name: 'vm-name') do it { should have_monitoring_agent_installed } @@ -11,7 +11,7 @@ class AzureMysqlServer < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Azure REST API endpoint URL format for the resource: # GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/ @@ -43,14 +43,14 @@ def initialize(opts = {}) # not to accept a different `resource_provider`. # # `resource_provider` has to be defined first since it does the first validation on user-supplied input. - opts[:resource_provider] = specific_resource_constraint('Microsoft.DBforMySQL/servers', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.DBforMySQL/servers", opts) opts[:resource_identifiers] = %i(server_name) opts[:allowed_parameters] = %i(firewall_rules_api_version) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) - @opts[:firewall_rules_api_version] ||= 'latest' + @opts[:firewall_rules_api_version] ||= "latest" end def to_s @@ -72,7 +72,7 @@ def firewall_rules return unless exists? additional_resource_properties( { - property_name: 'firewall_rules', + property_name: "firewall_rules", property_endpoint: "#{id}/firewallRules", api_version: @opts[:firewall_rules_api_version], }, @@ -83,8 +83,8 @@ def firewall_rules # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermMysqlServer < AzureMysqlServer - name 'azurerm_mysql_server' - desc 'Verifies settings for an Azure My SQL Server' + name "azurerm_mysql_server" + desc "Verifies settings for an Azure My SQL Server" example <<-EXAMPLE describe azurerm_mysql_server(resource_group: 'example', server_name: 'vm-name') do it { should have_monitoring_agent_installed } @@ -94,10 +94,10 @@ class AzurermMysqlServer < AzureMysqlServer def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureMysqlServer.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2017-12-01' + opts[:api_version] ||= "2017-12-01" super end end diff --git a/libraries/azure_mysql_servers.rb b/libraries/azure_mysql_servers.rb index 2e37225f1..0805fcf32 100644 --- a/libraries/azure_mysql_servers.rb +++ b/libraries/azure_mysql_servers.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureMysqlServers < AzureGenericResources - name 'azure_mysql_servers' - desc 'Verifies settings for a collection of Azure MySQL Servers' + name "azure_mysql_servers" + desc "Verifies settings for a collection of Azure MySQL Servers" example <<-EXAMPLE describe azurerm_mysql_servers do its('names') { should include 'my-sql-server' } @@ -13,7 +13,7 @@ class AzureMysqlServers < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Azure REST API endpoint URL format listing the all resources for a given subscription: # GET https://management.azure.com/subscriptions/{subscriptionId}/providers/ @@ -43,7 +43,7 @@ def initialize(opts = {}) # The `specific_resource_constraint` method will validate the user input # not to accept a different `resource_provider`. # - opts[:resource_provider] = specific_resource_constraint('Microsoft.DBforMySQL/servers', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.DBforMySQL/servers", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -77,8 +77,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermMysqlServers < AzureMysqlServers - name 'azurerm_mysql_servers' - desc 'Verifies settings for a collection of Azure MySQL Servers' + name "azurerm_mysql_servers" + desc "Verifies settings for a collection of Azure MySQL Servers" example <<-EXAMPLE describe azurerm_mysql_servers do its('names') { should include 'my-sql-server' } @@ -88,10 +88,10 @@ class AzurermMysqlServers < AzureMysqlServers def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureMysqlServers.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2017-12-01' + opts[:api_version] ||= "2017-12-01" super end end diff --git a/libraries/azure_network_interface.rb b/libraries/azure_network_interface.rb index 19d56c44c..16615c0da 100644 --- a/libraries/azure_network_interface.rb +++ b/libraries/azure_network_interface.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureNetworkInterface < AzureGenericResource - name 'azure_network_interface' - desc 'Verifies settings for an Azure Network Interface' + name "azure_network_interface" + desc "Verifies settings for an Azure Network Interface" example <<-EXAMPLE describe azure_network_interface(resource_group: 'rg-1', name: 'my-nic-name') do it { should exist } @@ -11,9 +11,9 @@ class AzureNetworkInterface < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/networkInterfaces', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/networkInterfaces", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -69,8 +69,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermNetworkInterface < AzureNetworkInterface - name 'azurerm_network_interface' - desc 'Verifies settings for an Azure Network Interface' + name "azurerm_network_interface" + desc "Verifies settings for an Azure Network Interface" example <<-EXAMPLE describe azurerm_network_interface(resource_group: 'rg-1', name: 'my-nic-name') do it { should exist } @@ -80,10 +80,10 @@ class AzurermNetworkInterface < AzureNetworkInterface def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureNetworkInterface.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2018-11-01' + opts[:api_version] ||= "2018-11-01" super end end diff --git a/libraries/azure_network_interfaces.rb b/libraries/azure_network_interfaces.rb index e86e79c85..04b005f57 100644 --- a/libraries/azure_network_interfaces.rb +++ b/libraries/azure_network_interfaces.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureNetworkInterfaces < AzureGenericResources - name 'azure_network_interfaces' - desc 'Verifies settings for a collection of Azure Network Interfaces' + name "azure_network_interfaces" + desc "Verifies settings for a collection of Azure Network Interfaces" example <<-EXAMPLE describe azure_network_interfaces do it { should exist } @@ -13,9 +13,9 @@ class AzureNetworkInterfaces < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/networkInterfaces', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/networkInterfaces", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -48,8 +48,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermNetworkInterfaces < AzureNetworkInterfaces - name 'azurerm_network_interfaces' - desc 'Verifies settings for a collection of Azure Network Interfaces' + name "azurerm_network_interfaces" + desc "Verifies settings for a collection of Azure Network Interfaces" example <<-EXAMPLE describe azurerm_network_interfaces do it { should exist } @@ -59,10 +59,10 @@ class AzurermNetworkInterfaces < AzureNetworkInterfaces def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureNetworkInterfaces.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2018-11-01' + opts[:api_version] ||= "2018-11-01" super end end diff --git a/libraries/azure_network_security_group.rb b/libraries/azure_network_security_group.rb index 702af4b65..b3c16b1d8 100644 --- a/libraries/azure_network_security_group.rb +++ b/libraries/azure_network_security_group.rb @@ -1,10 +1,10 @@ -require 'azure_generic_resource' -require 'backend/azure_security_rules_helpers' -require 'rspec/expectations' +require "azure_generic_resource" +require "backend/azure_security_rules_helpers" +require "rspec/expectations" class AzureNetworkSecurityGroup < AzureGenericResource - name 'azure_network_security_group' - desc 'Verifies settings for Network Security Groups' + name "azure_network_security_group" + desc "Verifies settings for Network Security Groups" example <<-EXAMPLE describe azure_network_security_group(resource_group: 'example', name: 'name') do its(name) { should eq 'name'} @@ -13,7 +13,7 @@ class AzureNetworkSecurityGroup < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby error will be raised. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Azure REST API endpoint URL format for the resource: # GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/ @@ -44,7 +44,7 @@ def initialize(opts = {}) # The `specific_resource_constraint` method will validate the user input # not to accept a different `resource_provider`. # - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/networkSecurityGroups', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/networkSecurityGroups", opts) opts[:allowed_parameters] = %i(resource_data) # static_resource parameter must be true for setting the resource_provider in the backend. @@ -59,19 +59,19 @@ def to_s # `return unless exists?` is necessary to prevent any unforeseen Ruby error. def inbound_rules - @inbound_rules ||= normalized_security_rules.one_direction_rules('inbound') + @inbound_rules ||= normalized_security_rules.one_direction_rules("inbound") end def outbound_rules - @outbound_rules ||= normalized_security_rules.one_direction_rules('outbound') + @outbound_rules ||= normalized_security_rules.one_direction_rules("outbound") end def allow_rules - @allow_rules ||= normalized_security_rules.access_type_rules('allow') + @allow_rules ||= normalized_security_rules.access_type_rules("allow") end def deny_rules - @deny_rules ||= normalized_security_rules.access_type_rules('deny') + @deny_rules ||= normalized_security_rules.access_type_rules("deny") end # @example @@ -82,8 +82,8 @@ def deny_rules # it { should allow(source_ip_range: '0:0:0:0:0:ffff:a05:0', direction: 'inbound') } def allow?(criteria = {}) Validators.validate_params_required(@__resource_name__, %i(direction), criteria) - criteria[:access] = 'allow' - rules = criteria[:direction] == 'inbound' ? inbound_rules : outbound_rules + criteria[:access] = "allow" + rules = criteria[:direction] == "inbound" ? inbound_rules : outbound_rules normalized_security_rules.go_compare(rules, criteria) end RSpec::Matchers.alias_matcher :allow, :be_allow @@ -99,7 +99,7 @@ def allow_in?(criteria) criteria[:source_service_tag] = criteria[:service_tag] if criteria.key?(:service_tag) criteria[:destination_port] = criteria[:port] if criteria.key?(:port) %i(ip_range port service_tag).each { |k| criteria.delete(k) } - criteria[:direction] = 'inbound' + criteria[:direction] = "inbound" allow?(criteria) end RSpec::Matchers.alias_matcher :allow_in, :be_allow_in @@ -112,7 +112,7 @@ def allow_out?(criteria) criteria[:destination_service_tag] = criteria[:service_tag] if criteria.key?(:service_tag) criteria[:destination_port] = criteria[:port] if criteria.key?(port) %i(ip_range port service_tag).each { |k| criteria.delete(k) } - criteria[:direction] = 'outbound' + criteria[:direction] = "outbound" allow?(criteria) end RSpec::Matchers.alias_matcher :allow_out, :be_allow_out @@ -142,19 +142,19 @@ def default_security_rules def allow_ssh_from_internet? return unless exists? - allow_port_from_internet?('22') + allow_port_from_internet?("22") end RSpec::Matchers.alias_matcher :allow_ssh_from_internet, :be_allow_ssh_from_internet def allow_rdp_from_internet? return unless exists? - allow_port_from_internet?('3389') + allow_port_from_internet?("3389") end RSpec::Matchers.alias_matcher :allow_rdp_from_internet, :be_allow_rdp_from_internet def allow_udp_from_internet? return unless exists? - allow_port_from_internet?('53') + allow_port_from_internet?("53") end RSpec::Matchers.alias_matcher :allow_udp_from_internet, :be_allow_udp_from_internet @@ -162,7 +162,7 @@ def allow_udp_from_internet? def allow_http_from_internet? return unless exists? - allow_port_from_internet?('80') + allow_port_from_internet?("80") end RSpec::Matchers.alias_matcher :allow_http_from_internet, :be_allow_http_from_internet @@ -199,9 +199,9 @@ def destination_port_ranges(properties) def matches_port?(ports, match_port) return true if ports.detect { |p| p =~ /^(#{match_port}|\*)$/ } - ports.select { |port| port.include?('-') } - .collect { |range| range.split('-') } - .any? { |range| (range.first.to_i..range.last.to_i).cover?(match_port.to_i) } + ports.select { |port| port.include?("-") } + .collect { |range| range.split("-") } + .any? { |range| (range.first.to_i..range.last.to_i).cover?(match_port.to_i) } end def tcp?(properties) @@ -209,7 +209,7 @@ def tcp?(properties) end def access_allow?(properties) - properties.access == 'Allow' + properties.access == "Allow" end def source_open?(properties) @@ -218,12 +218,12 @@ def source_open?(properties) return properties.sourceAddressPrefix =~ %r{\*|^0\.0\.0\.0|/0|/0|Internet|any} end if properties_hash.include?(:sourceAddressPrefixes) - properties.sourceAddressPrefixes.include?('0.0.0.0') + properties.sourceAddressPrefixes.include?("0.0.0.0") end end def direction_inbound?(properties) - properties.direction == 'Inbound' + properties.direction == "Inbound" end def not_icmp?(properties) @@ -240,8 +240,8 @@ def get_resource(opts = {}) # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermNetworkSecurityGroup < AzureNetworkSecurityGroup - name 'azurerm_network_security_group' - desc 'Verifies settings for Network Security Groups' + name "azurerm_network_security_group" + desc "Verifies settings for Network Security Groups" example <<-EXAMPLE describe azurerm_network_security_group(resource_group: 'example', name: 'name') do its(name) { should eq 'name'} @@ -251,10 +251,10 @@ class AzurermNetworkSecurityGroup < AzureNetworkSecurityGroup def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureNetworkSecurityGroup.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2018-02-01' + opts[:api_version] ||= "2018-02-01" super end end diff --git a/libraries/azure_network_security_groups.rb b/libraries/azure_network_security_groups.rb index 2b279c1bc..502967176 100644 --- a/libraries/azure_network_security_groups.rb +++ b/libraries/azure_network_security_groups.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureNetworkSecurityGroups < AzureGenericResources - name 'azure_network_security_groups' - desc 'Verifies settings for Network Security Groups' + name "azure_network_security_groups" + desc "Verifies settings for Network Security Groups" example <<-EXAMPLE azure_network_security_groups(resource_group: 'example') do it{ should exist } @@ -13,7 +13,7 @@ class AzureNetworkSecurityGroups < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Azure REST API endpoint URL format listing the all resources for a given subscription: # GET https://management.azure.com/subscriptions/{subscriptionId}/providers/ @@ -43,7 +43,7 @@ def initialize(opts = {}) # The `specific_resource_constraint` method will validate the user input # not to accept a different `resource_provider`. # - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/networkSecurityGroups', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/networkSecurityGroups", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -63,8 +63,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermNetworkSecurityGroups < AzureNetworkSecurityGroups - name 'azurerm_network_security_groups' - desc 'Verifies settings for Network Security Groups' + name "azurerm_network_security_groups" + desc "Verifies settings for Network Security Groups" example <<-EXAMPLE azurerm_network_security_groups(resource_group: 'example') do it{ should exist } @@ -74,10 +74,10 @@ class AzurermNetworkSecurityGroups < AzureNetworkSecurityGroups def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureNetworkSecurityGroups.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2018-02-01' + opts[:api_version] ||= "2018-02-01" super end end diff --git a/libraries/azure_network_watcher.rb b/libraries/azure_network_watcher.rb index cee71bda9..78c2644d1 100644 --- a/libraries/azure_network_watcher.rb +++ b/libraries/azure_network_watcher.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureNetworkWatcher < AzureGenericResource - name 'azure_network_watcher' - desc 'Verifies settings for Network Watchers' + name "azure_network_watcher" + desc "Verifies settings for Network Watchers" example <<-EXAMPLE describe azure_network_watcher(resource_group: 'example', name: 'name') do its(name) { should eq 'name'} @@ -14,11 +14,11 @@ class AzureNetworkWatcher < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/networkWatchers', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/networkWatchers", opts) opts[:allowed_parameters] = %i(flow_logs_api_version nsg_resource_id nsg_resource_group nsg_name) - opts[:flow_logs_api_version] ||= 'latest' + opts[:flow_logs_api_version] ||= "latest" # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -64,20 +64,20 @@ def flow_logs target_resource_id = @opts[:nsg_resource_id] else raise ArgumentError, - 'The resource group (nsg_resource_group) and the name (nsg_name) of the network security group or '\ - 'the resource id (nsg_resource_id) must be provided at resource initiation.' + "The resource group (nsg_resource_group) and the name (nsg_name) of the network security group or "\ + "the resource id (nsg_resource_id) must be provided at resource initiation." end req_body_hash = { targetResourceId: target_resource_id, } additional_resource_properties( { - property_name: 'flow_logs', + property_name: "flow_logs", property_endpoint: "#{id}/queryFlowLogStatus", api_version: @opts[:flow_logs_api_version], - method: 'post', + method: "post", req_body: JSON.generate(req_body_hash), - headers: { 'Content-Type' => 'application/json' }, + headers: { "Content-Type" => "application/json" }, }, ) end @@ -86,8 +86,8 @@ def flow_logs # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermNetworkWatcher < AzureNetworkWatcher - name 'azurerm_network_watcher' - desc 'Verifies settings for Network Watchers' + name "azurerm_network_watcher" + desc "Verifies settings for Network Watchers" example <<-EXAMPLE describe azurerm_network_watcher(resource_group: 'example', name: 'name') do its(name) { should eq 'name'} @@ -97,11 +97,11 @@ class AzurermNetworkWatcher < AzureNetworkWatcher def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureNetworkWatcher.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2018-02-01' - opts[:flow_logs_api_version] ||= '2019-04-01' + opts[:api_version] ||= "2018-02-01" + opts[:flow_logs_api_version] ||= "2019-04-01" super end end diff --git a/libraries/azure_network_watchers.rb b/libraries/azure_network_watchers.rb index 5eada464d..ef8a8d1ef 100644 --- a/libraries/azure_network_watchers.rb +++ b/libraries/azure_network_watchers.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureNetworkWatchers < AzureGenericResources - name 'azure_network_watchers' - desc 'Verifies settings for Network Watchers' + name "azure_network_watchers" + desc "Verifies settings for Network Watchers" example <<-EXAMPLE azure_network_watchers(resource_group: 'example') do it{ should exist } @@ -13,9 +13,9 @@ class AzureNetworkWatchers < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/networkWatchers', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/networkWatchers", opts) opts[:allowed_parameters] = %i(resource_group) # static_resource parameter must be true for setting the resource_provider in the backend. @@ -47,8 +47,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermNetworkWatchers < AzureNetworkWatchers - name 'azurerm_network_watchers' - desc 'Verifies settings for Network Watchers' + name "azurerm_network_watchers" + desc "Verifies settings for Network Watchers" example <<-EXAMPLE azurerm_network_watchers(resource_group: 'example') do it{ should exist } @@ -58,10 +58,10 @@ class AzurermNetworkWatchers < AzureNetworkWatchers def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureNetworkWatchers.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2018-02-01' + opts[:api_version] ||= "2018-02-01" super end end diff --git a/libraries/azure_policy_assignments.rb b/libraries/azure_policy_assignments.rb index f4e4e9179..f53e3d680 100644 --- a/libraries/azure_policy_assignments.rb +++ b/libraries/azure_policy_assignments.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' -require 'time' +require "azure_generic_resources" +require "time" class AzurePolicyAssignments < AzureGenericResources - name 'azure_policy_assignments' - desc 'Verifies settings for a collection of policy assignments' + name "azure_policy_assignments" + desc "Verifies settings for a collection of policy assignments" example <<-EXAMPLE # For property names see https://docs.microsoft.com/en-us/rest/api/policy/policyassignments/list#policyassignment @@ -16,12 +16,12 @@ class AzurePolicyAssignments < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Azure REST API endpoint URL format listing the all resources for a given subscription: # GET https://management.azure.com/subscriptions/{subscriptionId}/providers/{resourceProvider} # Our resourceProvider is Microsoft.Authorization/policyAssignments - opts[:resource_provider] = specific_resource_constraint('Microsoft.Authorization/policyAssignments', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Authorization/policyAssignments", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -86,6 +86,6 @@ def enrich_row(row) end def to_s - 'AzurePolicyAssignments' + "AzurePolicyAssignments" end end diff --git a/libraries/azure_policy_definition.rb b/libraries/azure_policy_definition.rb index 364ed6f3a..99d9d43b5 100644 --- a/libraries/azure_policy_definition.rb +++ b/libraries/azure_policy_definition.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzurePolicyDefinition < AzureGenericResource - name 'azure_policy_definition' - desc 'Verifies settings for a policy definition' + name "azure_policy_definition" + desc "Verifies settings for a policy definition" example <<-EXAMPLE describe azure_policy_definition(name: 'policy_name') do it { should exist } @@ -11,8 +11,8 @@ class AzurePolicyDefinition < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) - raise ArgumentError, '`resource_group` is not allowed.' if opts.key(:resource_group) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) + raise ArgumentError, "`resource_group` is not allowed." if opts.key(:resource_group) # Azure REST API endpoint URL format for the resource: # for a policy in a subscription: @@ -48,13 +48,13 @@ def initialize(opts = {}) # This is `false` for built-in policy definitions and it is bound to user-supplied `built_in` parameter. # Default is `true`. # - opts[:resource_provider] = specific_resource_constraint('Microsoft.Authorization/policyDefinitions', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Authorization/policyDefinitions", opts) # `built_in` is a resource specific parameter as oppose to `name` and `api_version`. # That's why it should be put in allowed_parameters to be able to pass the parameter validation in the backend. opts[:allowed_parameters] = %i(built_in) - opts[:resource_uri] = '/providers/Microsoft.Authorization/policyDefinitions' + opts[:resource_uri] = "/providers/Microsoft.Authorization/policyDefinitions" opts[:add_subscription_id] = opts[:built_in] != true # static_resource parameter must be true for setting the resource_provider in the backend. @@ -67,6 +67,6 @@ def to_s def custom? return unless exists? - properties&.policyType&.downcase == 'custom' + properties&.policyType&.downcase == "custom" end end diff --git a/libraries/azure_policy_definitions.rb b/libraries/azure_policy_definitions.rb index 69831a1d8..3a049f15a 100644 --- a/libraries/azure_policy_definitions.rb +++ b/libraries/azure_policy_definitions.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzurePolicyDefinitions < AzureGenericResources - name 'azure_policy_definitions' - desc 'Verifies settings for multiple policy definitions' + name "azure_policy_definitions" + desc "Verifies settings for multiple policy definitions" example <<-EXAMPLE azure_policy_definitions(built_in_only: true) do it{ should exist } @@ -13,7 +13,7 @@ class AzurePolicyDefinitions < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Azure REST API endpoint URL format for the resource: # for a policy in a subscription: @@ -45,12 +45,12 @@ def initialize(opts = {}) # Default is `true`. # - opts[:resource_provider] = specific_resource_constraint('Microsoft.Authorization/policyDefinitions', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Authorization/policyDefinitions", opts) # `built_in_only` is a resource specific parameter as oppose to the `api_version`. # That's why it should be put in allowed_parameters to be able to pass the parameter validation in the backend. opts[:allowed_parameters] = %i(built_in_only) - opts[:resource_uri] = '/providers/Microsoft.Authorization/policyDefinitions' + opts[:resource_uri] = "/providers/Microsoft.Authorization/policyDefinitions" opts[:add_subscription_id] = opts[:built_in_only] != true # static_resource parameter must be true for setting the resource_provider in the backend. diff --git a/libraries/azure_policy_exemption.rb b/libraries/azure_policy_exemption.rb index 2e13ad631..e50f45eba 100644 --- a/libraries/azure_policy_exemption.rb +++ b/libraries/azure_policy_exemption.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzurePolicyExemption < AzureGenericResource - name 'azure_policy_exemption' - desc 'Retrieves and verifies policy exemption.' + name "azure_policy_exemption" + desc "Retrieves and verifies policy exemption." example <<-EXAMPLE describe azure_policy_exemption(name: 'DemoExpensiveVM') do it { should exist } @@ -14,10 +14,10 @@ class AzurePolicyExemption < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Authorization/policyExemptions', opts) - opts[:resource_uri] = ['providers', opts[:resource_provider]].join('/') unless opts[:resource_group] + opts[:resource_provider] = specific_resource_constraint("Microsoft.Authorization/policyExemptions", opts) + opts[:resource_uri] = ["providers", opts[:resource_provider]].join("/") unless opts[:resource_group] opts[:add_subscription_id] = true super(opts, true) end diff --git a/libraries/azure_policy_exemptions.rb b/libraries/azure_policy_exemptions.rb index 8171eff63..96ba5baeb 100644 --- a/libraries/azure_policy_exemptions.rb +++ b/libraries/azure_policy_exemptions.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzurePolicyExemptions < AzureGenericResources - name 'azure_policy_exemptions' - desc 'Retrieves and verifies all policy exemptions that apply to a subscription' + name "azure_policy_exemptions" + desc "Retrieves and verifies all policy exemptions that apply to a subscription" example <<-EXAMPLE describe azure_policy_exemptions do it { should exist } @@ -10,9 +10,9 @@ class AzurePolicyExemptions < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Authorization/policyExemptions', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Authorization/policyExemptions", opts) super(opts, true) return if failed_resource? diff --git a/libraries/azure_policy_insights_query_result.rb b/libraries/azure_policy_insights_query_result.rb index 3bf906b34..7b8d27ffe 100644 --- a/libraries/azure_policy_insights_query_result.rb +++ b/libraries/azure_policy_insights_query_result.rb @@ -1,8 +1,8 @@ -require 'azure_backend' +require "azure_backend" class AzurePolicyInsightsQueryResult < AzureResourceBase - name 'azure_policy_insights_query_result' - desc 'Lists a collection of Azure Policy Insights Query Results' + name "azure_policy_insights_query_result" + desc "Lists a collection of Azure Policy Insights Query Results" example <<-EXAMPLE describe azure_policy_insights_query_result(policy_definition: 'de875639-505c-4c00-b2ab-bb290dab9a54', resource_id: '/subscriptions/80b824de-ec53-4116-9868-3deeab10b0cd/resourcegroups/jfm-winimgbuilderrg2/providers/microsoft.virtualmachineimages/imagetemplates/win1021h1') do it { should exist } @@ -10,9 +10,9 @@ class AzurePolicyInsightsQueryResult < AzureResourceBase EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) super(opts) - @resource_provider = specific_resource_constraint('Microsoft.Authorization/policyDefinitions', @opts) + @resource_provider = specific_resource_constraint("Microsoft.Authorization/policyDefinitions", @opts) validate_parameters(required: %i(policy_definition resource_id)) @azure_resource_id = @opts.delete(:resource_id) @policy_definition = @opts.delete(:policy_definition) @@ -28,7 +28,7 @@ def initialize(opts = {}) end def to_s - "#{AzurePolicyInsightsQueryResult.name.split('_').map(&:capitalize).join(' ')} : #{@display_name}" + "#{AzurePolicyInsightsQueryResult.name.split("_").map(&:capitalize).join(" ")} : #{@display_name}" end def exists? @@ -37,7 +37,7 @@ def exists? # Azure `isCompliant` is deprecated! def compliant? - compliance_state == 'Compliant' + compliance_state == "Compliant" end private @@ -46,17 +46,17 @@ def compliant? def build_query_params query_params = { resource_uri: @opts[:resource_uri] } - query_params[:query_parameters] = { '$filter' => "resourceId eq '#{azure_resource_id}'" } + query_params[:query_parameters] = { "$filter" => "resourceId eq '#{azure_resource_id}'" } # Use the latest api_version unless provided. - query_params[:query_parameters]['api-version'] = @opts[:api_version] || 'latest' - query_params[:method] = 'post' + query_params[:query_parameters]["api-version"] = @opts[:api_version] || "latest" + query_params[:method] = "post" query_params end def build_resource_uri - @opts[:resource_uri] = validate_resource_uri({ resource_uri: ['providers', resource_provider, policy_definition, - 'providers/Microsoft.PolicyInsights/policyStates/latest/queryResults'] - .join('/'), + @opts[:resource_uri] = validate_resource_uri({ resource_uri: ["providers", resource_provider, policy_definition, + "providers/Microsoft.PolicyInsights/policyStates/latest/queryResults"] + .join("/"), add_subscription_id: true }) Validators.validate_resource_uri(@opts[:resource_uri]) end diff --git a/libraries/azure_policy_insights_query_results.rb b/libraries/azure_policy_insights_query_results.rb index 10a91858e..d6b0fb138 100644 --- a/libraries/azure_policy_insights_query_results.rb +++ b/libraries/azure_policy_insights_query_results.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzurePolicyInsightsQueryResults < AzureGenericResources - name 'azure_policy_insights_query_results' - desc 'Lists a collection of Azure Policy Insights Query Results' + name "azure_policy_insights_query_results" + desc "Lists a collection of Azure Policy Insights Query Results" example <<-EXAMPLE describe azure_policy_insights_query_results do it { should exist } @@ -11,13 +11,13 @@ class AzurePolicyInsightsQueryResults < AzureGenericResources attr_reader :table def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Validators.validate_parameters(resource_name: @__resource_name__, allow: %i(filter_free_text), opts: opts) - resource_provider = specific_resource_constraint('Microsoft.PolicyInsights/policyStates/latest/queryResults', opts) - opts[:resource_uri] = ['providers', resource_provider].join('/') + resource_provider = specific_resource_constraint("Microsoft.PolicyInsights/policyStates/latest/queryResults", opts) + opts[:resource_uri] = ["providers", resource_provider].join("/") opts[:add_subscription_id] = true - opts[:method] = 'post' + opts[:method] = "post" super diff --git a/libraries/azure_postgresql_database.rb b/libraries/azure_postgresql_database.rb index 71837585a..afe5277e1 100644 --- a/libraries/azure_postgresql_database.rb +++ b/libraries/azure_postgresql_database.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzurePostgreSQLDatabase < AzureGenericResource - name 'azure_postgresql_database' - desc 'Verifies settings for an Azure PostgreSQL Database' + name "azure_postgresql_database" + desc "Verifies settings for an Azure PostgreSQL Database" example <<-EXAMPLE describe azure_postgresql_database(resource_group: 'rg-1', server_name: 'psql-server-1' name: 'customer-db') do it { should exist } @@ -11,11 +11,11 @@ class AzurePostgreSQLDatabase < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.DBforPostgreSQL/servers', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.DBforPostgreSQL/servers", opts) opts[:required_parameters] = %i(server_name) - opts[:resource_path] = [opts[:server_name], 'databases'].join('/') + opts[:resource_path] = [opts[:server_name], "databases"].join("/") opts[:resource_identifiers] = %i(database_name) # static_resource parameter must be true for setting the resource_provider in the backend. @@ -30,8 +30,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermPostgreSQLDatabase < AzurePostgreSQLDatabase - name 'azurerm_postgresql_database' - desc 'Verifies settings for an Azure PostgreSQL Database' + name "azurerm_postgresql_database" + desc "Verifies settings for an Azure PostgreSQL Database" example <<-EXAMPLE describe azurerm_postgresql_database(resource_group: 'rg-1', server_name: 'psql-server-1' database_name: 'customer-db') do it { should exist } @@ -41,10 +41,10 @@ class AzurermPostgreSQLDatabase < AzurePostgreSQLDatabase def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzurePostgreSQLDatabase.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2017-12-01' + opts[:api_version] ||= "2017-12-01" super end end diff --git a/libraries/azure_postgresql_databases.rb b/libraries/azure_postgresql_databases.rb index aed0119f4..d16035763 100644 --- a/libraries/azure_postgresql_databases.rb +++ b/libraries/azure_postgresql_databases.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzurePostgreSQLDatabases < AzureGenericResources - name 'azure_postgresql_databases' - desc 'Verifies settings for a collection of Azure PostgreSQL Databases on a PostgreSQL Server' + name "azure_postgresql_databases" + desc "Verifies settings for a collection of Azure PostgreSQL Databases on a PostgreSQL Server" example <<-EXAMPLE describe azure_postgresql_databases(resource_group: 'my-rg', server_name: 'server-1') do it { should exist } @@ -14,13 +14,13 @@ class AzurePostgreSQLDatabases < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.DBforPostgreSQL/servers', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.DBforPostgreSQL/servers", opts) opts[:required_parameters] = %i(resource_group server_name) # Unless provided here, a generic display name will be created in the backend. opts[:display_name] = "Databases on #{opts[:server_name]} PostgreSQL Server" - opts[:resource_path] = [opts[:server_name], 'databases'].join('/') + opts[:resource_path] = [opts[:server_name], "databases"].join("/") # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -52,8 +52,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermPostgreSQLDatabases < AzurePostgreSQLDatabases - name 'azurerm_postgresql_databases' - desc 'Verifies settings for a collection of Azure PostgreSQL Databases on a PostgreSQL Server' + name "azurerm_postgresql_databases" + desc "Verifies settings for a collection of Azure PostgreSQL Databases on a PostgreSQL Server" example <<-EXAMPLE describe azurerm_postgresql_databases(resource_group: 'my-rg', server_name: 'server-1') do it { should exist } @@ -64,10 +64,10 @@ class AzurermPostgreSQLDatabases < AzurePostgreSQLDatabases def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzurePostgreSQLDatabases.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2017-12-01' + opts[:api_version] ||= "2017-12-01" super end end diff --git a/libraries/azure_postgresql_server.rb b/libraries/azure_postgresql_server.rb index 403a4be27..1f3e69e3e 100644 --- a/libraries/azure_postgresql_server.rb +++ b/libraries/azure_postgresql_server.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzurePostgreSQLServer < AzureGenericResource - name 'azure_postgresql_server' - desc 'Verifies settings for an Azure PostgreSQL Server' + name "azure_postgresql_server" + desc "Verifies settings for an Azure PostgreSQL Server" example <<-EXAMPLE describe azure_postgresql_server(resource_group: 'rg-1', server_name: 'psql-srv') do it { should exist } @@ -11,14 +11,14 @@ class AzurePostgreSQLServer < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.DBforPostgreSQL/servers', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.DBforPostgreSQL/servers", opts) opts[:resource_identifiers] = %i(server_name) opts[:allowed_parameters] = %i(configurations_api_version firewall_rules_api_version auditing_settings_api_version threat_detection_settings_api_version administrators_api_version encryption_protector_api_version) - opts[:configurations_api_version] ||= 'latest' + opts[:configurations_api_version] ||= "latest" # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -66,8 +66,8 @@ def firewall_rules # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermPostgreSQLServer < AzurePostgreSQLServer - name 'azurerm_postgresql_server' - desc 'Verifies settings for an Azure PostgreSQL Server' + name "azurerm_postgresql_server" + desc "Verifies settings for an Azure PostgreSQL Server" example <<-EXAMPLE describe azurerm_postgresql_server(resource_group: 'rg-1', server_name: 'psql-srv') do it { should exist } @@ -77,11 +77,11 @@ class AzurermPostgreSQLServer < AzurePostgreSQLServer def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzurePostgreSQLServer.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # This is for backward compatibility - opts[:api_version] ||= '2017-12-01' - opts[:configurations_api_version] ||= '2017-12-01' + opts[:api_version] ||= "2017-12-01" + opts[:configurations_api_version] ||= "2017-12-01" super end end diff --git a/libraries/azure_postgresql_servers.rb b/libraries/azure_postgresql_servers.rb index f89e64f25..826fa1ae5 100644 --- a/libraries/azure_postgresql_servers.rb +++ b/libraries/azure_postgresql_servers.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzurePostgreSQLServers < AzureGenericResources - name 'azure_postgresql_servers' - desc 'Verifies settings for a collection of Azure PostgreSQL Servers' + name "azure_postgresql_servers" + desc "Verifies settings for a collection of Azure PostgreSQL Servers" example <<-EXAMPLE describe azure_postgresql_servers do its('names') { should include 'my-sql-server' } @@ -13,9 +13,9 @@ class AzurePostgreSQLServers < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.DBforPostgreSQL/servers', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.DBforPostgreSQL/servers", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -49,8 +49,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermPostgreSQLServers < AzurePostgreSQLServers - name 'azurerm_postgresql_servers' - desc 'Verifies settings for a collection of Azure PostgreSQL Servers' + name "azurerm_postgresql_servers" + desc "Verifies settings for a collection of Azure PostgreSQL Servers" example <<-EXAMPLE describe azurerm_postgresql_servers do its('names') { should include 'my-sql-server' } @@ -60,10 +60,10 @@ class AzurermPostgreSQLServers < AzurePostgreSQLServers def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzurePostgreSQLServers.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2017-12-01' + opts[:api_version] ||= "2017-12-01" super end end diff --git a/libraries/azure_power_bi_app.rb b/libraries/azure_power_bi_app.rb index db3862bbf..a4d5f458c 100644 --- a/libraries/azure_power_bi_app.rb +++ b/libraries/azure_power_bi_app.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzurePowerBIApp < AzureGenericResource - name 'azure_power_bi_app' - desc 'Retrieves and verifies the settings of a Azure Power BI Gateway' + name "azure_power_bi_app" + desc "Retrieves and verifies the settings of a Azure Power BI Gateway" example <<-EXAMPLE describe azure_power_bi_app(app_id: 'f089354e-8366-4e18-aea3-4cb4a3a50b48') do it { should exist } @@ -11,10 +11,10 @@ class AzurePowerBIApp < AzureGenericResource attr_reader :table - AUDIENCE = 'https://analysis.windows.net/powerbi/api'.freeze + AUDIENCE = "https://analysis.windows.net/powerbi/api".freeze def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Validators.validate_parameters(resource_name: @__resource_name__, required: %i(app_id), opts: opts) @@ -24,7 +24,7 @@ def initialize(opts = {}) opts[:audience] = AUDIENCE opts[:add_subscription_id] = false opts[:is_uri_a_url] = true - opts[:api_version] = 'v1.0' + opts[:api_version] = "v1.0" super end diff --git a/libraries/azure_power_bi_app_dashboard.rb b/libraries/azure_power_bi_app_dashboard.rb index 2f3026e31..7ce9933f9 100644 --- a/libraries/azure_power_bi_app_dashboard.rb +++ b/libraries/azure_power_bi_app_dashboard.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzurePowerBIAppDashboard < AzureGenericResource - name 'azure_power_bi_app_dashboard' - desc 'Retrieves and verifies the settings of a Azure Power BI App Dashboard' + name "azure_power_bi_app_dashboard" + desc "Retrieves and verifies the settings of a Azure Power BI App Dashboard" example <<-EXAMPLE describe azure_power_bi_app_dashboard(app_id: 'f089354e-8366-4e18-aea3-4cb4a3a50b48', dashboard_id: '335aee4b-7b38-48fd-9e2f-306c3fd67482') do it { should exist } @@ -11,10 +11,10 @@ class AzurePowerBIAppDashboard < AzureGenericResource attr_reader :table - AUDIENCE = 'https://analysis.windows.net/powerbi/api'.freeze + AUDIENCE = "https://analysis.windows.net/powerbi/api".freeze def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Validators.validate_parameters(resource_name: @__resource_name__, required: %i(app_id dashboard_id), opts: opts) @@ -24,7 +24,7 @@ def initialize(opts = {}) opts[:audience] = AUDIENCE opts[:add_subscription_id] = false opts[:is_uri_a_url] = true - opts[:api_version] = 'v1.0' + opts[:api_version] = "v1.0" super end diff --git a/libraries/azure_power_bi_app_dashboard_tile.rb b/libraries/azure_power_bi_app_dashboard_tile.rb index c8a5e7668..4470605de 100644 --- a/libraries/azure_power_bi_app_dashboard_tile.rb +++ b/libraries/azure_power_bi_app_dashboard_tile.rb @@ -1,18 +1,18 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzurePowerBIAppDashboardTile < AzureGenericResource - name 'azure_power_bi_app_dashboard_tile' - desc 'Retrieves and verifies the settings of a Azure Power BI App Dashboard Tile' + name "azure_power_bi_app_dashboard_tile" + desc "Retrieves and verifies the settings of a Azure Power BI App Dashboard Tile" example <<-EXAMPLE describe azure_power_bi_app_dashboard_tile(app_id: 'f089354e-8366-4e18-aea3-4cb4a3a50b48', dashboard_id: '335aee4b-7b38-48fd-9e2f-306c3fd67482', tile_id: '312fbfe9-2eda-44e0-9ed0-ab5dc571bb4b') do it { should exist } end EXAMPLE - AUDIENCE = 'https://analysis.windows.net/powerbi/api'.freeze + AUDIENCE = "https://analysis.windows.net/powerbi/api".freeze def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Validators.validate_parameters(resource_name: @__resource_name__, required: %i(app_id dashboard_id tile_id), opts: opts) @@ -23,7 +23,7 @@ def initialize(opts = {}) opts[:audience] = AUDIENCE opts[:add_subscription_id] = false opts[:is_uri_a_url] = true - opts[:api_version] = 'v1.0' + opts[:api_version] = "v1.0" super end diff --git a/libraries/azure_power_bi_app_dashboard_tiles.rb b/libraries/azure_power_bi_app_dashboard_tiles.rb index e305d80a8..8c9d0f3d5 100644 --- a/libraries/azure_power_bi_app_dashboard_tiles.rb +++ b/libraries/azure_power_bi_app_dashboard_tiles.rb @@ -1,18 +1,18 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzurePowerBIAppDashboardTiles < AzureGenericResources - name 'azure_power_bi_app_dashboard_tiles' - desc 'Retrieves and verifies the settings of all Azure Power BI App Dashboard Tiles.' + name "azure_power_bi_app_dashboard_tiles" + desc "Retrieves and verifies the settings of all Azure Power BI App Dashboard Tiles." example <<-EXAMPLE describe azure_power_bi_app_dashboard_tiles(app_id: 'f089354e-8366-4e18-aea3-4cb4a3a50b48', dashboard_id: '335aee4b-7b38-48fd-9e2f-306c3fd67482') do it { should exist } end EXAMPLE - AUDIENCE = 'https://analysis.windows.net/powerbi/api'.freeze + AUDIENCE = "https://analysis.windows.net/powerbi/api".freeze def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Validators.validate_parameters(resource_name: @__resource_name__, required: %i(app_id dashboard_id), opts: opts) @@ -23,7 +23,7 @@ def initialize(opts = {}) opts[:audience] = AUDIENCE opts[:add_subscription_id] = false opts[:is_uri_a_url] = true - opts[:api_version] = 'v1.0' + opts[:api_version] = "v1.0" super return if failed_resource? diff --git a/libraries/azure_power_bi_app_dashboards.rb b/libraries/azure_power_bi_app_dashboards.rb index 362433435..2d15b0d5d 100644 --- a/libraries/azure_power_bi_app_dashboards.rb +++ b/libraries/azure_power_bi_app_dashboards.rb @@ -1,18 +1,18 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzurePowerBIAppDashboards < AzureGenericResources - name 'azure_power_bi_app_dashboards' - desc 'Retrieves and verifies the settings of all Azure Power BI App Dashboards.' + name "azure_power_bi_app_dashboards" + desc "Retrieves and verifies the settings of all Azure Power BI App Dashboards." example <<-EXAMPLE describe azure_power_bi_app_dashboards(app_id: 'f089354e-8366-4e18-aea3-4cb4a3a50b48') do it { should exist } end EXAMPLE - AUDIENCE = 'https://analysis.windows.net/powerbi/api'.freeze + AUDIENCE = "https://analysis.windows.net/powerbi/api".freeze def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Validators.validate_parameters(resource_name: @__resource_name__, required: %i(app_id), opts: opts) @@ -22,7 +22,7 @@ def initialize(opts = {}) opts[:audience] = AUDIENCE opts[:add_subscription_id] = false opts[:is_uri_a_url] = true - opts[:api_version] = 'v1.0' + opts[:api_version] = "v1.0" super return if failed_resource? diff --git a/libraries/azure_power_bi_app_report.rb b/libraries/azure_power_bi_app_report.rb index a32092ee5..e06a9ca7b 100644 --- a/libraries/azure_power_bi_app_report.rb +++ b/libraries/azure_power_bi_app_report.rb @@ -1,18 +1,18 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzurePowerBIAppReport < AzureGenericResource - name 'azure_power_bi_app_report' - desc 'Retrieves and verifies the settings of a Azure Power BI App Report' + name "azure_power_bi_app_report" + desc "Retrieves and verifies the settings of a Azure Power BI App Report" example <<-EXAMPLE describe azure_power_bi_app_report(app_id: 'f089354e-8366-4e18-aea3-4cb4a3a50b48', report_id: '335aee4b-7b38-48fd-9e2f-306c3fd67482') do it { should exist } end EXAMPLE - AUDIENCE = 'https://analysis.windows.net/powerbi/api'.freeze + AUDIENCE = "https://analysis.windows.net/powerbi/api".freeze def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Validators.validate_parameters(resource_name: @__resource_name__, required: %i(app_id report_id), opts: opts) @@ -22,7 +22,7 @@ def initialize(opts = {}) opts[:audience] = AUDIENCE opts[:add_subscription_id] = false opts[:is_uri_a_url] = true - opts[:api_version] = 'v1.0' + opts[:api_version] = "v1.0" super end diff --git a/libraries/azure_power_bi_app_reports.rb b/libraries/azure_power_bi_app_reports.rb index c36b8d168..ddf2f5a02 100644 --- a/libraries/azure_power_bi_app_reports.rb +++ b/libraries/azure_power_bi_app_reports.rb @@ -1,18 +1,18 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzurePowerBIAppReports < AzureGenericResources - name 'azure_power_bi_app_reports' - desc 'Retrieves and verifies the settings of all Azure Power BI App Dashboard Tiles.' + name "azure_power_bi_app_reports" + desc "Retrieves and verifies the settings of all Azure Power BI App Dashboard Tiles." example <<-EXAMPLE describe azure_power_bi_app_reports(app_id: 'f089354e-8366-4e18-aea3-4cb4a3a50b48') do it { should exist } end EXAMPLE - AUDIENCE = 'https://analysis.windows.net/powerbi/api'.freeze + AUDIENCE = "https://analysis.windows.net/powerbi/api".freeze def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Validators.validate_parameters(resource_name: @__resource_name__, required: %i(app_id), opts: opts) @@ -22,7 +22,7 @@ def initialize(opts = {}) opts[:audience] = AUDIENCE opts[:add_subscription_id] = false opts[:is_uri_a_url] = true - opts[:api_version] = 'v1.0' + opts[:api_version] = "v1.0" super return if failed_resource? diff --git a/libraries/azure_power_bi_apps.rb b/libraries/azure_power_bi_apps.rb index c225c3288..b2657e544 100644 --- a/libraries/azure_power_bi_apps.rb +++ b/libraries/azure_power_bi_apps.rb @@ -1,24 +1,24 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzurePowerBIApps < AzureGenericResources - name 'azure_power_bi_apps' - desc 'Retrieves and verifies the settings of all Azure Power BI Apps.' + name "azure_power_bi_apps" + desc "Retrieves and verifies the settings of all Azure Power BI Apps." example <<-EXAMPLE describe azure_power_bi_apps do it { should exist } end EXAMPLE - AUDIENCE = 'https://analysis.windows.net/powerbi/api'.freeze + AUDIENCE = "https://analysis.windows.net/powerbi/api".freeze def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_uri] = 'https://api.powerbi.com/v1.0/myorg/apps' + opts[:resource_uri] = "https://api.powerbi.com/v1.0/myorg/apps" opts[:audience] = AUDIENCE opts[:add_subscription_id] = false opts[:is_uri_a_url] = true - opts[:api_version] = 'v1.0' + opts[:api_version] = "v1.0" super return if failed_resource? diff --git a/libraries/azure_power_bi_capacities.rb b/libraries/azure_power_bi_capacities.rb index d7ddb37c4..b63b1712e 100644 --- a/libraries/azure_power_bi_capacities.rb +++ b/libraries/azure_power_bi_capacities.rb @@ -1,24 +1,24 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzurePowerBICapacities < AzureGenericResources - name 'azure_power_bi_capacities' - desc 'Retrieves and verifies the settings of all Azure Power BI Capacities.' + name "azure_power_bi_capacities" + desc "Retrieves and verifies the settings of all Azure Power BI Capacities." example <<-EXAMPLE describe azure_power_bi_capacities do it { should exist } end EXAMPLE - AUDIENCE = 'https://analysis.windows.net/powerbi/api'.freeze + AUDIENCE = "https://analysis.windows.net/powerbi/api".freeze def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_uri] = 'https://api.powerbi.com/v1.0/myorg/capacities' + opts[:resource_uri] = "https://api.powerbi.com/v1.0/myorg/capacities" opts[:audience] = AUDIENCE opts[:add_subscription_id] = false opts[:is_uri_a_url] = true - opts[:api_version] = 'v1.0' + opts[:api_version] = "v1.0" super return if failed_resource? diff --git a/libraries/azure_power_bi_capacity_refreshable.rb b/libraries/azure_power_bi_capacity_refreshable.rb index 1f1e934f3..086a3f830 100644 --- a/libraries/azure_power_bi_capacity_refreshable.rb +++ b/libraries/azure_power_bi_capacity_refreshable.rb @@ -1,18 +1,18 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzurePowerBICapacityRefreshable < AzureGenericResource - name 'azure_power_bi_capacity_refreshable' - desc 'Retrieves and verifies the settings of an Azure Power BI Capacity Refreshable.' + name "azure_power_bi_capacity_refreshable" + desc "Retrieves and verifies the settings of an Azure Power BI Capacity Refreshable." example <<-EXAMPLE describe azure_power_bi_capacity_refreshable(capacity_id: '0f084df7-c13d-451b-af5f-ed0c466403b2', refreshable_id: 'cfafbeb1-8037-4d0c-896e-a46fb27ff229') do it { should exist } end EXAMPLE - AUDIENCE = 'https://analysis.windows.net/powerbi/api'.freeze + AUDIENCE = "https://analysis.windows.net/powerbi/api".freeze def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Validators.validate_parameters(resource_name: @__resource_name__, required: %i(capacity_id), opts: opts) @@ -21,7 +21,7 @@ def initialize(opts = {}) opts[:audience] = AUDIENCE opts[:add_subscription_id] = false opts[:is_uri_a_url] = true - opts[:api_version] = 'v1.0' + opts[:api_version] = "v1.0" super end diff --git a/libraries/azure_power_bi_capacity_refreshables.rb b/libraries/azure_power_bi_capacity_refreshables.rb index ebde721c3..bee062286 100644 --- a/libraries/azure_power_bi_capacity_refreshables.rb +++ b/libraries/azure_power_bi_capacity_refreshables.rb @@ -1,29 +1,29 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzurePowerBICapacityRefreshables < AzureGenericResources - name 'azure_power_bi_capacity_refreshables' - desc 'Retrieves and verifies the settings of all Azure Power BI Capacities Refreshables.' + name "azure_power_bi_capacity_refreshables" + desc "Retrieves and verifies the settings of all Azure Power BI Capacities Refreshables." example <<-EXAMPLE describe azure_power_bi_capacity_refreshables(capacity_id: '0f084df7-c13d-451b-af5f-ed0c466403b2') do it { should exist } end EXAMPLE - AUDIENCE = 'https://analysis.windows.net/powerbi/api'.freeze + AUDIENCE = "https://analysis.windows.net/powerbi/api".freeze def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Validators.validate_parameters(resource_name: @__resource_name__, allow: %i(capacity_id top), opts: opts) - opts[:resource_uri] = ['https://api.powerbi.com/v1.0/myorg/capacities'].tap do |arr| + opts[:resource_uri] = ["https://api.powerbi.com/v1.0/myorg/capacities"].tap do |arr| arr << opts.delete(:capacity_id) if opts[:capacity_id].present? - arr << 'refreshables' - end.join('/') + arr << "refreshables" + end.join("/") opts[:audience] = AUDIENCE opts[:add_subscription_id] = false opts[:is_uri_a_url] = true - opts[:api_version] = 'v1.0' - opts[:query_parameters] = { '$top' => opts.delete(:top) || 1000 } + opts[:api_version] = "v1.0" + opts[:query_parameters] = { "$top" => opts.delete(:top) || 1000 } super return if failed_resource? diff --git a/libraries/azure_power_bi_capacity_workload.rb b/libraries/azure_power_bi_capacity_workload.rb index 612236889..49dd5817b 100644 --- a/libraries/azure_power_bi_capacity_workload.rb +++ b/libraries/azure_power_bi_capacity_workload.rb @@ -1,18 +1,18 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzurePowerBICapacityWorkload < AzureGenericResource - name 'azure_power_bi_capacity_workload' - desc 'Retrieves and verifies the settings of an Azure Power BI Capacity Workload.' + name "azure_power_bi_capacity_workload" + desc "Retrieves and verifies the settings of an Azure Power BI Capacity Workload." example <<-EXAMPLE describe azure_power_bi_capacity_workload(capacity_id: '0f084df7-c13d-451b-af5f-ed0c466403b2', name: 'cfafbeb1-8037-4d0c-896e-a46fb27ff229') do it { should exist } end EXAMPLE - AUDIENCE = 'https://analysis.windows.net/powerbi/api'.freeze + AUDIENCE = "https://analysis.windows.net/powerbi/api".freeze def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Validators.validate_parameters(resource_name: @__resource_name__, required: %i(capacity_id), opts: opts) @@ -21,7 +21,7 @@ def initialize(opts = {}) opts[:audience] = AUDIENCE opts[:add_subscription_id] = false opts[:is_uri_a_url] = true - opts[:api_version] = 'v1.0' + opts[:api_version] = "v1.0" super end diff --git a/libraries/azure_power_bi_capacity_workloads.rb b/libraries/azure_power_bi_capacity_workloads.rb index 234ffbfa6..9bc75327b 100644 --- a/libraries/azure_power_bi_capacity_workloads.rb +++ b/libraries/azure_power_bi_capacity_workloads.rb @@ -1,28 +1,28 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzurePowerBICapacityWorkloads < AzureGenericResources - name 'azure_power_bi_capacity_workloads' - desc 'Retrieves and verifies the settings of all Azure Power BI Capacities Workloads.' + name "azure_power_bi_capacity_workloads" + desc "Retrieves and verifies the settings of all Azure Power BI Capacities Workloads." example <<-EXAMPLE describe azure_power_bi_capacity_workloads(capacity_id: '0f084df7-c13d-451b-af5f-ed0c466403b2') do it { should exist } end EXAMPLE - AUDIENCE = 'https://analysis.windows.net/powerbi/api'.freeze + AUDIENCE = "https://analysis.windows.net/powerbi/api".freeze def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Validators.validate_parameters(resource_name: @__resource_name__, allow: %i(capacity_id), opts: opts) - opts[:resource_uri] = ['https://api.powerbi.com/v1.0/myorg/capacities'].tap do |arr| + opts[:resource_uri] = ["https://api.powerbi.com/v1.0/myorg/capacities"].tap do |arr| arr << opts.delete(:capacity_id) if opts[:capacity_id].present? - arr << 'Workloads' - end.join('/') + arr << "Workloads" + end.join("/") opts[:audience] = AUDIENCE opts[:add_subscription_id] = false opts[:is_uri_a_url] = true - opts[:api_version] = 'v1.0' + opts[:api_version] = "v1.0" super return if failed_resource? diff --git a/libraries/azure_power_bi_dashboard.rb b/libraries/azure_power_bi_dashboard.rb index a4bd12f68..d2f58d497 100644 --- a/libraries/azure_power_bi_dashboard.rb +++ b/libraries/azure_power_bi_dashboard.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzurePowerBIDashboard < AzureGenericResource - name 'azure_power_bi_dashboard' - desc 'Retrieves and verifies the settings of a Data Lake Storage Gen2 file system' + name "azure_power_bi_dashboard" + desc "Retrieves and verifies the settings of a Data Lake Storage Gen2 file system" example <<-EXAMPLE describe azure_power_bi_dashboard(dashboard_id: '95a4871a-33a4-4f35', group_id: '95a4871a-33a4-4f35-9eea-8ff006b4840b') do it { should exist } @@ -11,24 +11,24 @@ class AzurePowerBIDashboard < AzureGenericResource attr_reader :table - AUDIENCE = 'https://analysis.windows.net/powerbi/api'.freeze + AUDIENCE = "https://analysis.windows.net/powerbi/api".freeze def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Validators.validate_parameters(resource_name: @__resource_name__, required: %i(dashboard_id), allow: %i(group_id), opts: opts) opts[:name] = opts.delete(:dashboard_id) - opts[:resource_uri] = ['https://api.powerbi.com/v1.0/myorg'].tap do |arr| + opts[:resource_uri] = ["https://api.powerbi.com/v1.0/myorg"].tap do |arr| arr << "groups/#{opts.delete(:group_id)}" if opts[:group_id].present? arr << "dashboards/#{opts[:name]}" - end.join('/') + end.join("/") opts[:audience] = AUDIENCE opts[:add_subscription_id] = false opts[:is_uri_a_url] = true - opts[:api_version] = 'v1.0' + opts[:api_version] = "v1.0" super end diff --git a/libraries/azure_power_bi_dashboard_tile.rb b/libraries/azure_power_bi_dashboard_tile.rb index b09d2831d..a5ff63444 100644 --- a/libraries/azure_power_bi_dashboard_tile.rb +++ b/libraries/azure_power_bi_dashboard_tile.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzurePowerBIDashboardTile < AzureGenericResource - name 'azure_power_bi_dashboard_tile' - desc 'Retrieves and verifies the settings of a Azure Power BI Dashboard tile' + name "azure_power_bi_dashboard_tile" + desc "Retrieves and verifies the settings of a Azure Power BI Dashboard tile" example <<-EXAMPLE describe azure_power_bi_dashboard_tile(tile_id: '3262-4671-bdc8', dashboard_id: 'b84b01c6-3262-4671-bdc8-ff99becf2a0b', group_id: '95a4871a-33a4-4f35-9eea-8ff006b4840b') do it { should exist } @@ -11,25 +11,25 @@ class AzurePowerBIDashboardTile < AzureGenericResource attr_reader :table - AUDIENCE = 'https://analysis.windows.net/powerbi/api'.freeze + AUDIENCE = "https://analysis.windows.net/powerbi/api".freeze def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Validators.validate_parameters(resource_name: @__resource_name__, required: %i(tiles_id dashboard_id), allow: %i(group_id), opts: opts) opts[:name] = opts.delete(:dashboard_id) - opts[:resource_uri] = ['https://api.powerbi.com/v1.0/myorg'].tap do |arr| + opts[:resource_uri] = ["https://api.powerbi.com/v1.0/myorg"].tap do |arr| arr << "groups/#{opts.delete(:group_id)}" if opts[:group_id].present? arr << "dashboards/#{opts[:name]}" arr << "tiles/#{opts[:tiles_id]}" - end.join('/') + end.join("/") opts[:audience] = AUDIENCE opts[:add_subscription_id] = false opts[:is_uri_a_url] = true - opts[:api_version] = 'v1.0' + opts[:api_version] = "v1.0" super end diff --git a/libraries/azure_power_bi_dashboard_tiles.rb b/libraries/azure_power_bi_dashboard_tiles.rb index bbe26d336..cfc2b103d 100644 --- a/libraries/azure_power_bi_dashboard_tiles.rb +++ b/libraries/azure_power_bi_dashboard_tiles.rb @@ -1,28 +1,28 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzurePowerBIDashboardTiles < AzureGenericResources - name 'azure_power_bi_dashboard_tiles' - desc 'Retrieves and verifies the settings of all Azure Power BI Dashboard Tiles' + name "azure_power_bi_dashboard_tiles" + desc "Retrieves and verifies the settings of all Azure Power BI Dashboard Tiles" example <<-EXAMPLE describe azure_power_bi_dashboard_tiles(dashboard_id: 'b84b01c6-3262-4671-bdc8-ff99becf2a0b', group_id: '95a4871a-33a4-4f35-9eea-8ff006b4840b') do it { should exist } end EXAMPLE - AUDIENCE = 'https://analysis.windows.net/powerbi/api'.freeze + AUDIENCE = "https://analysis.windows.net/powerbi/api".freeze def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_uri] = ['https://api.powerbi.com/v1.0/myorg'].tap do |arr| + opts[:resource_uri] = ["https://api.powerbi.com/v1.0/myorg"].tap do |arr| arr << "groups/#{opts.delete(:group_id)}" if opts[:group_id].present? arr << "dashboards/#{opts[:name]}" - arr << 'tiles' - end.join('/') + arr << "tiles" + end.join("/") opts[:audience] = AUDIENCE opts[:add_subscription_id] = false opts[:is_uri_a_url] = true - opts[:api_version] = 'v1.0' + opts[:api_version] = "v1.0" super return if failed_resource? diff --git a/libraries/azure_power_bi_dashboards.rb b/libraries/azure_power_bi_dashboards.rb index 03c858663..ec0d13681 100644 --- a/libraries/azure_power_bi_dashboards.rb +++ b/libraries/azure_power_bi_dashboards.rb @@ -1,27 +1,27 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzurePowerBIDashboards < AzureGenericResources - name 'azure_power_bi_dashboards' - desc 'Retrieves and verifies the settings of all Azure Power BI Dashboards.' + name "azure_power_bi_dashboards" + desc "Retrieves and verifies the settings of all Azure Power BI Dashboards." example <<-EXAMPLE describe azure_power_bi_dashboards(group_id: '95a4871a-33a4-4f35-9eea-8ff006b4840b') do it { should exist } end EXAMPLE - AUDIENCE = 'https://analysis.windows.net/powerbi/api'.freeze + AUDIENCE = "https://analysis.windows.net/powerbi/api".freeze def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_uri] = ['https://api.powerbi.com/v1.0/myorg'].tap do |arr| + opts[:resource_uri] = ["https://api.powerbi.com/v1.0/myorg"].tap do |arr| arr << "groups/#{opts.delete(:group_id)}" if opts[:group_id].present? - arr << 'dashboards' - end.join('/') + arr << "dashboards" + end.join("/") opts[:audience] = AUDIENCE opts[:add_subscription_id] = false opts[:is_uri_a_url] = true - opts[:api_version] = 'v1.0' + opts[:api_version] = "v1.0" super return if failed_resource? diff --git a/libraries/azure_power_bi_dataflow.rb b/libraries/azure_power_bi_dataflow.rb index 50811bb05..bc8c1d886 100644 --- a/libraries/azure_power_bi_dataflow.rb +++ b/libraries/azure_power_bi_dataflow.rb @@ -1,18 +1,18 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzurePowerBIDataflow < AzureGenericResource - name 'azure_power_bi_dataflow' - desc 'Retrieves and verifies the settings of an Azure Power BI Dataflow.' + name "azure_power_bi_dataflow" + desc "Retrieves and verifies the settings of an Azure Power BI Dataflow." example <<-EXAMPLE describe azure_power_bi_dataflow(capacity_id: '0f084df7-c13d-451b-af5f-ed0c466403b2', name: 'cfafbeb1-8037-4d0c-896e-a46fb27ff229') do it { should exist } end EXAMPLE - AUDIENCE = 'https://analysis.windows.net/powerbi/api'.freeze + AUDIENCE = "https://analysis.windows.net/powerbi/api".freeze def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Validators.validate_parameters(resource_name: @__resource_name__, required: %i(group_id), opts: opts) @@ -21,7 +21,7 @@ def initialize(opts = {}) opts[:audience] = AUDIENCE opts[:add_subscription_id] = false opts[:is_uri_a_url] = true - opts[:api_version] = 'v1.0' + opts[:api_version] = "v1.0" super end diff --git a/libraries/azure_power_bi_dataflow_storage_accounts.rb b/libraries/azure_power_bi_dataflow_storage_accounts.rb index 429a12355..dd28cba7c 100644 --- a/libraries/azure_power_bi_dataflow_storage_accounts.rb +++ b/libraries/azure_power_bi_dataflow_storage_accounts.rb @@ -1,8 +1,8 @@ -require 'azure_power_bi_generic_resources' +require "azure_power_bi_generic_resources" class AzurePowerBIDataflowStorageAccounts < AzurePowerBIGenericResources - name 'azure_power_bi_dataflow_storage_accounts' - desc 'Retrieves and verifies the settings of all Azure Power BI Dataflow Storage Accounts' + name "azure_power_bi_dataflow_storage_accounts" + desc "Retrieves and verifies the settings of all Azure Power BI Dataflow Storage Accounts" example <<-EXAMPLE describe azure_power_bi_dataflow_storage_accounts do it { should exist } @@ -10,8 +10,8 @@ class AzurePowerBIDataflowStorageAccounts < AzurePowerBIGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) - opts[:resource_path_array] = ['dataflowStorageAccounts'] + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) + opts[:resource_path_array] = ["dataflowStorageAccounts"] super end diff --git a/libraries/azure_power_bi_dataflows.rb b/libraries/azure_power_bi_dataflows.rb index cb0665313..deca4e973 100644 --- a/libraries/azure_power_bi_dataflows.rb +++ b/libraries/azure_power_bi_dataflows.rb @@ -1,18 +1,18 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzurePowerBIDataflows < AzureGenericResources - name 'azure_power_bi_dataflows' - desc 'Retrieves and verifies the settings of all Azure Power BI Dataflows.' + name "azure_power_bi_dataflows" + desc "Retrieves and verifies the settings of all Azure Power BI Dataflows." example <<-EXAMPLE describe azure_power_bi_dataflows(group_id: 'f089354e-8366-4e18-aea3-4cb4a3a50b48') do it { should exist } end EXAMPLE - AUDIENCE = 'https://analysis.windows.net/powerbi/api'.freeze + AUDIENCE = "https://analysis.windows.net/powerbi/api".freeze def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Validators.validate_parameters(resource_name: @__resource_name__, required: %i(group_id), opts: opts) @@ -20,7 +20,7 @@ def initialize(opts = {}) opts[:audience] = AUDIENCE opts[:add_subscription_id] = false opts[:is_uri_a_url] = true - opts[:api_version] = 'v1.0' + opts[:api_version] = "v1.0" super return if failed_resource? diff --git a/libraries/azure_power_bi_dataset.rb b/libraries/azure_power_bi_dataset.rb index 837e64690..798ff9581 100644 --- a/libraries/azure_power_bi_dataset.rb +++ b/libraries/azure_power_bi_dataset.rb @@ -1,34 +1,34 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzurePowerBIDataset < AzureGenericResource - name 'azure_power_bi_dataset' - desc 'Retrieves and verifies the settings of an Azure Power BI Dataset.' + name "azure_power_bi_dataset" + desc "Retrieves and verifies the settings of an Azure Power BI Dataset." example <<-EXAMPLE describe azure_power_bi_dataset(group_id: '0f084df7-c13d-451b-af5f-ed0c466403b2', name: 'cfafbeb1-8037-4d0c-896e-a46fb27ff229') do it { should exist } end EXAMPLE - AUDIENCE = 'https://analysis.windows.net/powerbi/api'.freeze + AUDIENCE = "https://analysis.windows.net/powerbi/api".freeze def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Validators.validate_parameters(resource_name: @__resource_name__, allow: %i(group_id), opts: opts) - opts[:resource_uri] = ['https://api.powerbi.com/v1.0/myorg'].tap do |array| + opts[:resource_uri] = ["https://api.powerbi.com/v1.0/myorg"].tap do |array| if opts[:group_id].present? - array << 'groups' + array << "groups" array << opts.delete(:group_id) end - array << 'datasets' + array << "datasets" array << opts[:name] - end.join('/') + end.join("/") opts[:audience] = AUDIENCE opts[:add_subscription_id] = false opts[:is_uri_a_url] = true - opts[:api_version] = 'v1.0' + opts[:api_version] = "v1.0" super end diff --git a/libraries/azure_power_bi_dataset_datasources.rb b/libraries/azure_power_bi_dataset_datasources.rb index c39926d5f..f29b79a0f 100644 --- a/libraries/azure_power_bi_dataset_datasources.rb +++ b/libraries/azure_power_bi_dataset_datasources.rb @@ -1,32 +1,32 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzurePowerBIDatasetDatasources < AzureGenericResources - name 'azure_power_bi_dataset_datasources' - desc 'Retrieves and verifies the settings of all Azure Power BI Dataset Datasources' + name "azure_power_bi_dataset_datasources" + desc "Retrieves and verifies the settings of all Azure Power BI Dataset Datasources" example <<-EXAMPLE describe azure_power_bi_dataset_datasources(dataset_id: 'cfafbeb1-8037-4d0c-896e-a46fb27ff229') do it { should exist } end EXAMPLE - AUDIENCE = 'https://analysis.windows.net/powerbi/api'.freeze + AUDIENCE = "https://analysis.windows.net/powerbi/api".freeze def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Validators.validate_parameters(resource_name: @__resource_name__, allow: %i(group_id), required: %i(dataset_id), opts: opts) - opts[:resource_uri] = ['https://api.powerbi.com/v1.0/myorg'].tap do |array| + opts[:resource_uri] = ["https://api.powerbi.com/v1.0/myorg"].tap do |array| if opts[:group_id].present? - array << 'groups' + array << "groups" array << opts.delete(:group_id) end - array << ['datasets', opts.delete(:dataset_id), 'datasources'] - end.join('/') + array << ["datasets", opts.delete(:dataset_id), "datasources"] + end.join("/") opts[:audience] = AUDIENCE opts[:add_subscription_id] = false opts[:is_uri_a_url] = true - opts[:api_version] = 'v1.0' + opts[:api_version] = "v1.0" super return if failed_resource? diff --git a/libraries/azure_power_bi_datasets.rb b/libraries/azure_power_bi_datasets.rb index 0aff1e586..82f7b4033 100644 --- a/libraries/azure_power_bi_datasets.rb +++ b/libraries/azure_power_bi_datasets.rb @@ -1,32 +1,32 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzurePowerBIDatasets < AzureGenericResources - name 'azure_power_bi_datasets' - desc 'Retrieves and verifies the settings of all Azure Power BI Datasets.' + name "azure_power_bi_datasets" + desc "Retrieves and verifies the settings of all Azure Power BI Datasets." example <<-EXAMPLE describe azure_power_bi_datasets do it { should exist } end EXAMPLE - AUDIENCE = 'https://analysis.windows.net/powerbi/api'.freeze + AUDIENCE = "https://analysis.windows.net/powerbi/api".freeze def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Validators.validate_parameters(resource_name: @__resource_name__, allow: %i(group_id), opts: opts) - opts[:resource_uri] = ['https://api.powerbi.com/v1.0/myorg'].tap do |array| + opts[:resource_uri] = ["https://api.powerbi.com/v1.0/myorg"].tap do |array| if opts[:group_id].present? - array << 'groups' + array << "groups" array << opts.delete(:group_id) end - array << 'datasets' - end.join('/') + array << "datasets" + end.join("/") opts[:audience] = AUDIENCE opts[:add_subscription_id] = false opts[:is_uri_a_url] = true - opts[:api_version] = 'v1.0' + opts[:api_version] = "v1.0" super return if failed_resource? diff --git a/libraries/azure_power_bi_embedded_capacities.rb b/libraries/azure_power_bi_embedded_capacities.rb index e7d70f0b9..9ff38afcb 100644 --- a/libraries/azure_power_bi_embedded_capacities.rb +++ b/libraries/azure_power_bi_embedded_capacities.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzurePowerBiEmbeddedCapacities < AzureGenericResources - name 'azure_power_bi_embedded_capacities' - desc 'Retrieves and verifies the settings of all Azure Power BI Embedded Capacities.' + name "azure_power_bi_embedded_capacities" + desc "Retrieves and verifies the settings of all Azure Power BI Embedded Capacities." example <<-EXAMPLE describe azure_power_bi_embedded_capacities do it { should exist } @@ -10,9 +10,9 @@ class AzurePowerBiEmbeddedCapacities < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.PowerBIDedicated/capacities', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.PowerBIDedicated/capacities", opts) super(opts, true) return if failed_resource? @@ -28,11 +28,11 @@ def to_s def populate_table @resources.each do |resource| props = resource[:properties] - sku_hash = concat_keys(resource[:sku], 'sku') - administration_attrs = concat_keys(props[:administration], 'administration') + sku_hash = concat_keys(resource[:sku], "sku") + administration_attrs = concat_keys(props[:administration], "administration") @table << resource.merge(resource[:properties]) - .merge(sku_hash) - .merge(administration_attrs) + .merge(sku_hash) + .merge(administration_attrs) end end diff --git a/libraries/azure_power_bi_embedded_capacity.rb b/libraries/azure_power_bi_embedded_capacity.rb index 75d54e305..78222cd77 100644 --- a/libraries/azure_power_bi_embedded_capacity.rb +++ b/libraries/azure_power_bi_embedded_capacity.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzurePowerBiEmbeddedCapacity < AzureGenericResource - name 'azure_power_bi_embedded_capacity' - desc 'Retrieves and verifies the settings of an Azure Power BI Embedded Capacity.' + name "azure_power_bi_embedded_capacity" + desc "Retrieves and verifies the settings of an Azure Power BI Embedded Capacity." example <<-EXAMPLE describe azure_power_bi_embedded_capacity(resource_group: 'inspec-azure-rg', name: 'power-bi-inspec') do it { should exist } @@ -10,9 +10,9 @@ class AzurePowerBiEmbeddedCapacity < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.PowerBIDedicated/capacities', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.PowerBIDedicated/capacities", opts) super(opts, true) end diff --git a/libraries/azure_power_bi_gateway.rb b/libraries/azure_power_bi_gateway.rb index 575639817..b2efe3714 100644 --- a/libraries/azure_power_bi_gateway.rb +++ b/libraries/azure_power_bi_gateway.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzurePowerBIGateway < AzureGenericResource - name 'azure_power_bi_gateway' - desc 'Retrieves and verifies the settings of a Azure Power BI Gateway' + name "azure_power_bi_gateway" + desc "Retrieves and verifies the settings of a Azure Power BI Gateway" example <<-EXAMPLE describe azure_power_bi_gateway(gateway_id: '95a4871a-33a4-4f35-9eea-8ff006b4840b') do it { should exist } @@ -11,10 +11,10 @@ class AzurePowerBIGateway < AzureGenericResource attr_reader :table - AUDIENCE = 'https://analysis.windows.net/powerbi/api'.freeze + AUDIENCE = "https://analysis.windows.net/powerbi/api".freeze def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Validators.validate_parameters(resource_name: @__resource_name__, required: %i(gateway_id), opts: opts) @@ -24,7 +24,7 @@ def initialize(opts = {}) opts[:audience] = AUDIENCE opts[:add_subscription_id] = false opts[:is_uri_a_url] = true - opts[:api_version] = 'v1.0' + opts[:api_version] = "v1.0" super end diff --git a/libraries/azure_power_bi_gateways.rb b/libraries/azure_power_bi_gateways.rb index d423d6a05..75582daf0 100644 --- a/libraries/azure_power_bi_gateways.rb +++ b/libraries/azure_power_bi_gateways.rb @@ -1,24 +1,24 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzurePowerBIGateways < AzureGenericResources - name 'azure_power_bi_gateways' - desc 'Retrieves and verifies the settings of all Azure Power BI Gateways.' + name "azure_power_bi_gateways" + desc "Retrieves and verifies the settings of all Azure Power BI Gateways." example <<-EXAMPLE describe azure_power_bi_gateways do it { should exist } end EXAMPLE - AUDIENCE = 'https://analysis.windows.net/powerbi/api'.freeze + AUDIENCE = "https://analysis.windows.net/powerbi/api".freeze def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_uri] = 'https://api.powerbi.com/v1.0/myorg/gateways' + opts[:resource_uri] = "https://api.powerbi.com/v1.0/myorg/gateways" opts[:audience] = AUDIENCE opts[:add_subscription_id] = false opts[:is_uri_a_url] = true - opts[:api_version] = 'v1.0' + opts[:api_version] = "v1.0" super return if failed_resource? diff --git a/libraries/azure_power_bi_generic_resources.rb b/libraries/azure_power_bi_generic_resources.rb index 02cec2c2b..b33a5a270 100644 --- a/libraries/azure_power_bi_generic_resources.rb +++ b/libraries/azure_power_bi_generic_resources.rb @@ -1,31 +1,31 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzurePowerBIGenericResources < AzureGenericResources - name 'azure_power_bi_generic_resources' - desc 'Retrieves and verifies the settings of all Azure Power BI Resources' + name "azure_power_bi_generic_resources" + desc "Retrieves and verifies the settings of all Azure Power BI Resources" example <<-EXAMPLE describe azure_power_bi_generic_resources do it { should exist } end EXAMPLE - AUDIENCE = 'https://analysis.windows.net/powerbi/api'.freeze + AUDIENCE = "https://analysis.windows.net/powerbi/api".freeze def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Validators.validate_parameters(resource_name: @__resource_name__, allow: %i(group_id resource_path_array), opts: opts) - opts[:resource_uri] ||= ['https://api.powerbi.com/v1.0/myorg'].tap do |array| + opts[:resource_uri] ||= ["https://api.powerbi.com/v1.0/myorg"].tap do |array| if opts[:group_id].present? - array << 'groups' + array << "groups" array << opts.delete(:group_id) end array << opts.delete(:resource_path_array) if opts[:resource_path_array] - end.join('/') + end.join("/") opts[:audience] = self.class::AUDIENCE opts[:add_subscription_id] = false opts[:is_uri_a_url] = true - opts[:api_version] = 'v1.0' + opts[:api_version] = "v1.0" super return if failed_resource? diff --git a/libraries/azure_public_ip.rb b/libraries/azure_public_ip.rb index c5573ece3..a00f6c6d3 100644 --- a/libraries/azure_public_ip.rb +++ b/libraries/azure_public_ip.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzurePublicIp < AzureGenericResource - name 'azure_public_ip' - desc 'Verifies settings for public IP address' + name "azure_public_ip" + desc "Verifies settings for public IP address" example <<-EXAMPLE describe azure_public_ip(resource_group: 'example', name: 'name') do its(name) { should eq 'name'} @@ -11,9 +11,9 @@ class AzurePublicIp < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/publicIPAddresses', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/publicIPAddresses", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -27,8 +27,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermPublicIp < AzurePublicIp - name 'azurerm_public_ip' - desc 'Verifies settings for public IP address' + name "azurerm_public_ip" + desc "Verifies settings for public IP address" example <<-EXAMPLE describe azurerm_public_ip(resource_group: 'example', name: 'name') do its(name) { should eq 'name'} @@ -38,10 +38,10 @@ class AzurermPublicIp < AzurePublicIp def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzurePublicIp.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2020-05-01' + opts[:api_version] ||= "2020-05-01" super end end diff --git a/libraries/azure_redis_cache.rb b/libraries/azure_redis_cache.rb index 5fde573f4..d1c8738ac 100644 --- a/libraries/azure_redis_cache.rb +++ b/libraries/azure_redis_cache.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureRedisCache < AzureGenericResource - name 'azure_redis_cache' - desc 'Verifies settings for a redis cache resource in a resource group' + name "azure_redis_cache" + desc "Verifies settings for a redis cache resource in a resource group" example <<-EXAMPLE describe azure_redis_cache(resource_group: 'rg-1, name: 'cache1') do it { should exist } @@ -10,9 +10,9 @@ class AzureRedisCache < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Cache/redis', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Cache/redis", opts) opts[:resource_identifiers] = %i(name) super(opts, true) end diff --git a/libraries/azure_redis_caches.rb b/libraries/azure_redis_caches.rb index c995f04d6..0ac9b91fc 100644 --- a/libraries/azure_redis_caches.rb +++ b/libraries/azure_redis_caches.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureRedisCaches < AzureGenericResources - name 'azure_redis_caches' - desc 'Verifies settings for a list of redis cache resources in a resource group' + name "azure_redis_caches" + desc "Verifies settings for a list of redis cache resources in a resource group" example <<-EXAMPLE describe azure_redis_caches(resource_group: 'rg-1') do it { should exist } @@ -12,13 +12,13 @@ class AzureRedisCaches < AzureGenericResources attr_reader :table def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Validators.validate_parameters(resource_name: @__resource_name__, required: %i(resource_group), opts: opts) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Cache/redis', opts) - opts[:resource_uri] = ['/resourceGroups', opts[:resource_group], 'providers', opts[:resource_provider]].join('/') + opts[:resource_provider] = specific_resource_constraint("Microsoft.Cache/redis", opts) + opts[:resource_uri] = ["/resourceGroups", opts[:resource_group], "providers", opts[:resource_provider]].join("/") opts[:add_subscription_id] = true super(opts, true) return if failed_resource? diff --git a/libraries/azure_resource_group.rb b/libraries/azure_resource_group.rb index 547aaa902..4a2f2f227 100644 --- a/libraries/azure_resource_group.rb +++ b/libraries/azure_resource_group.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureResourceGroup < AzureGenericResource - name 'azure_resource_group' - desc 'Verifies settings for an Azure resource group' + name "azure_resource_group" + desc "Verifies settings for an Azure resource group" example <<-EXAMPLE describe azure_resource_group(name: 'my_resource_group_name') do it { should exist } @@ -11,11 +11,11 @@ class AzureResourceGroup < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('/resourcegroups/', opts) + opts[:resource_provider] = specific_resource_constraint("/resourcegroups/", opts) # See azure_policy_definitions resource for how to use `resource_uri` and `add_subscription_id` parameters. - opts[:resource_uri] = '/resourcegroups/' + opts[:resource_uri] = "/resourcegroups/" opts[:add_subscription_id] = true # static_resource parameter must be true for setting the resource_provider in the backend. diff --git a/libraries/azure_resource_groups.rb b/libraries/azure_resource_groups.rb index 14481fb76..6b1c1e63b 100644 --- a/libraries/azure_resource_groups.rb +++ b/libraries/azure_resource_groups.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureResourceGroups < AzureGenericResources - name 'azure_resource_groups' - desc 'Fetches all available resource groups' + name "azure_resource_groups" + desc "Fetches all available resource groups" example <<-EXAMPLE describe azure_resource_groups do its('names') { should include('example-group') } @@ -13,11 +13,11 @@ class AzureResourceGroups < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('/resourcegroups/', opts) + opts[:resource_provider] = specific_resource_constraint("/resourcegroups/", opts) # See azure_policy_definitions resource for how to use `resource_uri` and `add_subscription_id` parameters. - opts[:resource_uri] = '/resourcegroups/' + opts[:resource_uri] = "/resourcegroups/" opts[:add_subscription_id] = true # static_resource parameter must be true for setting the resource_provider in the backend. @@ -64,8 +64,8 @@ def populate_table # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermResourceGroups < AzureResourceGroups - name 'azurerm_resource_groups' - desc 'Fetches all available resource groups' + name "azurerm_resource_groups" + desc "Fetches all available resource groups" example <<-EXAMPLE describe azurerm_resource_groups do its('names') { should include('example-group') } @@ -75,10 +75,10 @@ class AzurermResourceGroups < AzureResourceGroups def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureResourceGroups.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2018-02-01' + opts[:api_version] ||= "2018-02-01" super end end diff --git a/libraries/azure_resource_health_availability_status.rb b/libraries/azure_resource_health_availability_status.rb index 56851b5c3..9aaee140f 100644 --- a/libraries/azure_resource_health_availability_status.rb +++ b/libraries/azure_resource_health_availability_status.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureResourceHealthAvailabilityStatus < AzureGenericResource - name 'azure_resource_health_availability_status' - desc 'Retrieves and verifies availability status for a resource.' + name "azure_resource_health_availability_status" + desc "Retrieves and verifies availability status for a resource." example <<-EXAMPLE describe azure_resource_health_availability_status(resource_group: 'large_vms', resource_type: '',name: 'DemoExpensiveVM') do it { should exist } @@ -10,13 +10,13 @@ class AzureResourceHealthAvailabilityStatus < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) resource_type = opts.delete(:resource_type) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ResourceHealth/availabilityStatuses/current', opts) - opts[:resource_uri] = ['resourcegroups', opts[:resource_group], 'providers', resource_type, opts[:name], - 'providers', opts[:resource_provider]].join('/') + opts[:resource_provider] = specific_resource_constraint("Microsoft.ResourceHealth/availabilityStatuses/current", opts) + opts[:resource_uri] = ["resourcegroups", opts[:resource_group], "providers", resource_type, opts[:name], + "providers", opts[:resource_provider]].join("/") opts[:add_subscription_id] = true super(opts, true) end diff --git a/libraries/azure_resource_health_availability_statuses.rb b/libraries/azure_resource_health_availability_statuses.rb index 6c430a9f2..fcb24aff4 100644 --- a/libraries/azure_resource_health_availability_statuses.rb +++ b/libraries/azure_resource_health_availability_statuses.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureResourceHealthAvailabilityStatuses < AzureGenericResources - name 'azure_resource_health_availability_statuses' - desc 'Retrieves and verifies all availability statuses for a resource group' + name "azure_resource_health_availability_statuses" + desc "Retrieves and verifies all availability statuses for a resource group" example <<-EXAMPLE describe azure_resource_health_availability_statuses do it { should exist } @@ -10,9 +10,9 @@ class AzureResourceHealthAvailabilityStatuses < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ResourceHealth/availabilityStatuses', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.ResourceHealth/availabilityStatuses", opts) super(opts, true) return if failed_resource? diff --git a/libraries/azure_resource_health_emerging_issue.rb b/libraries/azure_resource_health_emerging_issue.rb index c9e6e3e3b..78c557ccb 100644 --- a/libraries/azure_resource_health_emerging_issue.rb +++ b/libraries/azure_resource_health_emerging_issue.rb @@ -1,19 +1,19 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureResourceHealthEmergingIssue < AzureGenericResource - name 'azure_resource_health_emerging_issue' - desc 'Verifies a specific Azure service emerging issue' + name "azure_resource_health_emerging_issue" + desc "Verifies a specific Azure service emerging issue" example <<-EXAMPLE - describe azure_resource_health_emerging_issue(name: 'default') do#{' '} + describe azure_resource_health_emerging_issue(name: 'default') do#{" "} it { should exist } end EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ResourceHealth/emergingIssues', opts) - opts[:resource_uri] = ['providers', opts[:resource_provider]].join('/') + opts[:resource_provider] = specific_resource_constraint("Microsoft.ResourceHealth/emergingIssues", opts) + opts[:resource_uri] = ["providers", opts[:resource_provider]].join("/") opts[:add_subscription_id] = false super(opts, true) end diff --git a/libraries/azure_resource_health_emerging_issues.rb b/libraries/azure_resource_health_emerging_issues.rb index 65a73b0b5..b785f754e 100644 --- a/libraries/azure_resource_health_emerging_issues.rb +++ b/libraries/azure_resource_health_emerging_issues.rb @@ -1,19 +1,19 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureResourceHealthEmergingIssues < AzureGenericResources - name 'azure_resource_health_emerging_issues' + name "azure_resource_health_emerging_issues" desc "Lists and verifies Azure services' emerging issues" example <<-EXAMPLE - describe azure_resource_health_emerging_issues do#{' '} + describe azure_resource_health_emerging_issues do#{" "} it { should exist } end EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ResourceHealth/emergingIssues', opts) - opts[:resource_uri] = ['providers', opts[:resource_provider]].join('/') + opts[:resource_provider] = specific_resource_constraint("Microsoft.ResourceHealth/emergingIssues", opts) + opts[:resource_uri] = ["providers", opts[:resource_provider]].join("/") opts[:add_subscription_id] = false super(opts, true) diff --git a/libraries/azure_resource_health_events.rb b/libraries/azure_resource_health_events.rb index fabe9f23e..9e51d65bc 100644 --- a/libraries/azure_resource_health_events.rb +++ b/libraries/azure_resource_health_events.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureResourceHealthEvents < AzureGenericResources - name 'azure_resource_health_events' - desc 'Verifies settings for a collection of Azure Resource Health Events' + name "azure_resource_health_events" + desc "Verifies settings for a collection of Azure Resource Health Events" example <<-EXAMPLE describe azure_resource_health_events do its('names') { should include('role') } @@ -16,15 +16,15 @@ class AzureResourceHealthEvents < AzureGenericResources attr_reader :table def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) resource_type = opts.delete(:resource_type) resource_id = opts.delete(:resource_id) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ResourceHealth/events', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.ResourceHealth/events", opts) if opts.key?(:resource_group) && resource_type && resource_id - opts[:resource_uri] = ['resourcegroups', opts.delete(:resource_group), 'providers', resource_type, resource_id, - 'providers', opts[:resource_provider]].join('/') + opts[:resource_uri] = ["resourcegroups", opts.delete(:resource_group), "providers", resource_type, resource_id, + "providers", opts[:resource_provider]].join("/") opts[:add_subscription_id] = true end super(opts, true) diff --git a/libraries/azure_role_definition.rb b/libraries/azure_role_definition.rb index 5944caafe..c3161aa01 100644 --- a/libraries/azure_role_definition.rb +++ b/libraries/azure_role_definition.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureRoleDefinition < AzureGenericResource - name 'azure_role_definition' - desc 'Verifies settings for an Azure Role' + name "azure_role_definition" + desc "Verifies settings for an Azure Role" example <<-EXAMPLE describe azure_role_definition(name: 'Mail-Account') do it { should exist } @@ -15,10 +15,10 @@ class AzureRoleDefinition < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) - raise ArgumentError, '`resource_group` is not allowed.' if opts.key(:resource_group) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) + raise ArgumentError, "`resource_group` is not allowed." if opts.key(:resource_group) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Authorization/roleDefinitions', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Authorization/roleDefinitions", opts) # See azure_policy_definitions resource for how to use `resource_uri` and `add_subscription_id` parameters. opts[:resource_uri] = "providers/#{opts[:resource_provider]}" opts[:add_subscription_id] = true @@ -43,8 +43,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermRoleDefinition < AzureRoleDefinition - name 'azurerm_role_definition' - desc 'Verifies settings for an Azure Role' + name "azurerm_role_definition" + desc "Verifies settings for an Azure Role" example <<-EXAMPLE describe azurerm_role_definition(name: 'Mail-Account') do it { should exist } @@ -56,10 +56,10 @@ class AzurermRoleDefinition < AzureRoleDefinition def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureRoleDefinition.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2015-07-01' + opts[:api_version] ||= "2015-07-01" super end end diff --git a/libraries/azure_role_definitions.rb b/libraries/azure_role_definitions.rb index 17da7f63c..08cb42f7f 100644 --- a/libraries/azure_role_definitions.rb +++ b/libraries/azure_role_definitions.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureRoleDefinitions < AzureGenericResources - name 'azure_role_definitions' - desc 'Verifies settings for a collection of Azure Roles' + name "azure_role_definitions" + desc "Verifies settings for a collection of Azure Roles" example <<-EXAMPLE describe azure_role_definitions do its('names') { should include('role') } @@ -13,9 +13,9 @@ class AzureRoleDefinitions < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Authorization/roleDefinitions', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Authorization/roleDefinitions", opts) # See azure_policy_definitions resource for how to use `resource_uri` and `add_subscription_id` parameters. opts[:resource_uri] = "providers/#{opts[:resource_provider]}" opts[:add_subscription_id] = true @@ -68,8 +68,8 @@ def populate_table # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermRoleDefinitions < AzureRoleDefinitions - name 'azurerm_role_definitions' - desc 'Verifies settings for a collection of Azure Roles' + name "azurerm_role_definitions" + desc "Verifies settings for a collection of Azure Roles" example <<-EXAMPLE describe azurerm_role_definitions do its('names') { should include('role') } @@ -79,10 +79,10 @@ class AzurermRoleDefinitions < AzureRoleDefinitions def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureRoleDefinitions.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2015-07-01' + opts[:api_version] ||= "2015-07-01" super end end diff --git a/libraries/azure_security_center_policies.rb b/libraries/azure_security_center_policies.rb index 385c3b55d..8af3c8553 100644 --- a/libraries/azure_security_center_policies.rb +++ b/libraries/azure_security_center_policies.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureSecurityCenterPolicies < AzureGenericResources - name 'azure_security_center_policies' - desc 'Verifies settings for Security Center' + name "azure_security_center_policies" + desc "Verifies settings for Security Center" example <<-EXAMPLE describe azure_security_center_policies do its('policy_names') { should include('default') } @@ -12,7 +12,7 @@ class AzureSecurityCenterPolicies < AzureGenericResources attr_reader :table def initialize(opts = {}) - opts[:resource_provider] = 'Microsoft.Security/policies' + opts[:resource_provider] = "Microsoft.Security/policies" # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -41,8 +41,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermSecurityCenterPolicies < AzureSecurityCenterPolicies - name 'azurerm_security_center_policies' - desc 'Verifies settings for Security Center' + name "azurerm_security_center_policies" + desc "Verifies settings for Security Center" example <<-EXAMPLE describe azurerm_security_center_policies do its('policy_names') { should include('default') } @@ -52,10 +52,10 @@ class AzurermSecurityCenterPolicies < AzureSecurityCenterPolicies def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureSecurityCenterPolicies.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2015-06-01-Preview' + opts[:api_version] ||= "2015-06-01-Preview" super end end diff --git a/libraries/azure_security_center_policy.rb b/libraries/azure_security_center_policy.rb index 79129cbf3..d33fa27a1 100644 --- a/libraries/azure_security_center_policy.rb +++ b/libraries/azure_security_center_policy.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureSecurityCenterPolicy < AzureGenericResource - name 'azure_security_center_policy' - desc 'Verifies settings for Security Center' + name "azure_security_center_policy" + desc "Verifies settings for Security Center" example <<-EXAMPLE describe azure_security_center_policy(name: 'default') do its('log_collection') { should eq('On') } @@ -14,21 +14,21 @@ class AzureSecurityCenterPolicy < AzureGenericResource :just_in_time_network_access, :app_whitelisting, :sql_auditing, :sql_transparent_data_encryption, :patch, :contact_emails, :contact_phone, :notifications_enabled, :send_security_email_to_admin - def initialize(opts = { name: 'default' }) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity TODO: Fix these issues. + def initialize(opts = { name: "default" }) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity TODO: Fix these issues. # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Security/policies', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Security/policies", opts) # Default policy does not reside in a resource group. - if opts[:name] == 'default' and opts[:resource_group].nil? - opts[:resource_uri] = 'providers/Microsoft.Security/policies/' + if opts[:name] == "default" and opts[:resource_group].nil? + opts[:resource_uri] = "providers/Microsoft.Security/policies/" opts[:add_subscription_id] = true end opts[:allowed_parameters] = %i(default_policy_api_version auto_provisioning_settings_api_version) - opts[:default_policy_api_version] ||= 'latest' - opts[:auto_provisioning_settings_api_version] ||= 'latest' + opts[:default_policy_api_version] ||= "latest" + opts[:auto_provisioning_settings_api_version] ||= "latest" # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -64,17 +64,17 @@ def to_s def default_policy return unless exists? # This property is relevant to default security policy only. - return unless @opts[:name] == 'default' + return unless @opts[:name] == "default" # This will add the subscription id. endpoint = validate_resource_uri( { add_subscription_id: true, - resource_uri: 'providers/Microsoft.Authorization/policyAssignments/SecurityCenterBuiltIn', + resource_uri: "providers/Microsoft.Authorization/policyAssignments/SecurityCenterBuiltIn", }, ) additional_resource_properties( { - property_name: 'default_policy', + property_name: "default_policy", property_endpoint: endpoint, api_version: @opts[:default_policy_api_version], }, @@ -84,25 +84,25 @@ def default_policy def has_auto_provisioning_enabled? return unless exists? # This property is relevant to default security policy only. - return unless @opts[:name] == 'default' + return unless @opts[:name] == "default" auto_provisioning_settings unless respond_to?(:auto_provisioning_settings) - auto_provisioning_settings&.select { |setting| setting.name == 'default' }&.first&.properties&.autoProvision == 'On' + auto_provisioning_settings&.select { |setting| setting.name == "default" }&.first&.properties&.autoProvision == "On" end def auto_provisioning_settings return unless exists? # This property is relevant to default security policy only. - return unless @opts[:name] == 'default' + return unless @opts[:name] == "default" # This will add the subscription id. endpoint = validate_resource_uri( { add_subscription_id: true, - resource_uri: 'providers/Microsoft.Security/autoProvisioningSettings', + resource_uri: "providers/Microsoft.Security/autoProvisioningSettings", }, ) additional_resource_properties( { - property_name: 'auto_provisioning_settings', + property_name: "auto_provisioning_settings", property_endpoint: endpoint, api_version: @opts[:auto_provisioning_settings_api_version], }, @@ -113,23 +113,23 @@ def auto_provisioning_settings # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermSecurityCenterPolicy < AzureSecurityCenterPolicy - name 'azurerm_security_center_policy' - desc 'Verifies settings for Security Center' + name "azurerm_security_center_policy" + desc "Verifies settings for Security Center" example <<-EXAMPLE describe azurerm_security_center_policy(name: 'default') do its('log_collection') { should eq('On') } end EXAMPLE - def initialize(opts = { name: 'default' }) + def initialize(opts = { name: "default" }) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureSecurityCenterPolicy.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2015-06-01-Preview' - opts[:default_policy_api_version] ||= '2018-05-01' - opts[:auto_provisioning_settings_api_version] ||= '2017-08-01-preview' + opts[:api_version] ||= "2015-06-01-Preview" + opts[:default_policy_api_version] ||= "2018-05-01" + opts[:auto_provisioning_settings_api_version] ||= "2017-08-01-preview" super end end diff --git a/libraries/azure_sentinel_alert_rule.rb b/libraries/azure_sentinel_alert_rule.rb index de9677d34..317f9568c 100644 --- a/libraries/azure_sentinel_alert_rule.rb +++ b/libraries/azure_sentinel_alert_rule.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureSentinelAlertRule < AzureGenericResource - name 'azure_sentinel_alert_rule' - desc 'Verifies settings for an Sentinel Alert Rule' + name "azure_sentinel_alert_rule" + desc "Verifies settings for an Sentinel Alert Rule" example <<-EXAMPLE describe azure_sentinel_alert_rule(resource_group: 'example', workspace_name: 'workspaceName', rule_id: 'rule_id') do it { should exit } @@ -10,11 +10,11 @@ class AzureSentinelAlertRule < AzureGenericResource EXAMPLE def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.OperationalInsights/workspaces', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.OperationalInsights/workspaces", opts) opts[:required_parameters] = %i(workspace_name) - opts[:resource_path] = [opts[:workspace_name], 'providers/Microsoft.SecurityInsights/alertRules/'].join('/') + opts[:resource_path] = [opts[:workspace_name], "providers/Microsoft.SecurityInsights/alertRules/"].join("/") opts[:resource_identifiers] = %i(rule_id) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) diff --git a/libraries/azure_sentinel_alert_rule_template.rb b/libraries/azure_sentinel_alert_rule_template.rb index f5319e019..4f975b839 100644 --- a/libraries/azure_sentinel_alert_rule_template.rb +++ b/libraries/azure_sentinel_alert_rule_template.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureSentinelAlertRuleTemplate < AzureGenericResource - name 'azure_sentinel_alert_rule_template' - desc 'Verifies settings for an Sentinel Alert Rule Template' + name "azure_sentinel_alert_rule_template" + desc "Verifies settings for an Sentinel Alert Rule Template" example <<-EXAMPLE describe azure_alert_rule_template(resource_group: 'example', workspace_name: 'workspaceName', alert_rule_template_id: 'alert_rule_template_id') do it { should exit } @@ -11,11 +11,11 @@ class AzureSentinelAlertRuleTemplate < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.OperationalInsights/workspaces', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.OperationalInsights/workspaces", opts) opts[:required_parameters] = %i(workspace_name) - opts[:resource_path] = [opts[:workspace_name], 'providers/Microsoft.SecurityInsights/alertRuleTemplates/'].join('/') + opts[:resource_path] = [opts[:workspace_name], "providers/Microsoft.SecurityInsights/alertRuleTemplates/"].join("/") opts[:resource_identifiers] = %i(alert_rule_template_id) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) diff --git a/libraries/azure_sentinel_alert_rule_templates.rb b/libraries/azure_sentinel_alert_rule_templates.rb index 04efc3d73..718d44546 100644 --- a/libraries/azure_sentinel_alert_rule_templates.rb +++ b/libraries/azure_sentinel_alert_rule_templates.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureSentinelAlertRuleTemplates < AzureGenericResources - name 'azure_sentinel_alert_rule_templates' - desc 'Verifies settings for Azure Alert Rule Templates' + name "azure_sentinel_alert_rule_templates" + desc "Verifies settings for Azure Alert Rule Templates" example <<-EXAMPLE azure_alert_rule_templates(resource_group: 'example', workspace_name: 'workspaceName') do it{ should exist } @@ -13,11 +13,11 @@ class AzureSentinelAlertRuleTemplates < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.OperationalInsights/workspaces', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.OperationalInsights/workspaces", opts) opts[:required_parameters] = %i(workspace_name) - opts[:resource_path] = [opts[:workspace_name], 'providers/Microsoft.SecurityInsights/alertRuleTemplates/'].join('/') + opts[:resource_path] = [opts[:workspace_name], "providers/Microsoft.SecurityInsights/alertRuleTemplates/"].join("/") # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) diff --git a/libraries/azure_sentinel_alert_rules.rb b/libraries/azure_sentinel_alert_rules.rb index 48d3141f7..fef692635 100644 --- a/libraries/azure_sentinel_alert_rules.rb +++ b/libraries/azure_sentinel_alert_rules.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureSentinelAlertRules < AzureGenericResources - name 'azure_sentinel_alert_rules' - desc 'Verifies settings for Azure Alert Rule' + name "azure_sentinel_alert_rules" + desc "Verifies settings for Azure Alert Rule" example <<-EXAMPLE azure_sentinel_alert_rules(resource_group: 'example', workspace_name: 'workspaceName') do it{ should exist } @@ -13,11 +13,11 @@ class AzureSentinelAlertRules < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.OperationalInsights/workspaces', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.OperationalInsights/workspaces", opts) opts[:required_parameters] = %i(workspace_name) - opts[:resource_path] = [opts[:workspace_name], 'providers/Microsoft.SecurityInsights/alertRules/'].join('/') + opts[:resource_path] = [opts[:workspace_name], "providers/Microsoft.SecurityInsights/alertRules/"].join("/") # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) # Check if the resource is failed. diff --git a/libraries/azure_sentinel_incidents_resource.rb b/libraries/azure_sentinel_incidents_resource.rb index fa4495e94..6e0c6ab37 100644 --- a/libraries/azure_sentinel_incidents_resource.rb +++ b/libraries/azure_sentinel_incidents_resource.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureSentinelIncidentsResource < AzureGenericResource - name 'azure_sentinel_incidents_resource' - desc 'get azure gateway unr ta factory.' + name "azure_sentinel_incidents_resource" + desc "get azure gateway unr ta factory." example <<-EXAMPLE describe azure_sentinel_incidents_resource(resource_group: resource_group, workspace_name: workspace_name, incident_id: incident_id) do it { should exist } @@ -11,16 +11,16 @@ class AzureSentinelIncidentsResource < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # # Azure REST API endpoint URL format for the resource: # GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ # providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/ # providers/Microsoft.SecurityInsights/incidents/{incidentId}?api-version=2021-04-01 # - opts[:resource_provider] = specific_resource_constraint('Microsoft.OperationalInsights/workspaces', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.OperationalInsights/workspaces", opts) opts[:required_parameters] = %i(workspace_name) - opts[:resource_path] = [opts[:workspace_name], 'providers/Microsoft.SecurityInsights/incidents/'].join('/') + opts[:resource_path] = [opts[:workspace_name], "providers/Microsoft.SecurityInsights/incidents/"].join("/") opts[:resource_identifiers] = %i(incident_id) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) diff --git a/libraries/azure_sentinel_incidents_resources.rb b/libraries/azure_sentinel_incidents_resources.rb index 90a0885a5..c67f7d2e2 100644 --- a/libraries/azure_sentinel_incidents_resources.rb +++ b/libraries/azure_sentinel_incidents_resources.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureSentinelIncidentsResources < AzureGenericResources - name 'azure_sentinel_incidents_resources' - desc 'List azure pipelines by data factory.' + name "azure_sentinel_incidents_resources" + desc "List azure pipelines by data factory." example <<-EXAMPLE describe azure_sentinel_incidents_resources(resource_group: resource_group, workspace_name: workspace_name) do it { should exist } @@ -11,14 +11,14 @@ class AzureSentinelIncidentsResources < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Azure REST API endpoint URL format for the resource: # GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ # providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/ # providers/Microsoft.SecurityInsights/incidents?api-version=2021-04-01 - opts[:resource_provider] = specific_resource_constraint('Microsoft.OperationalInsights/workspaces', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.OperationalInsights/workspaces", opts) opts[:required_parameters] = %i(workspace_name) - opts[:resource_path] = [opts[:workspace_name], 'providers/Microsoft.SecurityInsights/incidents'].join('/') + opts[:resource_path] = [opts[:workspace_name], "providers/Microsoft.SecurityInsights/incidents"].join("/") # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) # Check if the resource is failed. diff --git a/libraries/azure_service_bus_namespace.rb b/libraries/azure_service_bus_namespace.rb index a04671cfb..2dc9841df 100644 --- a/libraries/azure_service_bus_namespace.rb +++ b/libraries/azure_service_bus_namespace.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureServiceBusNamespace < AzureGenericResource - name 'azure_service_bus_namespace' - desc 'Retrieves and verifies the settings of an Azure Service Bus Namespace.' + name "azure_service_bus_namespace" + desc "Retrieves and verifies the settings of an Azure Service Bus Namespace." example <<-EXAMPLE describe azure_service_bus_namespace(resource_group: 'migrated_vms', name: 'inspec_ns') do it { should exist } @@ -10,9 +10,9 @@ class AzureServiceBusNamespace < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ServiceBus/namespaces', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.ServiceBus/namespaces", opts) super(opts, true) end diff --git a/libraries/azure_service_bus_namespaces.rb b/libraries/azure_service_bus_namespaces.rb index 90456eabb..b12accc58 100644 --- a/libraries/azure_service_bus_namespaces.rb +++ b/libraries/azure_service_bus_namespaces.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureServiceBusNamespaces < AzureGenericResources - name 'azure_service_bus_namespaces' - desc 'Verifies settings for a collection of Azure Service Bus Namespaces in a Resource Group' + name "azure_service_bus_namespaces" + desc "Verifies settings for a collection of Azure Service Bus Namespaces in a Resource Group" example <<-EXAMPLE describe azure_service_bus_namespaces(resource_group: 'migrated_vms') do it { should exist } @@ -10,9 +10,9 @@ class AzureServiceBusNamespaces < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ServiceBus/namespaces', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.ServiceBus/namespaces", opts) super(opts, true) return if failed_resource? diff --git a/libraries/azure_service_bus_regions.rb b/libraries/azure_service_bus_regions.rb index d4c70705a..f2078d777 100644 --- a/libraries/azure_service_bus_regions.rb +++ b/libraries/azure_service_bus_regions.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureServiceBusRegions < AzureGenericResources - name 'azure_service_bus_regions' - desc 'Verifies settings for a collection of Azure Service Bus regions in a Resource Group' + name "azure_service_bus_regions" + desc "Verifies settings for a collection of Azure Service Bus regions in a Resource Group" example <<-EXAMPLE describe azure_service_bus_regions(sku: 'Standard') do it { should exist } @@ -10,9 +10,9 @@ class AzureServiceBusRegions < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ServiceBus/sku', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.ServiceBus/sku", opts) opts[:required_parameters] = %i(sku) opts[:resource_path] = "#{opts[:sku]}/regions" super(opts, true) diff --git a/libraries/azure_service_bus_subscription.rb b/libraries/azure_service_bus_subscription.rb index 8cc2fc915..1503314be 100644 --- a/libraries/azure_service_bus_subscription.rb +++ b/libraries/azure_service_bus_subscription.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureServiceBusSubscription < AzureGenericResource - name 'azure_service_bus_subscription' - desc 'Retrieves and verifies the settings of an Azure Service Bus Subscription.' + name "azure_service_bus_subscription" + desc "Retrieves and verifies the settings of an Azure Service Bus Subscription." example <<-EXAMPLE describe azure_service_bus_subscription(resource_group: 'inspec-rg', namespace_name: 'inspec-ns', topic_name: 'inspec-topic', name: 'inspec-sub') do it { should exist } @@ -10,9 +10,9 @@ class AzureServiceBusSubscription < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ServiceBus/namespaces', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.ServiceBus/namespaces", opts) opts[:required_parameters] = %i(namespace_name topic_name subscription_name) opts[:resource_path] = "#{opts[:namespace_name]}/topics/#{opts[:topic_name]}/subscriptions/#{opts[:subscription_name]}" super(opts, true) diff --git a/libraries/azure_service_bus_subscription_rule.rb b/libraries/azure_service_bus_subscription_rule.rb index c5bda0a52..296f8f844 100644 --- a/libraries/azure_service_bus_subscription_rule.rb +++ b/libraries/azure_service_bus_subscription_rule.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureServiceBusSubscriptionRule < AzureGenericResource - name 'azure_service_bus_subscription_rule' - desc 'Retrieves and verifies the settings of an Azure Service Bus Subscription Rule.' + name "azure_service_bus_subscription_rule" + desc "Retrieves and verifies the settings of an Azure Service Bus Subscription Rule." example <<-EXAMPLE describe azure_service_bus_subscription_rule(resource_group: 'inspec-rg', namespace_name: 'inspec-ns', topic_name: 'inspec-topic', subscription_name: 'inspec-sub', name: 'inspec_rule1') do it { should exist } @@ -10,9 +10,9 @@ class AzureServiceBusSubscriptionRule < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ServiceBus/namespaces', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.ServiceBus/namespaces", opts) opts[:required_parameters] = %i(namespace_name topic_name subscription_name) opts[:resource_path] = "#{opts[:namespace_name]}/topics/#{opts[:topic_name]}/subscriptions/#{opts[:subscription_name]}/rules" super(opts, true) diff --git a/libraries/azure_service_bus_subscription_rules.rb b/libraries/azure_service_bus_subscription_rules.rb index 1fa2ecfe0..5dc1f77ed 100644 --- a/libraries/azure_service_bus_subscription_rules.rb +++ b/libraries/azure_service_bus_subscription_rules.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureServiceBusSubscriptionRules < AzureGenericResources - name 'azure_service_bus_subscription_rules' - desc 'Verifies settings for a collection of Azure Service Bus Subscription Rules in a Resource Group.' + name "azure_service_bus_subscription_rules" + desc "Verifies settings for a collection of Azure Service Bus Subscription Rules in a Resource Group." example <<-EXAMPLE describe azure_service_bus_subscription_rules(resource_group: 'inspec-rg', namespace_name: 'inspec-ns', subscription_name: 'inspec-subs', topic_name: 'inspec-topic') do it { should exist } @@ -10,9 +10,9 @@ class AzureServiceBusSubscriptionRules < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ServiceBus/namespaces', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.ServiceBus/namespaces", opts) opts[:required_parameters] = %i(namespace_name topic_name subscription_name) opts[:resource_path] = "#{opts[:namespace_name]}/topics/#{opts[:topic_name]}/subscriptions/#{opts[:subscription_name]}/rules" super(opts, true) diff --git a/libraries/azure_service_bus_subscriptions.rb b/libraries/azure_service_bus_subscriptions.rb index 40a3e2103..243a8ce79 100644 --- a/libraries/azure_service_bus_subscriptions.rb +++ b/libraries/azure_service_bus_subscriptions.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureServiceBusSubscriptions < AzureGenericResources - name 'azure_service_bus_subscriptions' - desc 'Verifies settings for a collection of Azure Service Bus Subscriptions in a Resource Group.' + name "azure_service_bus_subscriptions" + desc "Verifies settings for a collection of Azure Service Bus Subscriptions in a Resource Group." example <<-EXAMPLE describe azure_service_bus_subscriptions(resource_group: 'inspec-rg', namespace_name: 'inspec-ns', topic_name: 'inspec-topic') do it { should exist } @@ -10,9 +10,9 @@ class AzureServiceBusSubscriptions < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ServiceBus/namespaces', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.ServiceBus/namespaces", opts) opts[:required_parameters] = %i(namespace_name topic_name) opts[:resource_path] = "#{opts[:namespace_name]}/topics/#{opts[:topic_name]}/subscriptions" super(opts, true) diff --git a/libraries/azure_service_bus_topic.rb b/libraries/azure_service_bus_topic.rb index 6a65d9d67..dfc16abfe 100644 --- a/libraries/azure_service_bus_topic.rb +++ b/libraries/azure_service_bus_topic.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureServiceBusTopic < AzureGenericResource - name 'azure_service_bus_topic' - desc 'Retrieves and verifies the settings of an Azure Service Bus Topic.' + name "azure_service_bus_topic" + desc "Retrieves and verifies the settings of an Azure Service Bus Topic." example <<-EXAMPLE describe azure_service_bus_topic(resource_group: 'inspec-group', namespace_name: 'inspec-ns', name: 'inspec-topic') do it { should exist } @@ -10,9 +10,9 @@ class AzureServiceBusTopic < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ServiceBus/namespaces', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.ServiceBus/namespaces", opts) opts[:required_parameters] = %i(namespace_name) opts[:resource_path] = "#{opts[:namespace_name]}/topics" super(opts, true) diff --git a/libraries/azure_service_bus_topics.rb b/libraries/azure_service_bus_topics.rb index b31894845..e01e68ba4 100644 --- a/libraries/azure_service_bus_topics.rb +++ b/libraries/azure_service_bus_topics.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureServiceBusTopics < AzureGenericResources - name 'azure_service_bus_topics' - desc 'Verifies settings for a collection of Azure Service Bus Topics.' + name "azure_service_bus_topics" + desc "Verifies settings for a collection of Azure Service Bus Topics." example <<-EXAMPLE describe azure_service_bus_topics(resource_group: 'inspec-group', namespace_name: 'inspec-ns') do it { should exist } @@ -10,9 +10,9 @@ class AzureServiceBusTopics < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ServiceBus/namespaces', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.ServiceBus/namespaces", opts) opts[:required_parameters] = %i(namespace_name) opts[:resource_path] = "#{opts[:namespace_name]}/topics" super(opts, true) diff --git a/libraries/azure_service_fabric_mesh_application.rb b/libraries/azure_service_fabric_mesh_application.rb index a9de99abd..c65e019bb 100644 --- a/libraries/azure_service_fabric_mesh_application.rb +++ b/libraries/azure_service_fabric_mesh_application.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureServiceFabricMeshApplication < AzureGenericResource - name 'azure_service_fabric_mesh_application' - desc 'Retrieves and verifies the settings of an Azure Service Fabric Mesh Application.' + name "azure_service_fabric_mesh_application" + desc "Retrieves and verifies the settings of an Azure Service Fabric Mesh Application." example <<-EXAMPLE describe azure_service_fabric_mesh_application(resource_group: 'inspec-def-rg', name: 'fabric-app') do it { should exist } @@ -10,9 +10,9 @@ class AzureServiceFabricMeshApplication < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ServiceFabricMesh/applications', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.ServiceFabricMesh/applications", opts) super(opts, true) end diff --git a/libraries/azure_service_fabric_mesh_applications.rb b/libraries/azure_service_fabric_mesh_applications.rb index b0463fd2a..8c81c04e4 100644 --- a/libraries/azure_service_fabric_mesh_applications.rb +++ b/libraries/azure_service_fabric_mesh_applications.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureServiceFabricMeshApplications < AzureGenericResources - name 'azure_service_fabric_mesh_applications' - desc 'Verifies settings for a collection of Azure Service Fabric Mesh Applications' + name "azure_service_fabric_mesh_applications" + desc "Verifies settings for a collection of Azure Service Fabric Mesh Applications" example <<-EXAMPLE describe azure_service_fabric_mesh_applications do it { should exist } @@ -10,9 +10,9 @@ class AzureServiceFabricMeshApplications < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ServiceFabricMesh/applications', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.ServiceFabricMesh/applications", opts) super(opts, true) return if failed_resource? diff --git a/libraries/azure_service_fabric_mesh_network.rb b/libraries/azure_service_fabric_mesh_network.rb index 80fa4449d..2d06463f3 100644 --- a/libraries/azure_service_fabric_mesh_network.rb +++ b/libraries/azure_service_fabric_mesh_network.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureServiceFabricMeshNetwork < AzureGenericResource - name 'azure_service_fabric_mesh_network' - desc 'Retrieves and verifies the settings of an Azure Service Fabric Mesh Network.' + name "azure_service_fabric_mesh_network" + desc "Retrieves and verifies the settings of an Azure Service Fabric Mesh Network." example <<-EXAMPLE describe azure_service_fabric_mesh_network(resource_group: 'inspec-rg', name: 'fabric-vol') do it { should exist } @@ -10,9 +10,9 @@ class AzureServiceFabricMeshNetwork < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ServiceFabricMesh/networks', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.ServiceFabricMesh/networks", opts) super(opts, true) end diff --git a/libraries/azure_service_fabric_mesh_networks.rb b/libraries/azure_service_fabric_mesh_networks.rb index 06fad321a..ebc3107bd 100644 --- a/libraries/azure_service_fabric_mesh_networks.rb +++ b/libraries/azure_service_fabric_mesh_networks.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureServiceFabricMeshNetworks < AzureGenericResources - name 'azure_service_fabric_mesh_networks' - desc 'Verifies settings for a collection of Azure Service Fabric Mesh Networks' + name "azure_service_fabric_mesh_networks" + desc "Verifies settings for a collection of Azure Service Fabric Mesh Networks" example <<-EXAMPLE describe azure_service_fabric_mesh_networks do it { should exist } @@ -10,9 +10,9 @@ class AzureServiceFabricMeshNetworks < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ServiceFabricMesh/networks', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.ServiceFabricMesh/networks", opts) super(opts, true) return if failed_resource? diff --git a/libraries/azure_service_fabric_mesh_replica.rb b/libraries/azure_service_fabric_mesh_replica.rb index c6d49e2b4..8479e3b0e 100644 --- a/libraries/azure_service_fabric_mesh_replica.rb +++ b/libraries/azure_service_fabric_mesh_replica.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureServiceFabricMeshReplica < AzureGenericResource - name 'azure_service_fabric_mesh_replica' - desc 'Retrieves and verifies the settings of an Azure Service Fabric Mesh Service Replicas' + name "azure_service_fabric_mesh_replica" + desc "Retrieves and verifies the settings of an Azure Service Fabric Mesh Service Replicas" example <<-EXAMPLE describe azure_service_fabric_mesh_replica(resource_group: 'inspec-def-rg', application_name: 'inspec-fabric-app-name', service_name: 'inspec-fabric-svc', name: 'fabric-replica') do it { should exist } @@ -10,10 +10,10 @@ class AzureServiceFabricMeshReplica < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ServiceFabricMesh/applications', opts) - opts[:resource_path] = [opts[:application_name], 'services', opts[:service_name], 'replicas'].join('/') + opts[:resource_provider] = specific_resource_constraint("Microsoft.ServiceFabricMesh/applications", opts) + opts[:resource_path] = [opts[:application_name], "services", opts[:service_name], "replicas"].join("/") super(opts, true) end diff --git a/libraries/azure_service_fabric_mesh_replicas.rb b/libraries/azure_service_fabric_mesh_replicas.rb index f058ca562..f164f891a 100644 --- a/libraries/azure_service_fabric_mesh_replicas.rb +++ b/libraries/azure_service_fabric_mesh_replicas.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureServiceFabricMeshReplicas < AzureGenericResources - name 'azure_service_fabric_mesh_replicas' - desc 'Verifies settings for a collection of Azure Service Fabric Mesh Service Replicas' + name "azure_service_fabric_mesh_replicas" + desc "Verifies settings for a collection of Azure Service Fabric Mesh Service Replicas" example <<-EXAMPLE describe azure_service_fabric_mesh_replicas(resource_group: 'inspec-def-rg', application_name: 'inspec-fabric-app-name', service_name: 'inspec-fabric-svc') do it { should exist } @@ -10,10 +10,10 @@ class AzureServiceFabricMeshReplicas < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ServiceFabricMesh/applications', opts) - opts[:resource_path] = [opts[:application_name], 'services', opts[:service_name], 'replicas'].join('/') + opts[:resource_provider] = specific_resource_constraint("Microsoft.ServiceFabricMesh/applications", opts) + opts[:resource_path] = [opts[:application_name], "services", opts[:service_name], "replicas"].join("/") super(opts, true) return if failed_resource? diff --git a/libraries/azure_service_fabric_mesh_service.rb b/libraries/azure_service_fabric_mesh_service.rb index 961b4e112..934e10584 100644 --- a/libraries/azure_service_fabric_mesh_service.rb +++ b/libraries/azure_service_fabric_mesh_service.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureServiceFabricMeshService < AzureGenericResource - name 'azure_service_fabric_mesh_service' - desc 'Retrieves and verifies the settings of an Azure Service Fabric Mesh Service.' + name "azure_service_fabric_mesh_service" + desc "Retrieves and verifies the settings of an Azure Service Fabric Mesh Service." example <<-EXAMPLE describe azure_service_fabric_mesh_service(application_name: 'fabric-svc', name: 'svc') do it { should exist } @@ -10,10 +10,10 @@ class AzureServiceFabricMeshService < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ServiceFabricMesh/applications', opts) - opts[:resource_path] = [opts[:application_name], 'services'].join('/') + opts[:resource_provider] = specific_resource_constraint("Microsoft.ServiceFabricMesh/applications", opts) + opts[:resource_path] = [opts[:application_name], "services"].join("/") super(opts, true) end diff --git a/libraries/azure_service_fabric_mesh_services.rb b/libraries/azure_service_fabric_mesh_services.rb index 9672c8a44..e3f25e40a 100644 --- a/libraries/azure_service_fabric_mesh_services.rb +++ b/libraries/azure_service_fabric_mesh_services.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureServiceFabricMeshServices < AzureGenericResources - name 'azure_service_fabric_mesh_services' - desc 'Verifies settings for a collection of Azure Service Fabric Mesh Services' + name "azure_service_fabric_mesh_services" + desc "Verifies settings for a collection of Azure Service Fabric Mesh Services" example <<-EXAMPLE describe azure_service_fabric_mesh_services(application_name: 'fabric-svc') do it { should exist } @@ -10,10 +10,10 @@ class AzureServiceFabricMeshServices < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ServiceFabricMesh/applications', opts) - opts[:resource_path] = [opts[:application_name], 'services'].join('/') + opts[:resource_provider] = specific_resource_constraint("Microsoft.ServiceFabricMesh/applications", opts) + opts[:resource_path] = [opts[:application_name], "services"].join("/") super(opts, true) return if failed_resource? diff --git a/libraries/azure_service_fabric_mesh_volume.rb b/libraries/azure_service_fabric_mesh_volume.rb index 4eafd6367..e65c93f0c 100644 --- a/libraries/azure_service_fabric_mesh_volume.rb +++ b/libraries/azure_service_fabric_mesh_volume.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureServiceFabricMeshVolume < AzureGenericResource - name 'azure_service_fabric_mesh_volume' - desc 'Retrieves and verifies the settings of an Azure Service Fabric Mesh Application.' + name "azure_service_fabric_mesh_volume" + desc "Retrieves and verifies the settings of an Azure Service Fabric Mesh Application." example <<-EXAMPLE describe azure_service_fabric_mesh_volume(name: 'fabric-vol') do it { should exist } @@ -10,9 +10,9 @@ class AzureServiceFabricMeshVolume < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ServiceFabricMesh/volumes', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.ServiceFabricMesh/volumes", opts) super(opts, true) end diff --git a/libraries/azure_service_fabric_mesh_volumes.rb b/libraries/azure_service_fabric_mesh_volumes.rb index 01e72fb12..e37303cb2 100644 --- a/libraries/azure_service_fabric_mesh_volumes.rb +++ b/libraries/azure_service_fabric_mesh_volumes.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureServiceFabricMeshVolumes < AzureGenericResources - name 'azure_service_fabric_mesh_volumes' - desc 'Verifies settings for a collection of Azure Service Fabric Mesh Volumes' + name "azure_service_fabric_mesh_volumes" + desc "Verifies settings for a collection of Azure Service Fabric Mesh Volumes" example <<-EXAMPLE describe azure_service_fabric_mesh_volumes do it { should exist } @@ -10,9 +10,9 @@ class AzureServiceFabricMeshVolumes < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.ServiceFabricMesh/volumes', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.ServiceFabricMesh/volumes", opts) super(opts, true) return if failed_resource? diff --git a/libraries/azure_snapshot.rb b/libraries/azure_snapshot.rb index 3e0b61005..db45141c1 100644 --- a/libraries/azure_snapshot.rb +++ b/libraries/azure_snapshot.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureSnapshot < AzureGenericResource - name 'azure_snapshot' - desc 'Retrieves and verifies the settings of an Azure Snapshot' + name "azure_snapshot" + desc "Retrieves and verifies the settings of an Azure Snapshot" example <<-EXAMPLE describe azure_snapshot(resource_group: 'rg-1', name: 'my-snapshot-name') do it { should exist } @@ -11,9 +11,9 @@ class AzureSnapshot < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Compute/snapshots', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Compute/snapshots", opts) opts[:resource_identifiers] = %i(snapshot_name) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) diff --git a/libraries/azure_snapshots.rb b/libraries/azure_snapshots.rb index b059cf45b..d290e82be 100644 --- a/libraries/azure_snapshots.rb +++ b/libraries/azure_snapshots.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureSnapshots < AzureGenericResources - name 'azure_snapshots' - desc 'List Azure Snapshots' + name "azure_snapshots" + desc "List Azure Snapshots" example <<-EXAMPLE describe azure_snapshots do it { should exist } @@ -13,9 +13,9 @@ class AzureSnapshots < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Compute/snapshots', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Compute/snapshots", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) diff --git a/libraries/azure_sql_database.rb b/libraries/azure_sql_database.rb index 6b9c5d8c5..13d0c7d6d 100644 --- a/libraries/azure_sql_database.rb +++ b/libraries/azure_sql_database.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureSqlDatabase < AzureGenericResource - name 'azure_sql_database' - desc 'Verifies settings for an Azure SQL Database' + name "azure_sql_database" + desc "Verifies settings for an Azure SQL Database" example <<-EXAMPLE describe azure_sql_database(resource_group: 'rg-1', server_name: 'sql-server-1', name: 'customer-db') do it { should exist } @@ -11,17 +11,17 @@ class AzureSqlDatabase < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Sql/servers', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Sql/servers", opts) opts[:required_parameters] = %i(server_name) - opts[:resource_path] = [opts[:server_name], 'databases'].join('/') + opts[:resource_path] = [opts[:server_name], "databases"].join("/") opts[:resource_identifiers] = %i(database_name) opts[:allowed_parameters] = %i(auditing_settings_api_version threat_detection_settings_api_version encryption_settings_api_version) opts[:allowed_parameters].each do |param| - opts[param] ||= 'latest' + opts[param] ||= "latest" end # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -42,7 +42,7 @@ def auditing_settings return unless exists? additional_resource_properties( { - property_name: 'auditing_settings', + property_name: "auditing_settings", property_endpoint: "#{id}/auditingSettings/default", api_version: @opts[:auditing_settings_api_version], }, @@ -53,7 +53,7 @@ def threat_detection_settings return unless exists? additional_resource_properties( { - property_name: 'threat_detection_settings', + property_name: "threat_detection_settings", property_endpoint: "#{id}/securityAlertPolicies/default", api_version: @opts[:threat_detection_settings_api_version], }, @@ -64,7 +64,7 @@ def encryption_settings return unless exists? additional_resource_properties( { - property_name: 'encryption_settings', + property_name: "encryption_settings", property_endpoint: "#{id}/transparentDataEncryption/current", api_version: @opts[:encryption_settings_api_version], }, @@ -75,8 +75,8 @@ def encryption_settings # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermSqlDatabase < AzureSqlDatabase - name 'azurerm_sql_database' - desc 'Verifies settings for an Azure SQL Database' + name "azurerm_sql_database" + desc "Verifies settings for an Azure SQL Database" example <<-EXAMPLE describe azurerm_sql_database(resource_group: 'rg-1', server_name: 'sql-server-1' database_name: 'customer-db') do it { should exist } @@ -86,13 +86,13 @@ class AzurermSqlDatabase < AzureSqlDatabase def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureSqlDatabase.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2017-10-01-preview' - opts[:auditing_settings_api_version] ||= '2017-03-01-preview' - opts[:threat_detection_settings_api_version] ||= '2014-04-01' - opts[:encryption_settings_api_version] ||= '2014-04-01' + opts[:api_version] ||= "2017-10-01-preview" + opts[:auditing_settings_api_version] ||= "2017-03-01-preview" + opts[:threat_detection_settings_api_version] ||= "2014-04-01" + opts[:encryption_settings_api_version] ||= "2014-04-01" super end end diff --git a/libraries/azure_sql_database_server_vulnerability_assessment.rb b/libraries/azure_sql_database_server_vulnerability_assessment.rb index 82e237958..4a5dd08fd 100644 --- a/libraries/azure_sql_database_server_vulnerability_assessment.rb +++ b/libraries/azure_sql_database_server_vulnerability_assessment.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureSqlDatabaseServerVulnerabilityAssessment < AzureGenericResource - name 'azure_sql_database_server_vulnerability_assessment' - desc 'Verifies settings for an Azure SQL Database Server Vulnerability Assessment.' + name "azure_sql_database_server_vulnerability_assessment" + desc "Verifies settings for an Azure SQL Database Server Vulnerability Assessment." example <<-EXAMPLE describe azure_sql_database_server_vulnerability_assessment(resource_group: 'RESOURCE_GROUP_NAME', server_name: 'SERVER_NAME') do it { should exist } @@ -11,12 +11,12 @@ class AzureSqlDatabaseServerVulnerabilityAssessment < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Sql/servers', opts) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Sql/servers", opts) opts[:required_parameters] = %i(server_name) - opts[:name] = 'default' - opts[:resource_path] = [opts[:server_name], 'vulnerabilityAssessments'].join('/') - opts[:method] = 'get' + opts[:name] = "default" + opts[:resource_path] = [opts[:server_name], "vulnerabilityAssessments"].join("/") + opts[:method] = "get" super(opts, true) end diff --git a/libraries/azure_sql_database_server_vulnerability_assessments.rb b/libraries/azure_sql_database_server_vulnerability_assessments.rb index 7bcb43640..d8bd31c32 100644 --- a/libraries/azure_sql_database_server_vulnerability_assessments.rb +++ b/libraries/azure_sql_database_server_vulnerability_assessments.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureSqlDatabaseServerVulnerabilityAssessments< AzureGenericResources - name 'azure_sql_database_server_vulnerability_assessments' - desc 'Verifies all settings of Azure SQL Database Server Vulnerability Assessment' + name "azure_sql_database_server_vulnerability_assessments" + desc "Verifies all settings of Azure SQL Database Server Vulnerability Assessment" example <<-EXAMPLE describe azure_sql_database_server_vulnerability_assessments(resource_group: 'RESOURCE_GROUP_NAME', server_name: 'SERVER_NAME') do it { should exist } @@ -10,11 +10,11 @@ class AzureSqlDatabaseServerVulnerabilityAssessments< AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Sql/servers', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Sql/servers", opts) opts[:required_parameters] = %i(server_name) - opts[:resource_path] = [opts[:server_name], 'vulnerabilityAssessments'].join('/') + opts[:resource_path] = [opts[:server_name], "vulnerabilityAssessments"].join("/") super(opts, true) diff --git a/libraries/azure_sql_databases.rb b/libraries/azure_sql_databases.rb index abde63a2f..6b499feec 100644 --- a/libraries/azure_sql_databases.rb +++ b/libraries/azure_sql_databases.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureSqlDatabases < AzureGenericResources - name 'azure_sql_databases' - desc 'Verifies settings for a collection of Azure SQL Databases on a SQL Server' + name "azure_sql_databases" + desc "Verifies settings for a collection of Azure SQL Databases on a SQL Server" example <<-EXAMPLE describe azure_sql_databases(resource_group: 'my-rg', server_name: 'server-1') do it { should exist } @@ -14,12 +14,12 @@ class AzureSqlDatabases < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Sql/servers', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Sql/servers", opts) opts[:required_parameters] = %i(resource_group server_name) opts[:display_name] = "Databases on #{opts[:server_name]} SQL Server" - opts[:resource_path] = [opts[:server_name], 'databases'].join('/') + opts[:resource_path] = [opts[:server_name], "databases"].join("/") # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -53,8 +53,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermSqlDatabases < AzureSqlDatabases - name 'azurerm_sql_databases' - desc 'Verifies settings for a collection of Azure SQL Databases on a SQL Server' + name "azurerm_sql_databases" + desc "Verifies settings for a collection of Azure SQL Databases on a SQL Server" example <<-EXAMPLE describe azurerm_sql_databases(resource_group: 'my-rg', server_name: 'server-1') do it { should exist } @@ -65,10 +65,10 @@ class AzurermSqlDatabases < AzureSqlDatabases def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureSqlDatabases.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2017-10-01-preview' + opts[:api_version] ||= "2017-10-01-preview" super end end diff --git a/libraries/azure_sql_managed_instance.rb b/libraries/azure_sql_managed_instance.rb index 735b69ec6..6bc9f0105 100644 --- a/libraries/azure_sql_managed_instance.rb +++ b/libraries/azure_sql_managed_instance.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureSQLManagedInstance < AzureGenericResource - name 'azure_sql_managed_instance' - desc 'Retrieves and verifies the settings of an Azure SQL Managed Instance.' + name "azure_sql_managed_instance" + desc "Retrieves and verifies the settings of an Azure SQL Managed Instance." example <<-EXAMPLE describe azure_sql_managed_instance(resource_group: 'inspec-audit', name: 'inspec-sql-instance') do it { should exist } @@ -10,9 +10,9 @@ class AzureSQLManagedInstance < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Sql/managedInstances', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Sql/managedInstances", opts) super(opts, true) end diff --git a/libraries/azure_sql_managed_instances.rb b/libraries/azure_sql_managed_instances.rb index 287464e94..c81c6453c 100644 --- a/libraries/azure_sql_managed_instances.rb +++ b/libraries/azure_sql_managed_instances.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureSQLManagedInstances < AzureGenericResources - name 'azure_sql_managed_instances' - desc 'Verifies settings for a collection of Azure SQL Managed Instances' + name "azure_sql_managed_instances" + desc "Verifies settings for a collection of Azure SQL Managed Instances" example <<-EXAMPLE describe azure_sql_managed_instances(resource_group: 'migrated_vms') do it { should exist } @@ -10,9 +10,9 @@ class AzureSQLManagedInstances < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Sql/managedInstances', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Sql/managedInstances", opts) super(opts, true) return if failed_resource? diff --git a/libraries/azure_sql_server.rb b/libraries/azure_sql_server.rb index d29928aa8..ca9997485 100644 --- a/libraries/azure_sql_server.rb +++ b/libraries/azure_sql_server.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureSqlServer < AzureGenericResource - name 'azure_sql_server' - desc 'Verifies settings for an Azure SQL Server' + name "azure_sql_server" + desc "Verifies settings for an Azure SQL Server" example <<-EXAMPLE describe azure_sql_server(resource_group: 'rg-1', name: 'my-server-name') do it { should exist } @@ -11,9 +11,9 @@ class AzureSqlServer < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Sql/servers', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Sql/servers", opts) opts[:resource_identifiers] = %i(server_name) opts[:allowed_parameters] = %i(firewall_rules_api_version auditing_settings_api_version threat_detection_settings_api_version administrators_api_version @@ -22,7 +22,7 @@ def initialize(opts = {}) super(opts, true) @opts[:allowed_parameters].each do |param| - @opts[param] ||= 'latest' + @opts[param] ||= "latest" end end @@ -41,7 +41,7 @@ def firewall_rules return unless exists? additional_resource_properties( { - property_name: 'firewall_rules', + property_name: "firewall_rules", property_endpoint: "#{id}/firewallRules", api_version: @opts[:firewall_rules_api_version], }, @@ -52,7 +52,7 @@ def auditing_settings return unless exists? additional_resource_properties( { - property_name: 'auditing_settings', + property_name: "auditing_settings", property_endpoint: "#{id}/auditingSettings/default", api_version: @opts[:auditing_settings_api_version], }, @@ -63,7 +63,7 @@ def threat_detection_settings return unless exists? additional_resource_properties( { - property_name: 'threat_detection_settings', + property_name: "threat_detection_settings", property_endpoint: "#{id}/securityAlertPolicies/Default", api_version: @opts[:threat_detection_settings_api_version], }, @@ -74,7 +74,7 @@ def administrators return unless exists? additional_resource_properties( { - property_name: 'administrators', + property_name: "administrators", property_endpoint: "#{id}/administrators", api_version: @opts[:administrators_api_version], }, @@ -85,7 +85,7 @@ def encryption_protector return unless exists? additional_resource_properties( { - property_name: 'encryption_protector', + property_name: "encryption_protector", property_endpoint: "#{id}/encryptionProtector", api_version: @opts[:encryption_protector_api_version], }, @@ -96,8 +96,8 @@ def encryption_protector # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermSqlServer < AzureSqlServer - name 'azurerm_sql_server' - desc 'Verifies settings for an Azure SQL Server' + name "azurerm_sql_server" + desc "Verifies settings for an Azure SQL Server" example <<-EXAMPLE describe azurerm_sql_server(resource_group: 'rg-1', server_name: 'my-server-name') do it { should exist } @@ -107,15 +107,15 @@ class AzurermSqlServer < AzureSqlServer def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureSqlServer.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2018-06-01-preview' - opts[:firewall_rules_api_version] ||= '2014-04-01' - opts[:auditing_settings_api_version] ||= '2017-03-01-preview' - opts[:threat_detection_settings_api_version] ||= '2017-03-01-preview' - opts[:administrators_api_version] ||= '2014-04-01' - opts[:encryption_protector_api_version] ||= '2015-05-01-preview' + opts[:api_version] ||= "2018-06-01-preview" + opts[:firewall_rules_api_version] ||= "2014-04-01" + opts[:auditing_settings_api_version] ||= "2017-03-01-preview" + opts[:threat_detection_settings_api_version] ||= "2017-03-01-preview" + opts[:administrators_api_version] ||= "2014-04-01" + opts[:encryption_protector_api_version] ||= "2015-05-01-preview" super end end diff --git a/libraries/azure_sql_servers.rb b/libraries/azure_sql_servers.rb index b380a8490..4fe3699d3 100644 --- a/libraries/azure_sql_servers.rb +++ b/libraries/azure_sql_servers.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureSqlServers < AzureGenericResources - name 'azure_sql_servers' - desc 'Verifies settings for a collection of Azure SQL Servers' + name "azure_sql_servers" + desc "Verifies settings for a collection of Azure SQL Servers" example <<-EXAMPLE describe azure_sql_servers do it { should exist } @@ -13,9 +13,9 @@ class AzureSqlServers < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Sql/servers', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Sql/servers", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -50,8 +50,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermSqlServers < AzureSqlServers - name 'azurerm_sql_servers' - desc 'Verifies settings for a collection of Azure SQL Servers' + name "azurerm_sql_servers" + desc "Verifies settings for a collection of Azure SQL Servers" example <<-EXAMPLE describe azurerm_sql_servers do it { should exist } @@ -61,10 +61,10 @@ class AzurermSqlServers < AzureSqlServers def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureSqlServers.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2018-06-01-preview' + opts[:api_version] ||= "2018-06-01-preview" super end end diff --git a/libraries/azure_sql_virtual_machine.rb b/libraries/azure_sql_virtual_machine.rb index d190693a5..e925d73c8 100644 --- a/libraries/azure_sql_virtual_machine.rb +++ b/libraries/azure_sql_virtual_machine.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureSQLVirtualMachine < AzureGenericResource - name 'azure_sql_virtual_machine' - desc 'Retrieves and verifies the settings of an Azure SQL Virtual Machine.' + name "azure_sql_virtual_machine" + desc "Retrieves and verifies the settings of an Azure SQL Virtual Machine." example <<-EXAMPLE describe azure_sql_virtual_machine(resource_group: 'inspec-def-rg', name: 'sql-machine') do it { should exist } @@ -10,9 +10,9 @@ class AzureSQLVirtualMachine < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.SqlVirtualMachine/sqlVirtualMachines', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.SqlVirtualMachine/sqlVirtualMachines", opts) super(opts, true) end diff --git a/libraries/azure_sql_virtual_machine_group.rb b/libraries/azure_sql_virtual_machine_group.rb index 8c26de834..509e1739d 100644 --- a/libraries/azure_sql_virtual_machine_group.rb +++ b/libraries/azure_sql_virtual_machine_group.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureSQLVirtualMachineGroup < AzureGenericResource - name 'azure_sql_virtual_machine_group' - desc 'Retrieves and verifies the settings of an Azure SQL Virtual Machine Group.' + name "azure_sql_virtual_machine_group" + desc "Retrieves and verifies the settings of an Azure SQL Virtual Machine Group." example <<-EXAMPLE describe azure_sql_virtual_machine_group(resource_group: 'inspec-def-rg', name: 'fabric-app') do it { should exist } @@ -10,9 +10,9 @@ class AzureSQLVirtualMachineGroup < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups", opts) super(opts, true) end diff --git a/libraries/azure_sql_virtual_machine_group_availability_listener.rb b/libraries/azure_sql_virtual_machine_group_availability_listener.rb index 46be2a3ba..075623d7e 100644 --- a/libraries/azure_sql_virtual_machine_group_availability_listener.rb +++ b/libraries/azure_sql_virtual_machine_group_availability_listener.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureSQLVirtualMachineGroupAvailabilityListener < AzureGenericResource - name 'azure_sql_virtual_machine_group_availability_listener' - desc 'Retrieves and verifies the settings of an Azure SQL Virtual Machine Group Availability Listener.' + name "azure_sql_virtual_machine_group_availability_listener" + desc "Retrieves and verifies the settings of an Azure SQL Virtual Machine Group Availability Listener." example <<-EXAMPLE describe azure_sql_virtual_machine_group_availability_listener(resource_group: 'inspec-def-rg', sql_virtual_machine_group_name: 'inspec-sql-vm-group', name: 'inspec-avl') do it { should exist } @@ -10,9 +10,9 @@ class AzureSQLVirtualMachineGroupAvailabilityListener < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups", opts) opts[:required_parameters] = %i(sql_virtual_machine_group_name) opts[:resource_path] = "#{opts[:sql_virtual_machine_group_name]}/availabilityGroupListeners" super(opts, true) diff --git a/libraries/azure_sql_virtual_machine_group_availability_listeners.rb b/libraries/azure_sql_virtual_machine_group_availability_listeners.rb index 6f136de64..eb6aae8db 100644 --- a/libraries/azure_sql_virtual_machine_group_availability_listeners.rb +++ b/libraries/azure_sql_virtual_machine_group_availability_listeners.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureSQLVirtualMachineGroupAvailabilityListeners < AzureGenericResources - name 'azure_sql_virtual_machine_group_availability_listeners' - desc 'Verifies settings for a collection of Azure SQL Virtual Machine Group Availability Listeners' + name "azure_sql_virtual_machine_group_availability_listeners" + desc "Verifies settings for a collection of Azure SQL Virtual Machine Group Availability Listeners" example <<-EXAMPLE describe azure_sql_virtual_machine_group_availability_listeners(resource_group: 'inspec-def-rg', sql_virtual_machine_group_name: 'inspec-sql-vm-group') do it { should exist } @@ -10,9 +10,9 @@ class AzureSQLVirtualMachineGroupAvailabilityListeners < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups", opts) opts[:required_parameters] = %i(sql_virtual_machine_group_name) opts[:resource_path] = "#{opts[:sql_virtual_machine_group_name]}/availabilityGroupListeners" super(opts, true) diff --git a/libraries/azure_sql_virtual_machine_groups.rb b/libraries/azure_sql_virtual_machine_groups.rb index 6ca18c6f6..30aa80c27 100644 --- a/libraries/azure_sql_virtual_machine_groups.rb +++ b/libraries/azure_sql_virtual_machine_groups.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureSQLVirtualMachineGroups < AzureGenericResources - name 'azure_sql_virtual_machine_groups' - desc 'Verifies settings for a collection of Azure SQL Virtual Machine Groups' + name "azure_sql_virtual_machine_groups" + desc "Verifies settings for a collection of Azure SQL Virtual Machine Groups" example <<-EXAMPLE describe azure_sql_virtual_machine_groups do it { should exist } @@ -10,9 +10,9 @@ class AzureSQLVirtualMachineGroups < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups", opts) super(opts, true) return if failed_resource? diff --git a/libraries/azure_sql_virtual_machines.rb b/libraries/azure_sql_virtual_machines.rb index 9dee72f70..8389474a9 100644 --- a/libraries/azure_sql_virtual_machines.rb +++ b/libraries/azure_sql_virtual_machines.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureSQLVirtualMachines < AzureGenericResources - name 'azure_sql_virtual_machines' - desc 'Verifies settings for a collection of Azure SQL Virtual Machines' + name "azure_sql_virtual_machines" + desc "Verifies settings for a collection of Azure SQL Virtual Machines" example <<-EXAMPLE describe azure_sql_virtual_machines do it { should exist } @@ -10,9 +10,9 @@ class AzureSQLVirtualMachines < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.SqlVirtualMachine/sqlVirtualMachines', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.SqlVirtualMachine/sqlVirtualMachines", opts) super(opts, true) return if failed_resource? diff --git a/libraries/azure_storage_account.rb b/libraries/azure_storage_account.rb index 498de7e66..f3d7a7219 100644 --- a/libraries/azure_storage_account.rb +++ b/libraries/azure_storage_account.rb @@ -1,9 +1,9 @@ -require 'azure_generic_resource' -require 'active_support/core_ext/hash' +require "azure_generic_resource" +require "active_support/core_ext/hash" class AzureStorageAccount < AzureGenericResource - name 'azure_storage_account' - desc 'Verifies settings for a Azure Storage Account' + name "azure_storage_account" + desc "Verifies settings for a Azure Storage Account" example <<-EXAMPLE describe azure_storage_account(resource_group: 'r-group', name: 'default') do it { should exist } @@ -12,19 +12,19 @@ class AzureStorageAccount < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Storage/storageAccounts', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Storage/storageAccounts", opts) opts[:allowed_parameters] = %i(activity_log_alert_api_version storage_service_endpoint_api_version diagnostic_settings_api_version) # fall-back `api_version` is fixed for now. # TODO: Implement getting the latest Azure Storage services api version - opts[:storage_service_endpoint_api_version] ||= '2019-12-12' - opts[:activity_log_alert_api_version] ||= 'latest' + opts[:storage_service_endpoint_api_version] ||= "2019-12-12" + opts[:activity_log_alert_api_version] ||= "latest" # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) - @opts[:diagnostic_settings_api_version] ||= '2017-05-01-preview' + @opts[:diagnostic_settings_api_version] ||= "2017-05-01-preview" end def to_s @@ -73,10 +73,10 @@ def has_encryption_enabled? def queues return unless exists? url = "https://#{name}.queue#{@azure.storage_endpoint_suffix}" - params = { comp: 'list' } + params = { comp: "list" } # Calls to Azure Storage resources requires a special header `x-ms-version` # https://docs.microsoft.com/en-us/rest/api/storageservices/versioning-for-the-azure-storage-services - headers = { 'x-ms-version' => @opts[:storage_service_endpoint_api_version] } + headers = { "x-ms-version" => @opts[:storage_service_endpoint_api_version] } body = @azure.rest_api_call(url: url, params: params, headers: headers) return unless body body_hash = Hash.from_xml(body) @@ -90,14 +90,14 @@ def queues def queue_properties return unless exists? url = "https://#{name}.queue#{@azure.storage_endpoint_suffix}" - params = { restype: 'service', comp: 'properties' } + params = { restype: "service", comp: "properties" } # @see #queues for the header `x-ms-version` - headers = { 'x-ms-version' => @opts[:storage_service_endpoint_api_version] } + headers = { "x-ms-version" => @opts[:storage_service_endpoint_api_version] } body = @azure.rest_api_call(url: url, params: params, headers: headers) return unless body body_hash = Hash.from_xml(body) hash_with_snakecase_keys = RecursiveMethodHelper.method_recursive(body_hash, :snakecase) - properties = hash_with_snakecase_keys['storage_service_properties'] + properties = hash_with_snakecase_keys["storage_service_properties"] if properties create_resource_methods({ queue_properties: properties }) public_send(:queue_properties) if respond_to?(:queue_properties) @@ -107,10 +107,10 @@ def queue_properties def blobs return unless exists? url = "https://#{name}.blob#{@azure.storage_endpoint_suffix}" - params = { comp: 'list' } + params = { comp: "list" } # Calls to Azure Storage resources requires a special header `x-ms-version` # https://docs.microsoft.com/en-us/rest/api/storageservices/versioning-for-the-azure-storage-services - headers = { 'x-ms-version' => @opts[:storage_service_endpoint_api_version] } + headers = { "x-ms-version" => @opts[:storage_service_endpoint_api_version] } body = @azure.rest_api_call(url: url, params: params, headers: headers) return unless body body_hash = Hash.from_xml(body) @@ -124,14 +124,14 @@ def blobs def blob_properties return unless exists? url = "https://#{name}.blob#{@azure.storage_endpoint_suffix}" - params = { restype: 'service', comp: 'properties' } + params = { restype: "service", comp: "properties" } # @see #queues for the header `x-ms-version` - headers = { 'x-ms-version' => @opts[:storage_service_endpoint_api_version] } + headers = { "x-ms-version" => @opts[:storage_service_endpoint_api_version] } body = @azure.rest_api_call(url: url, params: params, headers: headers) return unless body body_hash = Hash.from_xml(body) hash_with_snakecase_keys = RecursiveMethodHelper.method_recursive(body_hash, :snakecase) - properties = hash_with_snakecase_keys['storage_service_properties'] + properties = hash_with_snakecase_keys["storage_service_properties"] if properties create_resource_methods({ blob_properties: properties }) public_send(:blob_properties) if respond_to?(:blob_properties) @@ -141,14 +141,14 @@ def blob_properties def table_properties return unless exists? url = "https://#{name}.table#{@azure.storage_endpoint_suffix}" - params = { restype: 'service', comp: 'properties' } + params = { restype: "service", comp: "properties" } # @see #queues for the header `x-ms-version` - headers = { 'x-ms-version' => @opts[:storage_service_endpoint_api_version] } + headers = { "x-ms-version" => @opts[:storage_service_endpoint_api_version] } body = @azure.rest_api_call(url: url, params: params, headers: headers) return unless body body_hash = Hash.from_xml(body) hash_with_snakecase_keys = RecursiveMethodHelper.method_recursive(body_hash, :snakecase) - properties = hash_with_snakecase_keys['storage_service_properties'] + properties = hash_with_snakecase_keys["storage_service_properties"] if properties create_resource_methods({ table_properties: properties }) public_send(:table_properties) if respond_to?(:table_properties) @@ -161,7 +161,7 @@ def blobs_diagnostic_settings # and make api response available through this property. additional_resource_properties( { - property_name: 'diagnostic_settings', + property_name: "diagnostic_settings", property_endpoint: "#{id}/blobServices/default/providers/microsoft.insights/diagnosticSettings", api_version: @opts[:diagnostic_settings_api_version], }, @@ -174,7 +174,7 @@ def tables_diagnostic_settings # and make api response available through this property. additional_resource_properties( { - property_name: 'diagnostic_settings', + property_name: "diagnostic_settings", property_endpoint: "#{id}/tableServices/default/providers/microsoft.insights/diagnosticSettings", api_version: @opts[:diagnostic_settings_api_version], }, @@ -187,7 +187,7 @@ def queues_diagnostic_settings # and make api response available through this property. additional_resource_properties( { - property_name: 'diagnostic_settings', + property_name: "diagnostic_settings", property_endpoint: "#{id}/queueServices/default/providers/microsoft.insights/diagnosticSettings", api_version: @opts[:diagnostic_settings_api_version], }, @@ -195,39 +195,39 @@ def queues_diagnostic_settings end def has_blobs_read_log_enabled? - check_enablement_from(settings: blobs_diagnostic_settings, category: 'StorageRead') + check_enablement_from(settings: blobs_diagnostic_settings, category: "StorageRead") end def has_blobs_write_log_enabled? - check_enablement_from(settings: blobs_diagnostic_settings, category: 'StorageWrite') + check_enablement_from(settings: blobs_diagnostic_settings, category: "StorageWrite") end def has_blobs_delete_log_enabled? - check_enablement_from(settings: blobs_diagnostic_settings, category: 'StorageDelete') + check_enablement_from(settings: blobs_diagnostic_settings, category: "StorageDelete") end def has_tables_read_log_enabled? - check_enablement_from(settings: tables_diagnostic_settings, category: 'StorageRead') + check_enablement_from(settings: tables_diagnostic_settings, category: "StorageRead") end def has_tables_write_log_enabled? - check_enablement_from(settings: tables_diagnostic_settings, category: 'StorageWrite') + check_enablement_from(settings: tables_diagnostic_settings, category: "StorageWrite") end def has_tables_delete_log_enabled? - check_enablement_from(settings: tables_diagnostic_settings, category: 'StorageDelete') + check_enablement_from(settings: tables_diagnostic_settings, category: "StorageDelete") end def has_queues_read_log_enabled? - check_enablement_from(settings: queues_diagnostic_settings, category: 'StorageRead') + check_enablement_from(settings: queues_diagnostic_settings, category: "StorageRead") end def has_queues_write_log_enabled? - check_enablement_from(settings: queues_diagnostic_settings, category: 'StorageWrite') + check_enablement_from(settings: queues_diagnostic_settings, category: "StorageWrite") end def has_queues_delete_log_enabled? - check_enablement_from(settings: queues_diagnostic_settings, category: 'StorageDelete') + check_enablement_from(settings: queues_diagnostic_settings, category: "StorageDelete") end private @@ -253,8 +253,8 @@ def activity_log_alert_filter(filter) # and make api response available through this property. additional_resource_properties( { - property_name: 'activity_log_alert_filtered', - property_endpoint: '/providers/microsoft.insights/eventtypes/management/values', + property_name: "activity_log_alert_filtered", + property_endpoint: "/providers/microsoft.insights/eventtypes/management/values", add_subscription_id: true, api_version: @opts[:activity_log_alert_api_version], filter_free_text: filter, @@ -271,8 +271,8 @@ def to_utc(datetime) # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermStorageAccount < AzureStorageAccount - name 'azurerm_storage_account' - desc 'Verifies settings for a Azure Storage Account' + name "azurerm_storage_account" + desc "Verifies settings for a Azure Storage Account" example <<-EXAMPLE describe azurerm_storage_account(resource_group: resource_name, name: 'default') do it { should exist } @@ -282,10 +282,10 @@ class AzurermStorageAccount < AzureStorageAccount def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureStorageAccount.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2017-06-01' + opts[:api_version] ||= "2017-06-01" super end end diff --git a/libraries/azure_storage_account_blob_container.rb b/libraries/azure_storage_account_blob_container.rb index 51c114e8b..9d41e367e 100644 --- a/libraries/azure_storage_account_blob_container.rb +++ b/libraries/azure_storage_account_blob_container.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureStorageAccountBlobContainer < AzureGenericResource - name 'azure_storage_account_blob_container' - desc 'Verifies settings for a Azure Storage Account Blob Container' + name "azure_storage_account_blob_container" + desc "Verifies settings for a Azure Storage Account Blob Container" example <<-EXAMPLE describe azure_storage_account_blob_container(resource_group: 'rg', storage_account_name: 'default', @@ -14,11 +14,11 @@ class AzureStorageAccountBlobContainer < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Storage/storageAccounts', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Storage/storageAccounts", opts) opts[:required_parameters] = %i(storage_account_name) - opts[:resource_path] = [opts[:storage_account_name], 'blobServices/default/containers'].join('/') + opts[:resource_path] = [opts[:storage_account_name], "blobServices/default/containers"].join("/") opts[:resource_identifiers] = %i(blob_container_name) # static_resource parameter must be true for setting the resource_provider in the backend. @@ -33,8 +33,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermStorageAccountBlobContainer < AzureStorageAccountBlobContainer - name 'azurerm_storage_account_blob_container' - desc 'Verifies settings for a Azure Storage Account Blob Container' + name "azurerm_storage_account_blob_container" + desc "Verifies settings for a Azure Storage Account Blob Container" example <<-EXAMPLE describe azurerm_storage_account_blob_container(resource_group: 'rg', storage_account_name: 'default', @@ -47,10 +47,10 @@ class AzurermStorageAccountBlobContainer < AzureStorageAccountBlobContainer def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureStorageAccountBlobContainer.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2018-07-01' + opts[:api_version] ||= "2018-07-01" super end end diff --git a/libraries/azure_storage_account_blob_containers.rb b/libraries/azure_storage_account_blob_containers.rb index a4a3c2dc8..124ae9a41 100644 --- a/libraries/azure_storage_account_blob_containers.rb +++ b/libraries/azure_storage_account_blob_containers.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureStorageAccountBlobContainers < AzureGenericResources - name 'azure_storage_account_blob_containers' - desc 'Fetches all Blob Containers for an Azure Storage Account' + name "azure_storage_account_blob_containers" + desc "Fetches all Blob Containers for an Azure Storage Account" example <<-EXAMPLE describe azure_storage_account_blob_containers(resource_group: 'rg', storage_account_name: 'sa') do its('names') { should include('my_blob_container') } @@ -13,11 +13,11 @@ class AzureStorageAccountBlobContainers < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Storage/storageAccounts', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Storage/storageAccounts", opts) opts[:required_parameters] = %i(resource_group storage_account_name) - opts[:resource_path] = [opts[:storage_account_name], 'blobServices/default/containers'].join('/') + opts[:resource_path] = [opts[:storage_account_name], "blobServices/default/containers"].join("/") # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -49,8 +49,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class StorageAccountBlobContainers < AzureStorageAccountBlobContainers - name 'azurerm_storage_account_blob_containers' - desc 'Fetches all Blob Containers for an Azure Storage Account' + name "azurerm_storage_account_blob_containers" + desc "Fetches all Blob Containers for an Azure Storage Account" example <<-EXAMPLE describe azurerm_storage_account_blob_containers(resource_group: 'rg', storage_account_name: 'sa') do its('names') { should include('my_blob_container') } @@ -60,10 +60,10 @@ class StorageAccountBlobContainers < AzureStorageAccountBlobContainers def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureStorageAccountBlobContainers.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2018-07-01' + opts[:api_version] ||= "2018-07-01" super end end diff --git a/libraries/azure_storage_accounts.rb b/libraries/azure_storage_accounts.rb index 890baeec0..aa6a5d469 100644 --- a/libraries/azure_storage_accounts.rb +++ b/libraries/azure_storage_accounts.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureStorageAccounts < AzureGenericResources - name 'azure_storage_accounts' - desc 'Verifies settings for a collection of Azure Storage Accounts' + name "azure_storage_accounts" + desc "Verifies settings for a collection of Azure Storage Accounts" example <<-EXAMPLE describe azure_storage_accounts do it { should exist } @@ -13,9 +13,9 @@ class AzureStorageAccounts < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Storage/storageAccounts', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Storage/storageAccounts", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -49,8 +49,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermStorageAccounts < AzureStorageAccounts - name 'azurerm_storage_accounts' - desc 'Verifies settings for a collection of Azure Storage Accounts' + name "azurerm_storage_accounts" + desc "Verifies settings for a collection of Azure Storage Accounts" example <<-EXAMPLE describe azurerm_storage_accounts do it { should exist } @@ -60,10 +60,10 @@ class AzurermStorageAccounts < AzureStorageAccounts def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureStorageAccounts.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2017-06-01' + opts[:api_version] ||= "2017-06-01" super end end diff --git a/libraries/azure_streaming_analytic_function.rb b/libraries/azure_streaming_analytic_function.rb index 9cf8747df..64ebccde7 100644 --- a/libraries/azure_streaming_analytic_function.rb +++ b/libraries/azure_streaming_analytic_function.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureStreamingAnalyticsFunction < AzureGenericResource - name 'azure_streaming_analytics_function' - desc 'Verifies settings for an Azure Function Streaming Analytics resource' + name "azure_streaming_analytics_function" + desc "Verifies settings for an Azure Function Streaming Analytics resource" example <<-EXAMPLE describe azure_streaming_analytics_function(resource_group: 'rg-1', function_name: "test", job_name: "test-job") do it { should exist } @@ -11,11 +11,11 @@ class AzureStreamingAnalyticsFunction < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.StreamAnalytics/streamingjobs', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.StreamAnalytics/streamingjobs", opts) opts[:required_parameters] = %i(job_name) - opts[:resource_path] = [opts[:job_name], 'functions'].join('/') + opts[:resource_path] = [opts[:job_name], "functions"].join("/") opts[:resource_identifiers] = %i(function_name) # static_resource parameter must be true for setting the resource_provider in the backend. diff --git a/libraries/azure_streaming_analytics_functions.rb b/libraries/azure_streaming_analytics_functions.rb index 92d50e105..a363cd6b3 100644 --- a/libraries/azure_streaming_analytics_functions.rb +++ b/libraries/azure_streaming_analytics_functions.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureStreamingAnalyticsFunctions< AzureGenericResources - name 'azure_streaming_analytics_functions' - desc 'Verifies settings for an Azure Function Streaming Analytics resource' + name "azure_streaming_analytics_functions" + desc "Verifies settings for an Azure Function Streaming Analytics resource" example <<-EXAMPLE describe azure_streaming_analytics_functions(resource_group: 'rg-1', job_name: "test-job") do it { should exist } @@ -11,11 +11,11 @@ class AzureStreamingAnalyticsFunctions< AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.StreamAnalytics/streamingjobs', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.StreamAnalytics/streamingjobs", opts) opts[:required_parameters] = %i(job_name) - opts[:resource_path] = [opts[:job_name], 'functions'].join('/') + opts[:resource_path] = [opts[:job_name], "functions"].join("/") # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) diff --git a/libraries/azure_subnet.rb b/libraries/azure_subnet.rb index 129adcb62..9897b1dd5 100644 --- a/libraries/azure_subnet.rb +++ b/libraries/azure_subnet.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureSubnet < AzureGenericResource - name 'azure_subnet' - desc 'Verifies settings for an Azure Virtual Network Subnet' + name "azure_subnet" + desc "Verifies settings for an Azure Virtual Network Subnet" example <<-EXAMPLE describe azure_subnet(resource_group: 'example',vnet: 'virtual-network-name' name: 'subnet-name') do it { should exist } @@ -12,7 +12,7 @@ class AzureSubnet < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Azure REST API endpoint URL format for the resource: # GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/ @@ -48,9 +48,9 @@ def initialize(opts = {}) # The `specific_resource_constraint` method will validate the user input # not to accept a different `resource_provider`. # - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/virtualNetworks', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/virtualNetworks", opts) opts[:required_parameters] = %i(vnet) - opts[:resource_path] = [opts[:vnet], 'subnets'].join('/') + opts[:resource_path] = [opts[:vnet], "subnets"].join("/") # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -73,15 +73,15 @@ def address_prefix def nsg return unless exists? return nil unless properties.respond_to?(:networkSecurityGroup) - properties.networkSecurityGroup.id.split('/').last + properties.networkSecurityGroup.id.split("/").last end end # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermSubnet < AzureSubnet - name 'azurerm_subnet' - desc 'Verifies settings for an Azure Virtual Network Subnet' + name "azurerm_subnet" + desc "Verifies settings for an Azure Virtual Network Subnet" example <<-EXAMPLE describe azurerm_subnet(resource_group: 'example',vnet: 'virtual-network-name' name: 'subnet-name') do it { should exist } @@ -92,10 +92,10 @@ class AzurermSubnet < AzureSubnet def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureSubnet.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2018-02-01' + opts[:api_version] ||= "2018-02-01" super end end diff --git a/libraries/azure_subnets.rb b/libraries/azure_subnets.rb index 3dab4db3b..b9025ae65 100644 --- a/libraries/azure_subnets.rb +++ b/libraries/azure_subnets.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureSubnets < AzureGenericResources - name 'azure_subnets' - desc 'Verifies settings for Azure Virtual Network Subnets' + name "azure_subnets" + desc "Verifies settings for Azure Virtual Network Subnets" example <<-EXAMPLE azure_subnets(resource_group: 'example', vnet: 'virtual-network-name') do it{ should exist } @@ -13,7 +13,7 @@ class AzureSubnets < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Azure REST API endpoint URL format listing all subnets in a virtual network: # GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/ @@ -45,11 +45,11 @@ def initialize(opts = {}) # not to accept a different `resource_provider`. # - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/virtualNetworks', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/virtualNetworks", opts) opts[:required_parameters] = %i(resource_group vnet) # Unless provided here, a generic display name will be created in the backend. opts[:display_name] = "Subnets for #{opts[:vnet]} Virtual Network" - opts[:resource_path] = [opts[:vnet], 'subnets'].join('/') + opts[:resource_path] = [opts[:vnet], "subnets"].join("/") # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -79,8 +79,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermSubnets < AzureSubnets - name 'azurerm_subnets' - desc 'Verifies settings for Azure Virtual Network Subnets' + name "azurerm_subnets" + desc "Verifies settings for Azure Virtual Network Subnets" example <<-EXAMPLE azurerm_subnets(resource_group: 'example', vnet: 'virtual-network-name') do it{ should exist } @@ -90,10 +90,10 @@ class AzurermSubnets < AzureSubnets def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureSubnets.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2018-02-01' + opts[:api_version] ||= "2018-02-01" super end end diff --git a/libraries/azure_subscription.rb b/libraries/azure_subscription.rb index 92337d45c..2f81c01ce 100644 --- a/libraries/azure_subscription.rb +++ b/libraries/azure_subscription.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureSubscription < AzureGenericResource - name 'azure_subscription' - desc 'Verifies settings for the current Azure Subscription' + name "azure_subscription" + desc "Verifies settings for the current Azure Subscription" example <<-EXAMPLE describe azure_subscription do its('name') { should eq 'subscription-name' } @@ -12,18 +12,18 @@ class AzureSubscription < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) - raise ArgumentError, 'The `name` parameter is not allowed, use `id`, instead, in the format:'\ - '`1e0b427a-aaaa-bbbb-1111-ee558463ebbf`' if opts.key?(:name) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) + raise ArgumentError, "The `name` parameter is not allowed, use `id`, instead, in the format:"\ + "`1e0b427a-aaaa-bbbb-1111-ee558463ebbf`" if opts.key?(:name) - opts[:resource_provider] = specific_resource_constraint('subscriptions', opts) + opts[:resource_provider] = specific_resource_constraint("subscriptions", opts) # This is an edge case resource where `id` becomes `name` from the backend perspective. # Environment variable will be used unless `id` is provided. - opts[:name] = opts[:id] || ENV['AZURE_SUBSCRIPTION_ID'] - opts[:resource_uri] = '/subscriptions/' + opts[:name] = opts[:id] || ENV["AZURE_SUBSCRIPTION_ID"] + opts[:resource_uri] = "/subscriptions/" opts[:add_subscription_id] = false opts[:allowed_parameters] = %i(locations_api_version id) - opts[:locations_api_version] ||= 'latest' + opts[:locations_api_version] ||= "latest" # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -66,23 +66,23 @@ def physical_locations return unless exists? return unless respond_to?(:locations_list) return unless locations_list.first.respond_to?(:metadata) - locations_list.select { |location| location.metadata&.regionType == 'Physical' }.map(&:name) + locations_list.select { |location| location.metadata&.regionType == "Physical" }.map(&:name) end def logical_locations return unless exists? return unless respond_to?(:locations_list) return unless locations_list.first.respond_to?(:metadata) - locations_list.select { |location| location.metadata&.regionType == 'Logical' }.map(&:name) + locations_list.select { |location| location.metadata&.regionType == "Logical" }.map(&:name) end def diagnostic_settings return unless exists? additional_resource_properties( { - property_name: 'default', + property_name: "default", property_endpoint: "subscriptions/#{id}/providers/microsoft.insights/diagnosticSettings", - api_version: '2017-05-01-preview', + api_version: "2017-05-01-preview", }, ) end @@ -138,7 +138,7 @@ def fetch_locations return unless exists? additional_resource_properties( { - property_name: 'locations_list', + property_name: "locations_list", property_endpoint: "#{id}/locations", api_version: @opts[:locations_api_version], }, @@ -149,8 +149,8 @@ def fetch_locations # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermSubscription < AzureSubscription - name 'azurerm_subscription' - desc 'Verifies settings for the current Azure Subscription' + name "azurerm_subscription" + desc "Verifies settings for the current Azure Subscription" example <<-EXAMPLE describe azurerm_subscription do its('name') { should eq 'subscription-name' } @@ -161,11 +161,11 @@ class AzurermSubscription < AzureSubscription def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureSubscription.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2019-10-01' - opts[:locations_api_version] ||= '2019-10-01' + opts[:api_version] ||= "2019-10-01" + opts[:locations_api_version] ||= "2019-10-01" super end end diff --git a/libraries/azure_subscriptions.rb b/libraries/azure_subscriptions.rb index d581ac692..ee2dd4e2c 100644 --- a/libraries/azure_subscriptions.rb +++ b/libraries/azure_subscriptions.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureSubscriptions < AzureGenericResources - name 'azure_subscriptions' - desc 'Verifies settings for the Azure Subscription within a tenant' + name "azure_subscriptions" + desc "Verifies settings for the Azure Subscription within a tenant" example <<-EXAMPLE describe azure_subscriptions do its('display_names') { should include 'Demo Resources' } @@ -12,9 +12,9 @@ class AzureSubscriptions < AzureGenericResources attr_reader :table def initialize(opts = {}) - opts[:resource_provider] = specific_resource_constraint('/subscriptions/', opts) + opts[:resource_provider] = specific_resource_constraint("/subscriptions/", opts) # See azure_policy_definitions resource for how to use `resource_uri` and `add_subscription_id` parameters. - opts[:resource_uri] = '/subscriptions/' + opts[:resource_uri] = "/subscriptions/" opts[:add_subscription_id] = false # static_resource parameter must be true for setting the resource_provider in the backend. diff --git a/libraries/azure_synapse_notebook.rb b/libraries/azure_synapse_notebook.rb index 3c85987d3..aa4723a40 100644 --- a/libraries/azure_synapse_notebook.rb +++ b/libraries/azure_synapse_notebook.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureSynapseNotebook < AzureGenericResource - name 'azure_synapse_notebook' - desc 'Verifies settings of a Azure Synapse Notebook' + name "azure_synapse_notebook" + desc "Verifies settings of a Azure Synapse Notebook" example <<-EXAMPLE describe azure_synapse_notebook(endpoint: 'https://analytics.dev.azuresynapse.net', name: 'my-analytics-notebook') do it { should exist } @@ -10,14 +10,14 @@ class AzureSynapseNotebook < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Validators.validate_parameters(required: [:endpoint, :name], opts: opts) - endpoint = opts.delete(:endpoint).chomp('/') - opts[:resource_uri] = [endpoint, 'notebooks'].join('/') + endpoint = opts.delete(:endpoint).chomp("/") + opts[:resource_uri] = [endpoint, "notebooks"].join("/") opts[:add_subscription_id] = false opts[:is_uri_a_url] = true - opts[:audience] = 'https://dev.azuresynapse.net/' + opts[:audience] = "https://dev.azuresynapse.net/" super(opts, true) create_resource_methods(@resource_long_desc[:value]&.first) diff --git a/libraries/azure_synapse_notebooks.rb b/libraries/azure_synapse_notebooks.rb index 7aee6821f..2dec87ea8 100644 --- a/libraries/azure_synapse_notebooks.rb +++ b/libraries/azure_synapse_notebooks.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureSynapseNotebooks < AzureGenericResources - name 'azure_synapse_notebooks' - desc 'Verifies settings for the Azure Synapse Notebooks within a tenant' + name "azure_synapse_notebooks" + desc "Verifies settings for the Azure Synapse Notebooks within a tenant" example <<-EXAMPLE describe azure_synapse_notebooks(endpoint: 'https://analytics.dev.azuresynapse.net') do it { should exist } @@ -10,14 +10,14 @@ class AzureSynapseNotebooks < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) Validators.validate_parameters(required: [:endpoint], opts: opts) - endpoint = opts.delete(:endpoint).chomp('/') - opts[:resource_uri] = [endpoint, 'notebooks'].join('/') + endpoint = opts.delete(:endpoint).chomp("/") + opts[:resource_uri] = [endpoint, "notebooks"].join("/") opts[:add_subscription_id] = false opts[:is_uri_a_url] = true - opts[:audience] = 'https://dev.azuresynapse.net/' + opts[:audience] = "https://dev.azuresynapse.net/" super(opts) return if failed_resource? diff --git a/libraries/azure_synapse_workspace.rb b/libraries/azure_synapse_workspace.rb index 16aab084b..9d17de6a7 100644 --- a/libraries/azure_synapse_workspace.rb +++ b/libraries/azure_synapse_workspace.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureSynapseWorkspace < AzureGenericResource - name 'azure_synapse_workspace' - desc 'Retrieves and verifies the settings of an Azure Synapse Workspace.' + name "azure_synapse_workspace" + desc "Retrieves and verifies the settings of an Azure Synapse Workspace." example <<-EXAMPLE describe azure_synapse_workspace(resource_group: 'inspec-def-rg', name: 'synapse-ws') do it { should exist } @@ -10,9 +10,9 @@ class AzureSynapseWorkspace < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Synapse/workspaces', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Synapse/workspaces", opts) super(opts, true) end diff --git a/libraries/azure_synapse_workspaces.rb b/libraries/azure_synapse_workspaces.rb index 772851731..37e495758 100644 --- a/libraries/azure_synapse_workspaces.rb +++ b/libraries/azure_synapse_workspaces.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureSynapseWorkspaces < AzureGenericResources - name 'azure_synapse_workspaces' - desc 'Verifies settings for a collection of Azure Synapse Workspaces' + name "azure_synapse_workspaces" + desc "Verifies settings for a collection of Azure Synapse Workspaces" example <<-EXAMPLE describe azure_synapse_workspaces do it { should exist } @@ -10,9 +10,9 @@ class AzureSynapseWorkspaces < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Synapse/workspaces', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Synapse/workspaces", opts) super(opts, true) return if failed_resource? @@ -28,8 +28,8 @@ def to_s def populate_table @resources.each do |resource| @table << resource.merge(resource[:properties]) - .merge(resource.dig(:properties, :defaultDataLakeStorage)) - .merge(resource.dig(:properties, :connectivityEndpoints)) + .merge(resource.dig(:properties, :defaultDataLakeStorage)) + .merge(resource.dig(:properties, :connectivityEndpoints)) end end end diff --git a/libraries/azure_virtual_machine.rb b/libraries/azure_virtual_machine.rb index f87cc1f92..b12bd7a65 100644 --- a/libraries/azure_virtual_machine.rb +++ b/libraries/azure_virtual_machine.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureVirtualMachine < AzureGenericResource - name 'azure_virtual_machine' - desc 'Verifies settings for an Azure Virtual Machine' + name "azure_virtual_machine" + desc "Verifies settings for an Azure Virtual Machine" example <<-EXAMPLE describe azure_virtual_machine(resource_group: 'example', name: 'vm-name') do it { should have_monitoring_agent_installed } @@ -11,7 +11,7 @@ class AzureVirtualMachine < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Azure REST API endpoint URL format for the resource: # GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/ @@ -40,7 +40,7 @@ def initialize(opts = {}) # The `specific_resource_constraint` method will validate the user input # not to accept a different `resource_provider`. # - opts[:resource_provider] = specific_resource_constraint('Microsoft.Compute/virtualMachines', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Compute/virtualMachines", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -93,7 +93,7 @@ def has_monitoring_agent_installed? return unless exists? return false if resources.nil? resources&.select do |res| - res&.properties&.type == 'MicrosoftMonitoringAgent' && res&.properties&.provisioning_state == 'Succeeded' + res&.properties&.type == "MicrosoftMonitoringAgent" && res&.properties&.provisioning_state == "Succeeded" end resources.size == 1 end @@ -102,8 +102,8 @@ def has_monitoring_agent_installed? # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermVirtualMachine < AzureVirtualMachine - name 'azurerm_virtual_machine' - desc 'Verifies settings for an Azure Virtual Machine' + name "azurerm_virtual_machine" + desc "Verifies settings for an Azure Virtual Machine" example <<-EXAMPLE describe azurerm_virtual_machine(resource_group: 'example', name: 'vm-name') do it { should have_monitoring_agent_installed } @@ -113,10 +113,10 @@ class AzurermVirtualMachine < AzureVirtualMachine def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureVirtualMachine.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2017-12-01' + opts[:api_version] ||= "2017-12-01" super end end diff --git a/libraries/azure_virtual_machine_disk.rb b/libraries/azure_virtual_machine_disk.rb index cefed1135..ae1fd45ae 100644 --- a/libraries/azure_virtual_machine_disk.rb +++ b/libraries/azure_virtual_machine_disk.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureVirtualMachineDisk < AzureGenericResource - name 'azure_virtual_machine_disk' - desc 'Verifies settings for Azure Virtual Machine Disks' + name "azure_virtual_machine_disk" + desc "Verifies settings for Azure Virtual Machine Disks" example <<-EXAMPLE describe azure_virtual_machine_disk(resource_group: 'example', name: 'disk-name') do it{ should exist } @@ -11,9 +11,9 @@ class AzureVirtualMachineDisk < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Compute/disks', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Compute/disks", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -34,7 +34,7 @@ def rest_encryption_type def attached? return unless exists? - properties&.diskState&.eql?('Attached') + properties&.diskState&.eql?("Attached") end def to_s @@ -45,8 +45,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermVirtualMachineDisk < AzureVirtualMachineDisk - name 'azurerm_virtual_machine_disk' - desc 'Verifies settings for Azure Virtual Machine Disks' + name "azurerm_virtual_machine_disk" + desc "Verifies settings for Azure Virtual Machine Disks" example <<-EXAMPLE describe azurerm_virtual_machine_disk(resource_group: 'example', name: 'disk-name') do it{ should exist } @@ -56,10 +56,10 @@ class AzurermVirtualMachineDisk < AzureVirtualMachineDisk def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureVirtualMachineDisk.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2017-03-30' + opts[:api_version] ||= "2017-03-30" super end end diff --git a/libraries/azure_virtual_machine_disks.rb b/libraries/azure_virtual_machine_disks.rb index 1361ff043..0d3289ca0 100644 --- a/libraries/azure_virtual_machine_disks.rb +++ b/libraries/azure_virtual_machine_disks.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureVirtualMachineDisks < AzureGenericResources - name 'azure_virtual_machine_disks' - desc 'Verifies settings for a collection of Azure VM Disks' + name "azure_virtual_machine_disks" + desc "Verifies settings for a collection of Azure VM Disks" example <<-EXAMPLE describe azure_virtual_machine_disks do it { should exist } @@ -13,9 +13,9 @@ class AzureVirtualMachineDisks < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Compute/disks', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Compute/disks", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -57,7 +57,7 @@ def populate_table # This will ensure constructing resource and passing `should_not exist` test. return [] if @resources.empty? @resources.each do |resource| - attached_c = resource[:properties][:diskState].eql?('Attached') + attached_c = resource[:properties][:diskState].eql?("Attached") resource_group_c, _provider, _r_type = Helpers.res_group_provider_type_from_uri(resource[:id]) @table << { @@ -76,8 +76,8 @@ def populate_table # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermVirtualMachineDisks < AzureVirtualMachineDisks - name 'azurerm_virtual_machine_disks' - desc 'Verifies settings for a collection of Azure VM Disks' + name "azurerm_virtual_machine_disks" + desc "Verifies settings for a collection of Azure VM Disks" example <<-EXAMPLE describe azurerm_virtual_machine_disks do it { should exist } @@ -87,10 +87,10 @@ class AzurermVirtualMachineDisks < AzureVirtualMachineDisks def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureVirtualMachineDisks.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2017-03-30' + opts[:api_version] ||= "2017-03-30" super end end diff --git a/libraries/azure_virtual_machines.rb b/libraries/azure_virtual_machines.rb index 9a27b784d..5cc124b59 100644 --- a/libraries/azure_virtual_machines.rb +++ b/libraries/azure_virtual_machines.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureVirtualMachines < AzureGenericResources - name 'azure_virtual_machines' - desc 'Verifies settings for Azure Virtual Machines' + name "azure_virtual_machines" + desc "Verifies settings for Azure Virtual Machines" example <<-EXAMPLE azure_virtual_machines(resource_group: 'example') do it{ should exist } @@ -13,7 +13,7 @@ class AzureVirtualMachines < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Azure REST API endpoint URL format listing the all resources for a given subscription: # GET https://management.azure.com/subscriptions/{subscriptionId}/providers/ @@ -43,7 +43,7 @@ def initialize(opts = {}) # The `specific_resource_constraint` method will validate the user input # not to accept a different `resource_provider`. # - opts[:resource_provider] = specific_resource_constraint('Microsoft.Compute/virtualMachines', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Compute/virtualMachines", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -88,11 +88,11 @@ def populate_table os_profile = resource[:properties][:osProfile] platform = \ if os_profile.key?(:windowsConfiguration) - 'windows' + "windows" elsif os_profile.key?(:linuxConfiguration) - 'linux' + "linux" else - 'unknown' + "unknown" end @table << { id: resource[:id], @@ -109,8 +109,8 @@ def populate_table # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermVirtualMachines < AzureVirtualMachines - name 'azurerm_virtual_machines' - desc 'Verifies settings for Azure Virtual Machines' + name "azurerm_virtual_machines" + desc "Verifies settings for Azure Virtual Machines" example <<-EXAMPLE azurerm_virtual_machines(resource_group: 'example') do it{ should exist } @@ -120,10 +120,10 @@ class AzurermVirtualMachines < AzureVirtualMachines def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureVirtualMachines.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2017-12-01' + opts[:api_version] ||= "2017-12-01" super end end diff --git a/libraries/azure_virtual_network.rb b/libraries/azure_virtual_network.rb index c33092a86..458f5a705 100644 --- a/libraries/azure_virtual_network.rb +++ b/libraries/azure_virtual_network.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureVirtualNetwork < AzureGenericResource - name 'azure_virtual_network' - desc 'Verifies settings for an Azure Virtual Network' + name "azure_virtual_network" + desc "Verifies settings for an Azure Virtual Network" example <<-EXAMPLE describe azure_virtual_network(resource_group: 'example', name: 'vnet-name') do it { should exist } @@ -11,7 +11,7 @@ class AzureVirtualNetwork < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby error will be raised. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Azure REST API endpoint URL format for the resource: # GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers @@ -33,7 +33,7 @@ def initialize(opts = {}) # resource_provider => Microsoft.Network/virtualNetworks # # Either the `resource_id` itself or the necessary parameters should be provided to the backend by calling `super(opts)`. - resource_provider = 'Microsoft.Network/virtualNetworks' + resource_provider = "Microsoft.Network/virtualNetworks" # if opts[:resource_id].nil? # # The resource_id will be created in the backend with the provided parameters. # # @@ -98,8 +98,8 @@ def subnets # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermVirtualNetwork < AzureVirtualNetwork - name 'azurerm_virtual_network' - desc 'Verifies settings for an Azure Virtual Network' + name "azurerm_virtual_network" + desc "Verifies settings for an Azure Virtual Network" example <<-EXAMPLE describe azurerm_virtual_network(resource_group: 'example', name: 'vnet-name') do it { should exist } @@ -109,10 +109,10 @@ class AzurermVirtualNetwork < AzureVirtualNetwork def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureVirtualNetwork.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2018-02-01' + opts[:api_version] ||= "2018-02-01" super end end diff --git a/libraries/azure_virtual_network_gateway.rb b/libraries/azure_virtual_network_gateway.rb index 12cf4d98c..4cda995bc 100644 --- a/libraries/azure_virtual_network_gateway.rb +++ b/libraries/azure_virtual_network_gateway.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureVirtualNetworkGateway < AzureGenericResource - name 'azure_virtual_network_gateway' - desc 'Verifies settings for an Azure Virtual Network Gateway' + name "azure_virtual_network_gateway" + desc "Verifies settings for an Azure Virtual Network Gateway" example <<-EXAMPLE describe azure_virtual_network_gateway(resource_group: 'inspec-default-group', name: 'inspec-vnet') do it{ should exist } @@ -10,8 +10,8 @@ class AzureVirtualNetworkGateway < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/virtualNetworkGateways', opts) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/virtualNetworkGateways", opts) super(opts, true) create_resource_methods(@resource_long_desc[:properties]) diff --git a/libraries/azure_virtual_network_gateway_connection.rb b/libraries/azure_virtual_network_gateway_connection.rb index 4dde03cbf..1754c9955 100644 --- a/libraries/azure_virtual_network_gateway_connection.rb +++ b/libraries/azure_virtual_network_gateway_connection.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureVirtualNetworkGatewayConnection < AzureGenericResource - name 'azure_virtual_network_gateway_connection' - desc 'Verifies settings for an Azure Virtual Network Gateway Connection' + name "azure_virtual_network_gateway_connection" + desc "Verifies settings for an Azure Virtual Network Gateway Connection" example <<-EXAMPLE describe azure_virtual_network_gateway_connection(resource_group: 'inspec-rg', name: 'nw-gw-connection') do it { should exist } @@ -10,8 +10,8 @@ class AzureVirtualNetworkGatewayConnection < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/connections', opts) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/connections", opts) super(opts, true) create_resource_methods(@resource_long_desc[:properties]) diff --git a/libraries/azure_virtual_network_gateway_connections.rb b/libraries/azure_virtual_network_gateway_connections.rb index 8b3cc2982..20ec2d0d7 100644 --- a/libraries/azure_virtual_network_gateway_connections.rb +++ b/libraries/azure_virtual_network_gateway_connections.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureVirtualNetworkGatewayConnections < AzureGenericResources - name 'azure_virtual_network_gateway_connections' - desc 'Verifies settings for Azure Virtual Network Gateway Connections' + name "azure_virtual_network_gateway_connections" + desc "Verifies settings for Azure Virtual Network Gateway Connections" example <<-EXAMPLE describe azure_virtual_network_gateway_connections(resource_group: 'inspec-rg') do it { should exist } @@ -12,9 +12,9 @@ class AzureVirtualNetworkGatewayConnections < AzureGenericResources attr_reader :table def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/connections', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/connections", opts) super(opts, true) return if failed_resource? diff --git a/libraries/azure_virtual_network_gateways.rb b/libraries/azure_virtual_network_gateways.rb index 59173c558..5168883e2 100644 --- a/libraries/azure_virtual_network_gateways.rb +++ b/libraries/azure_virtual_network_gateways.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureVirtualNetworkGateways < AzureGenericResources - name 'azure_virtual_network_gateways' - desc 'Verifies settings for Azure Virtual Network Gateways' + name "azure_virtual_network_gateways" + desc "Verifies settings for Azure Virtual Network Gateways" example <<-EXAMPLE azure_virtual_network_gateways(resource_group: 'example') do it{ should exist } @@ -13,9 +13,9 @@ class AzureVirtualNetworkGateways < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/virtualNetworkGateways', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/virtualNetworkGateways", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) diff --git a/libraries/azure_virtual_network_peering.rb b/libraries/azure_virtual_network_peering.rb index fcb6718a1..ca2ccc72e 100644 --- a/libraries/azure_virtual_network_peering.rb +++ b/libraries/azure_virtual_network_peering.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureVirtualNetworkPeering < AzureGenericResource - name 'azure_virtual_network_peering' - desc 'Verifies settings for an Azure Virtual Network Peering' + name "azure_virtual_network_peering" + desc "Verifies settings for an Azure Virtual Network Peering" example <<-EXAMPLE describe azure_virtual_network_peering(resource_group: 'example',vnet: 'virtual-network-name' name: 'virtual-network-peering-name') do it { should exist } @@ -12,7 +12,7 @@ class AzureVirtualNetworkPeering < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Azure REST API endpoint URL format for the resource: # GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/ @@ -48,9 +48,9 @@ def initialize(opts = {}) # The `specific_resource_constraint` method will validate the user input # not to accept a different `resource_provider`. # - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/virtualNetworks', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/virtualNetworks", opts) opts[:required_parameters] = %i(vnet) - opts[:resource_path] = [opts[:vnet], 'virtualNetworkPeerings'].join('/') + opts[:resource_path] = [opts[:vnet], "virtualNetworkPeerings"].join("/") # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) diff --git a/libraries/azure_virtual_network_peerings.rb b/libraries/azure_virtual_network_peerings.rb index cf4d8fd13..6d4f73321 100644 --- a/libraries/azure_virtual_network_peerings.rb +++ b/libraries/azure_virtual_network_peerings.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureVirtualNetworkPeerings < AzureGenericResources - name 'azure_virtual_network_peerings' - desc 'Verifies settings for Azure Virtual Network Peerings' + name "azure_virtual_network_peerings" + desc "Verifies settings for Azure Virtual Network Peerings" example <<-EXAMPLE azure_virtual_network_peerings(resource_group: 'example', vnet: 'virtual-network-name') do it{ should exist } @@ -13,7 +13,7 @@ class AzureVirtualNetworkPeerings < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Azure REST API endpoint URL format listing all virtual Network Peerings in a virtual network: # GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/ @@ -45,11 +45,11 @@ def initialize(opts = {}) # not to accept a different `resource_provider`. # - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/virtualNetworks', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/virtualNetworks", opts) opts[:required_parameters] = %i(resource_group vnet) # Unless provided here, a generic display name will be created in the backend. opts[:display_name] = "Virtual Network Peerings for #{opts[:vnet]} Virtual Network" - opts[:resource_path] = [opts[:vnet], 'virtualNetworkPeerings'].join('/') + opts[:resource_path] = [opts[:vnet], "virtualNetworkPeerings"].join("/") # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) diff --git a/libraries/azure_virtual_networks.rb b/libraries/azure_virtual_networks.rb index 84be52c21..4b593fddb 100644 --- a/libraries/azure_virtual_networks.rb +++ b/libraries/azure_virtual_networks.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureVirtualNetworks < AzureGenericResources - name 'azure_virtual_networks' - desc 'Verifies settings for Azure Virtual Networks' + name "azure_virtual_networks" + desc "Verifies settings for Azure Virtual Networks" example <<-EXAMPLE azure_virtual_networks(resource_group: 'example') do it{ should exist } @@ -13,7 +13,7 @@ class AzureVirtualNetworks < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # Azure REST API endpoint URL format listing the all resources for a given subscription: # GET https://management.azure.com/subscriptions/{subscriptionId}/providers/ @@ -37,7 +37,7 @@ def initialize(opts = {}) # Following resource parameters have to be defined/created here. # resource_provider => Microsoft.Network/virtualNetworks - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/virtualNetworks', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/virtualNetworks", opts) # Establish a connection with Azure REST API. # Initiate instance variables: @table and @resources. @@ -75,8 +75,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermVirtualNetworks < AzureVirtualNetworks - name 'azurerm_virtual_networks' - desc 'Verifies settings for Azure Virtual Networks' + name "azurerm_virtual_networks" + desc "Verifies settings for Azure Virtual Networks" example <<-EXAMPLE azurerm_virtual_networks(resource_group: 'example') do it{ should exist } @@ -86,10 +86,10 @@ class AzurermVirtualNetworks < AzureVirtualNetworks def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureVirtualNetworks.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2018-02-01' + opts[:api_version] ||= "2018-02-01" super end end diff --git a/libraries/azure_virtual_wan.rb b/libraries/azure_virtual_wan.rb index 05058ee32..7df3e1217 100644 --- a/libraries/azure_virtual_wan.rb +++ b/libraries/azure_virtual_wan.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureVirtualWan < AzureGenericResource - name 'azure_virtual_wan' - desc 'Retrieves and verifies a Azure Virtual WAN in a Resource Group' + name "azure_virtual_wan" + desc "Retrieves and verifies a Azure Virtual WAN in a Resource Group" example <<-EXAMPLE describe azure_virtual_wan(resource_group: 'inspec-default', name: 'webservice-wan') do it { should exist } @@ -10,9 +10,9 @@ class AzureVirtualWan < AzureGenericResource EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/virtualWans', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/virtualWans", opts) super(opts, true) end diff --git a/libraries/azure_virtual_wans.rb b/libraries/azure_virtual_wans.rb index e5dc8ac4f..dfeaee760 100644 --- a/libraries/azure_virtual_wans.rb +++ b/libraries/azure_virtual_wans.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureVirtualWans < AzureGenericResources - name 'azure_virtual_wans' - desc 'Lists and verifies all Azure Virtual WANs' + name "azure_virtual_wans" + desc "Lists and verifies all Azure Virtual WANs" example <<-EXAMPLE describe azure_virtual_wans do it { should exist } @@ -10,9 +10,9 @@ class AzureVirtualWans < AzureGenericResources EXAMPLE def initialize(opts = {}) - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Network/virtualWans', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Network/virtualWans", opts) super(opts, true) return if failed_resource? diff --git a/libraries/azure_web_app_function.rb b/libraries/azure_web_app_function.rb index b9df1efa1..04a18136a 100644 --- a/libraries/azure_web_app_function.rb +++ b/libraries/azure_web_app_function.rb @@ -1,6 +1,6 @@ class AzureWebAppFunction < AzureGenericResource - name 'azure_web_app_function' - desc 'Verifies settings and configuration for an Azure Function' + name "azure_web_app_function" + desc "Verifies settings and configuration for an Azure Function" example <<-EXAMPLE describe azure_web_app_function(resource_group: 'rg-nm1', site_name: "my-site", function_name: 'HttpTriggerJS1') do it { should exist } @@ -10,11 +10,11 @@ class AzureWebAppFunction < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Web/sites', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Web/sites", opts) opts[:required_parameters] = %i(site_name) - opts[:resource_path] = [opts[:site_name], 'functions'].join('/') + opts[:resource_path] = [opts[:site_name], "functions"].join("/") opts[:resource_identifiers] = %i(function_name) # static_resource parameter must be true for setting the resource_provider in the backend. diff --git a/libraries/azure_web_app_functions.rb b/libraries/azure_web_app_functions.rb index 73cf6315d..56b5e40e2 100644 --- a/libraries/azure_web_app_functions.rb +++ b/libraries/azure_web_app_functions.rb @@ -1,6 +1,6 @@ class AzureWebAppFunctions < AzureGenericResources - name 'azure_web_app_functions' - desc 'Verifies settings for a collection of Azure Web App Functions' + name "azure_web_app_functions" + desc "Verifies settings for a collection of Azure Web App Functions" example <<-EXAMPLE describe azure_web_app_functions(resource_group: 'my-rg', site_name: "my-site") do it { should exist } @@ -12,11 +12,11 @@ class AzureWebAppFunctions < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Web/sites', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Web/sites", opts) opts[:required_parameters] = %i(site_name) - opts[:resource_path] = [opts[:site_name], 'functions'].join('/') + opts[:resource_path] = [opts[:site_name], "functions"].join("/") # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) diff --git a/libraries/azure_webapp.rb b/libraries/azure_webapp.rb index b9c8b4176..a8f804c39 100644 --- a/libraries/azure_webapp.rb +++ b/libraries/azure_webapp.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resource' +require "azure_generic_resource" class AzureWebapp < AzureGenericResource - name 'azure_webapp' - desc 'Verifies the settings for Azure Webapps' + name "azure_webapp" + desc "Verifies the settings for Azure Webapps" example <<-EXAMPLE describe azure_webapp(resource_group: 'example', name: 'webapp-name') do it { should exist } @@ -11,13 +11,13 @@ class AzureWebapp < AzureGenericResource def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Web/sites', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Web/sites", opts) opts[:allowed_parameters] = %i(auth_settings_api_version configuration_api_version supported_stacks_api_version) - opts[:auth_settings_api_version] ||= 'latest' - opts[:configuration_api_version] ||= 'latest' - opts[:supported_stacks_api_version] ||= 'latest' + opts[:auth_settings_api_version] ||= "latest" + opts[:configuration_api_version] ||= "latest" + opts[:supported_stacks_api_version] ||= "latest" # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -36,10 +36,10 @@ def auth_settings return unless exists? additional_resource_properties( { - property_name: 'auth_settings', + property_name: "auth_settings", property_endpoint: "#{id}/config/authsettings/list", api_version: @opts[:auth_settings_api_version], - method: 'post', + method: "post", }, ) end @@ -48,7 +48,7 @@ def configuration return unless exists? additional_resource_properties( { - property_name: 'configuration', + property_name: "configuration", property_endpoint: "#{id}/config/web", api_version: @opts[:configuration_api_version], }, @@ -64,8 +64,8 @@ def supported_stacks return unless exists? additional_resource_properties( { - property_name: 'supported_stacks', - property_endpoint: 'providers/Microsoft.Web/availableStacks', + property_name: "supported_stacks", + property_endpoint: "providers/Microsoft.Web/availableStacks", add_subscription_id: true, api_version: @opts[:supported_stacks_api_version], }, @@ -78,7 +78,7 @@ def using_latest?(stack) using = stack_version(stack) raise ArgumentError, "#{self} does not use Stack #{stack}" unless using latest = latest(stack) - using[0] = '' if using[0].casecmp?('v') + using[0] = "" if using[0].casecmp?("v") using.to_i >= latest.to_i end @@ -87,15 +87,15 @@ def using_latest?(stack) # Returns the version of the given stack being used by the Webapp. # nil if stack not used. raises if stack invalid. def stack_version(stack) - stack = 'netFramework' if stack.eql?('aspnet') + stack = "netFramework" if stack.eql?("aspnet") stack_key = "#{stack}Version" raise ArgumentError, "#{stack} is not a supported stack." unless stack_supported(stack) - linux_fx_version = configuration.properties.public_send('linuxFxVersion') + linux_fx_version = configuration.properties.public_send("linuxFxVersion") if !linux_fx_version.empty? - existing_stack = linux_fx_version.split('|')[0] + existing_stack = linux_fx_version.split("|")[0] existing_stack = existing_stack.downcase new_stack = stack.downcase - version = linux_fx_version.split('|')[1] if get_language(existing_stack).eql?(get_language(new_stack)) + version = linux_fx_version.split("|")[1] if get_language(existing_stack).eql?(get_language(new_stack)) else version = configuration.properties.public_send(stack_key.to_s) end @@ -106,10 +106,10 @@ def latest(stack) return unless exists? supported_stacks unless respond_to?(:supported_stacks) latest_supported = supported_stacks.select { |s| s.name.eql?(stack) } - .map { |e| e.properties.majorVersions.max_by(&:runtimeVersion).runtimeVersion } - .reduce(:+) + .map { |e| e.properties.majorVersions.max_by(&:runtimeVersion).runtimeVersion } + .reduce(:+) return if latest_supported.empty? - latest_supported[0] = '' if latest_supported[0].casecmp?('v') + latest_supported[0] = "" if latest_supported[0].casecmp?("v") latest_supported end @@ -118,11 +118,11 @@ def latest(stack) def parse_version(version) is_java_version = !(version =~ /java/ || version =~/jre/).nil? return version unless is_java_version - version.split('-')[1].gsub(/java|jre|/, '') + version.split("-")[1].gsub(/java|jre|/, "") end def get_language(stack) - lang_hash = { python: 'python', php: 'php', tomcat: 'tomcat', java: 'tomcat' } + lang_hash = { python: "python", php: "php", tomcat: "tomcat", java: "tomcat" } lang_hash[:"#{stack}"] end @@ -142,8 +142,8 @@ def stack_supported(stack) # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermWebapp < AzureWebapp - name 'azurerm_webapp' - desc 'Verifies the settings for Azure Webapps' + name "azurerm_webapp" + desc "Verifies the settings for Azure Webapps" example <<-EXAMPLE describe azurerm_webapp(resource_group: 'example', name: 'webapp-name') do it { should exist } @@ -153,13 +153,13 @@ class AzurermWebapp < AzureWebapp def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureWebapp.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2016-08-01' - opts[:auth_settings_api_version] ||= '2016-08-01' - opts[:configuration_api_version] ||= '2016-08-01' - opts[:supported_stacks_api_version] ||= '2018-02-01' + opts[:api_version] ||= "2016-08-01" + opts[:auth_settings_api_version] ||= "2016-08-01" + opts[:configuration_api_version] ||= "2016-08-01" + opts[:supported_stacks_api_version] ||= "2018-02-01" super end end diff --git a/libraries/azure_webapps.rb b/libraries/azure_webapps.rb index d799a081f..f896eb2e2 100644 --- a/libraries/azure_webapps.rb +++ b/libraries/azure_webapps.rb @@ -1,8 +1,8 @@ -require 'azure_generic_resources' +require "azure_generic_resources" class AzureWebapps < AzureGenericResources - name 'azure_webapps' - desc 'Verifies settings for Webapps' + name "azure_webapps" + desc "Verifies settings for Webapps" example <<-EXAMPLE azure_webapps(resource_group: 'example') do it{ should exist } @@ -13,9 +13,9 @@ class AzureWebapps < AzureGenericResources def initialize(opts = {}) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) - opts[:resource_provider] = specific_resource_constraint('Microsoft.Web/sites', opts) + opts[:resource_provider] = specific_resource_constraint("Microsoft.Web/sites", opts) # static_resource parameter must be true for setting the resource_provider in the backend. super(opts, true) @@ -45,8 +45,8 @@ def to_s # Provide the same functionality under the old resource name. # This is for backward compatibility. class AzurermWebapps < AzureWebapps - name 'azurerm_webapps' - desc 'Verifies settings for Webapps' + name "azurerm_webapps" + desc "Verifies settings for Webapps" example <<-EXAMPLE azurerm_webapps(resource_group: 'example') do it{ should exist } @@ -56,10 +56,10 @@ class AzurermWebapps < AzureWebapps def initialize(opts = {}) Inspec::Log.warn Helpers.resource_deprecation_message(@__resource_name__, AzureWebapps.name) # Options should be Hash type. Otherwise Ruby will raise an error when we try to access the keys. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless opts.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless opts.is_a?(Hash) # For backward compatibility. - opts[:api_version] ||= '2016-08-01' + opts[:api_version] ||= "2016-08-01" super end end diff --git a/libraries/backend/azure_connection.rb b/libraries/backend/azure_connection.rb index 0330f449f..41128abf0 100644 --- a/libraries/backend/azure_connection.rb +++ b/libraries/backend/azure_connection.rb @@ -1,4 +1,4 @@ -require 'backend/helpers' +require "backend/helpers" # Client class to manage the Azure REST API connection. # @@ -15,7 +15,7 @@ class AzureConnection @@provider_details = {} # This will be included in headers for statistical purposes. - INSPEC_USER_AGENT = 'pid-18d63047-6cdf-4f34-beed-62f01fc73fc2'.freeze + INSPEC_USER_AGENT = "pid-18d63047-6cdf-4f34-beed-62f01fc73fc2".freeze # @return [String] the resource management endpoint url attr_reader :resource_manager_endpoint_url @@ -38,7 +38,7 @@ class AzureConnection # Creates a HTTP client. def initialize(client_args) # Validate parameter's type. - raise ArgumentError, 'Parameters must be provided in an Hash object.' unless client_args.is_a?(Hash) + raise ArgumentError, "Parameters must be provided in an Hash object." unless client_args.is_a?(Hash) # The valid client args: # - endpoint: [String] @@ -49,7 +49,7 @@ def initialize(client_args) # in order to provide back-off (default - 1) @client_args = client_args - raise StandardError, 'Endpoint has to be provided to establish a connection with Azure REST API.' \ + raise StandardError, "Endpoint has to be provided to establish a connection with Azure REST API." \ unless @client_args.key?(:endpoint) @resource_manager_endpoint_url = @client_args[:endpoint].resource_manager_endpoint_url @resource_manager_endpoint_api_version = @client_args[:endpoint].resource_manager_endpoint_api_version @@ -75,10 +75,10 @@ def initialize(client_args) def credentials # azure://:@/ @credentials ||= { - tenant_id: creds_from_uri[:host] || ENV['AZURE_TENANT_ID'], - client_id: creds_from_uri[:user] || ENV['AZURE_CLIENT_ID'], - client_secret: creds_from_uri[:password] || ENV['AZURE_CLIENT_SECRET'], - subscription_id: creds_from_uri[:path]&.gsub('/', '') || ENV['AZURE_SUBSCRIPTION_ID'], + tenant_id: creds_from_uri[:host] || ENV["AZURE_TENANT_ID"], + client_id: creds_from_uri[:user] || ENV["AZURE_CLIENT_ID"], + client_secret: creds_from_uri[:password] || ENV["AZURE_CLIENT_SECRET"], + subscription_id: creds_from_uri[:path]&.gsub("/", "") || ENV["AZURE_SUBSCRIPTION_ID"], } end @@ -111,7 +111,7 @@ def rest_api_call(opts) resource = opts[:audience] || "#{uri.scheme}://#{uri.host}" # If it is a paged response than the provided nextLink will contain `skiptoken` in parameters. - unless opts[:url].include?('skiptoken') + unless opts[:url].include?("skiptoken") # Authenticate if necessary. authenticate(resource) if @@token_data[resource.to_sym].nil? || @@token_data[resource.to_sym].empty? # Update access token if expired. @@ -119,10 +119,10 @@ def rest_api_call(opts) end # Create the necessary headers. opts[:headers] ||= {} - opts[:headers]['User-Agent'] = INSPEC_USER_AGENT - opts[:headers]['Authorization'] = "#{@@token_data[resource.to_sym][:token_type]} #{@@token_data[resource.to_sym][:token]}" - opts[:headers]['Accept'] = 'application/json' - opts[:method] ||= 'get' + opts[:headers]["User-Agent"] = INSPEC_USER_AGENT + opts[:headers]["Authorization"] = "#{@@token_data[resource.to_sym][:token_type]} #{@@token_data[resource.to_sym][:token]}" + opts[:headers]["Accept"] = "application/json" + opts[:method] ||= "get" resp = send_request(opts) if resp.status == 200 @@ -147,21 +147,21 @@ def rest_api_call(opts) def authenticate(resource) # Validate the presence of credentials. unless credentials.values.compact.delete_if(&:empty?).size == 4 - raise HTTPClientError::MissingCredentials, 'The following must be set in the Environment:'\ + raise HTTPClientError::MissingCredentials, "The following must be set in the Environment:"\ " #{credentials.keys}.\n"\ "Missing: #{credentials.keys.select { |key| credentials[key].nil? }}" end # Build up the url that is required to authenticate with Azure REST API auth_url = "#{@client_args[:endpoint].active_directory_endpoint_url}#{credentials[:tenant_id]}/oauth2/token" body = { - grant_type: 'client_credentials', + grant_type: "client_credentials", client_id: credentials[:client_id], client_secret: credentials[:client_secret], resource: resource, } headers = { - 'Content-Type' => 'application/x-www-form-urlencoded', - 'Accept' => 'application/json', + "Content-Type" => "application/x-www-form-urlencoded", + "Accept" => "application/json", } resp = @connection.post(auth_url) do |req| req.body = URI.encode_www_form(body) @@ -199,9 +199,9 @@ def fail_api_query(resp, message = nil) end message += code.nil? ? "#{code} #{error_message}" : resp.body.to_s resource_not_found_codes = %w{Request_ResourceNotFound ResourceGroupNotFound ResourceNotFound NotFound} - resource_not_found_keywords = ['could not be found'] - wrong_api_keywords = ['The supported api-versions are', 'The supported versions are', 'Consider using the latest supported version'] - explicit_invalid_api_code = 'InvalidApiVersionParameter' + resource_not_found_keywords = ["could not be found"] + wrong_api_keywords = ["The supported api-versions are", "The supported versions are", "Consider using the latest supported version"] + explicit_invalid_api_code = "InvalidApiVersionParameter" possible_invalid_api_codes = %w{InvalidApiVersionParameter NoRegisteredProviderFound InvalidResourceType BadParameter} code = code.to_s if code @@ -225,18 +225,18 @@ def fail_api_query(resp, message = nil) def send_request(opts) case opts[:method] - when 'get' + when "get" @connection.get(opts[:url]) do |req| req.params = opts[:params] unless opts[:params].nil? req.headers = opts[:headers].merge(opts[:headers]) unless opts[:headers].nil? end - when 'post' + when "post" @connection.post(opts[:url]) do |req| req.params = opts[:params] unless opts[:params].nil? req.headers = opts[:headers].merge(opts[:headers]) unless opts[:headers].nil? req.body = opts[:req_body] unless opts[:req_body].nil? end - when 'head' + when "head" @connection.head(opts[:url]) do |req| req.params = opts[:params] unless opts[:params].nil? req.headers = opts[:headers] unless opts[:headers].nil? @@ -249,7 +249,7 @@ def send_request(opts) private def creds_from_uri - if ENV['RAKE_ENV'] == 'test' + if ENV["RAKE_ENV"] == "test" Inspec::Config.mock.unpack_train_credentials else Inspec::Config.cached.unpack_train_credentials diff --git a/libraries/backend/azure_environment.rb b/libraries/backend/azure_environment.rb index d46498f41..aecd3b3c4 100644 --- a/libraries/backend/azure_environment.rb +++ b/libraries/backend/azure_environment.rb @@ -84,79 +84,79 @@ def initialize(options) end AzureCloud = AzureEnvironments::AzureEnvironment.new({ - name: 'AzureCloud', - portal_url: 'https://portal.azure.com', - publishing_profile_url: 'http://go.microsoft.com/fwlink/?LinkId=254432', - management_endpoint_url: 'https://management.core.windows.net', - resource_manager_endpoint_url: 'https://management.azure.com/', - sql_management_endpoint_url: 'https://management.core.windows.net:8443/', - sql_server_hostname_suffix: '.database.windows.net', - gallery_endpoint_url: 'https://gallery.azure.com/', - active_directory_endpoint_url: 'https://login.microsoftonline.com/', - active_directory_resource_id: 'https://management.core.windows.net/', - active_directory_graph_resource_id: 'https://graph.windows.net/', - active_directory_graph_api_version: '2013-04-05', - storage_endpoint_suffix: '.core.windows.net', - key_vault_dns_suffix: '.vault.azure.net', - datalake_store_filesystem_endpoint_suffix: 'azuredatalakestore.net', - datalake_analytics_catalog_and_job_endpoint_suffix: 'azuredatalakeanalytics.net', + name: "AzureCloud", + portal_url: "https://portal.azure.com", + publishing_profile_url: "http://go.microsoft.com/fwlink/?LinkId=254432", + management_endpoint_url: "https://management.core.windows.net", + resource_manager_endpoint_url: "https://management.azure.com/", + sql_management_endpoint_url: "https://management.core.windows.net:8443/", + sql_server_hostname_suffix: ".database.windows.net", + gallery_endpoint_url: "https://gallery.azure.com/", + active_directory_endpoint_url: "https://login.microsoftonline.com/", + active_directory_resource_id: "https://management.core.windows.net/", + active_directory_graph_resource_id: "https://graph.windows.net/", + active_directory_graph_api_version: "2013-04-05", + storage_endpoint_suffix: ".core.windows.net", + key_vault_dns_suffix: ".vault.azure.net", + datalake_store_filesystem_endpoint_suffix: "azuredatalakestore.net", + datalake_analytics_catalog_and_job_endpoint_suffix: "azuredatalakeanalytics.net", }) AzureChinaCloud = AzureEnvironments::AzureEnvironment.new({ - name: 'AzureChinaCloud', - portal_url: 'https://portal.azure.cn', - publishing_profile_url: 'http://go.microsoft.com/fwlink/?LinkID=301774', - management_endpoint_url: 'https://management.core.chinacloudapi.cn', - resource_manager_endpoint_url: 'https://management.chinacloudapi.cn', - sql_management_endpoint_url: 'https://management.core.chinacloudapi.cn:8443/', - sql_server_hostname_suffix: '.database.chinacloudapi.cn', - gallery_endpoint_url: 'https://gallery.chinacloudapi.cn/', - active_directory_endpoint_url: 'https://login.chinacloudapi.cn/', - active_directory_resource_id: 'https://management.core.chinacloudapi.cn/', - active_directory_graph_resource_id: 'https://graph.chinacloudapi.cn/', - active_directory_graph_api_version: '2013-04-05', - storage_endpoint_suffix: '.core.chinacloudapi.cn', - key_vault_dns_suffix: '.vault.azure.cn', + name: "AzureChinaCloud", + portal_url: "https://portal.azure.cn", + publishing_profile_url: "http://go.microsoft.com/fwlink/?LinkID=301774", + management_endpoint_url: "https://management.core.chinacloudapi.cn", + resource_manager_endpoint_url: "https://management.chinacloudapi.cn", + sql_management_endpoint_url: "https://management.core.chinacloudapi.cn:8443/", + sql_server_hostname_suffix: ".database.chinacloudapi.cn", + gallery_endpoint_url: "https://gallery.chinacloudapi.cn/", + active_directory_endpoint_url: "https://login.chinacloudapi.cn/", + active_directory_resource_id: "https://management.core.chinacloudapi.cn/", + active_directory_graph_resource_id: "https://graph.chinacloudapi.cn/", + active_directory_graph_api_version: "2013-04-05", + storage_endpoint_suffix: ".core.chinacloudapi.cn", + key_vault_dns_suffix: ".vault.azure.cn", # TODO: add dns suffixes for the china cloud for datalake store and datalake analytics once they are defined. - datalake_store_filesystem_endpoint_suffix: 'N/A', - datalake_analytics_catalog_and_job_endpoint_suffix: 'N/A', + datalake_store_filesystem_endpoint_suffix: "N/A", + datalake_analytics_catalog_and_job_endpoint_suffix: "N/A", }) AzureUSGovernment = AzureEnvironments::AzureEnvironment.new({ - name: 'AzureUSGovernment', - portal_url: 'https://portal.azure.us', - publishing_profile_url: 'https://manage.windowsazure.us/publishsettings/index', - management_endpoint_url: 'https://management.core.usgovcloudapi.net', - resource_manager_endpoint_url: 'https://management.usgovcloudapi.net', - sql_management_endpoint_url: 'https://management.core.usgovcloudapi.net:8443/', - sql_server_hostname_suffix: '.database.usgovcloudapi.net', - gallery_endpoint_url: 'https://gallery.usgovcloudapi.net/', - active_directory_endpoint_url: 'https://login.microsoftonline.us/', - active_directory_resource_id: 'https://management.core.usgovcloudapi.net/', - active_directory_graph_resource_id: 'https://graph.windows.net/', - active_directory_graph_api_version: '2013-04-05', - storage_endpoint_suffix: '.core.usgovcloudapi.net', - key_vault_dns_suffix: '.vault.usgovcloudapi.net', + name: "AzureUSGovernment", + portal_url: "https://portal.azure.us", + publishing_profile_url: "https://manage.windowsazure.us/publishsettings/index", + management_endpoint_url: "https://management.core.usgovcloudapi.net", + resource_manager_endpoint_url: "https://management.usgovcloudapi.net", + sql_management_endpoint_url: "https://management.core.usgovcloudapi.net:8443/", + sql_server_hostname_suffix: ".database.usgovcloudapi.net", + gallery_endpoint_url: "https://gallery.usgovcloudapi.net/", + active_directory_endpoint_url: "https://login.microsoftonline.us/", + active_directory_resource_id: "https://management.core.usgovcloudapi.net/", + active_directory_graph_resource_id: "https://graph.windows.net/", + active_directory_graph_api_version: "2013-04-05", + storage_endpoint_suffix: ".core.usgovcloudapi.net", + key_vault_dns_suffix: ".vault.usgovcloudapi.net", # TODO: add dns suffixes for the US government for datalake store and datalake analytics once they are defined. - datalake_store_filesystem_endpoint_suffix: 'N/A', - datalake_analytics_catalog_and_job_endpoint_suffix: 'N/A', + datalake_store_filesystem_endpoint_suffix: "N/A", + datalake_analytics_catalog_and_job_endpoint_suffix: "N/A", }) AzureGermanCloud = AzureEnvironments::AzureEnvironment.new({ - name: 'AzureGermanCloud', - portal_url: 'http://portal.microsoftazure.de/', - publishing_profile_url: 'https://manage.microsoftazure.de/publishsettings/index', - management_endpoint_url: 'https://management.core.cloudapi.de', - resource_manager_endpoint_url: 'https://management.microsoftazure.de', - sql_management_endpoint_url: 'https://management.core.cloudapi.de:8443/', - sql_server_hostname_suffix: '.database.cloudapi.de', - gallery_endpoint_url: 'https://gallery.cloudapi.de/', - active_directory_endpoint_url: 'https://login.microsoftonline.de/', - active_directory_resource_id: 'https://management.core.cloudapi.de/', - active_directory_graph_resource_id: 'https://graph.cloudapi.de/', - active_directory_graph_api_version: '2013-04-05', - storage_endpoint_suffix: '.core.cloudapi.de', - key_vault_dns_suffix: '.vault.microsoftazure.de', + name: "AzureGermanCloud", + portal_url: "http://portal.microsoftazure.de/", + publishing_profile_url: "https://manage.microsoftazure.de/publishsettings/index", + management_endpoint_url: "https://management.core.cloudapi.de", + resource_manager_endpoint_url: "https://management.microsoftazure.de", + sql_management_endpoint_url: "https://management.core.cloudapi.de:8443/", + sql_server_hostname_suffix: ".database.cloudapi.de", + gallery_endpoint_url: "https://gallery.cloudapi.de/", + active_directory_endpoint_url: "https://login.microsoftonline.de/", + active_directory_resource_id: "https://management.core.cloudapi.de/", + active_directory_graph_resource_id: "https://graph.cloudapi.de/", + active_directory_graph_api_version: "2013-04-05", + storage_endpoint_suffix: ".core.cloudapi.de", + key_vault_dns_suffix: ".vault.microsoftazure.de", # TODO: add dns suffixes for the US government for datalake store and datalake analytics once they are defined. - datalake_store_filesystem_endpoint_suffix: 'N/A', - datalake_analytics_catalog_and_job_endpoint_suffix: 'N/A', + datalake_store_filesystem_endpoint_suffix: "N/A", + datalake_analytics_catalog_and_job_endpoint_suffix: "N/A", }) end end diff --git a/libraries/backend/azure_require.rb b/libraries/backend/azure_require.rb index 486316e02..a74012a2c 100644 --- a/libraries/backend/azure_require.rb +++ b/libraries/backend/azure_require.rb @@ -1,9 +1,9 @@ -require 'backend/azure_connection' -require 'backend/azure_environment' -require 'backend/azure_security_rules_helpers' -require 'backend/helpers' -require 'faraday' -require 'faraday_middleware' -require 'active_support' -require 'active_support/core_ext/hash' -require 'json' +require "backend/azure_connection" +require "backend/azure_environment" +require "backend/azure_security_rules_helpers" +require "backend/helpers" +require "faraday" +require "faraday_middleware" +require "active_support" +require "active_support/core_ext/hash" +require "json" diff --git a/libraries/backend/azure_security_rules_helpers.rb b/libraries/backend/azure_security_rules_helpers.rb index 4a1307428..e577cf321 100644 --- a/libraries/backend/azure_security_rules_helpers.rb +++ b/libraries/backend/azure_security_rules_helpers.rb @@ -1,11 +1,11 @@ -require 'backend/helpers' +require "backend/helpers" # Normalise Azure security rules to make them comparable with criteria or other security rules. # class NormalizeSecurityRule CIDR_IPV4_REG = %r{^([0-9]{1,3}\.){3}[0-9]{1,3}(/([0-9]|[1-2][0-9]|3[0-2]))?$}i.freeze CIDR_IPV6_REG = %r{^s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:)))(%.+)?s*(/([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8]))?$}i.freeze - PORT_RANGE = ('0'..'65535').freeze + PORT_RANGE = ("0".."65535").freeze attr_reader :name, :etag, :id, :access, :direction, :protocol, :priority @@ -165,8 +165,8 @@ def compliant?(criteria) # rubocop:disable Metrics/CyclomaticComplexity, Metrics unless criteria[:protocol].nil? return nil unless criteria[:protocol].upcase == protocol compliant = access == criteria[:access] - compliant = true if protocol == '*' && access == 'allow' - compliant = false if protocol == '*' && access == 'deny' + compliant = true if protocol == "*" && access == "allow" + compliant = false if protocol == "*" && access == "deny" return compliant unless compliant end @@ -199,7 +199,7 @@ def compliant?(criteria) # rubocop:disable Metrics/CyclomaticComplexity, Metrics # def ip_range_check(base_ip_ranges, criteria_ip_range) unless criteria_ip_range.match?(CIDR_IPV4_REG) || criteria_ip_range.match?(CIDR_IPV6_REG) - raise ArgumentError, 'IP range/address must be in CIDR format, e.g: `192.168.0.1/24, 2001:1234::/64`.' + raise ArgumentError, "IP range/address must be in CIDR format, e.g: `192.168.0.1/24, 2001:1234::/64`." end criteria_ip_range_cidr = IPAddr.new(criteria_ip_range) within_range = [] @@ -214,10 +214,10 @@ def ip_range_check(base_ip_ranges, criteria_ip_range) # @param sources [Array, Class] The list of ports. # def extract_ports(sources) - return PORT_RANGE if sources.any? { |s| s == '*' } + return PORT_RANGE if sources.any? { |s| s == "*" } sources.each_with_object([]) do |s, ports| - if s.include?('-') - from, to = s.split('-') + if s.include?("-") + from, to = s.split("-") ports << [*from..to] else ports << s @@ -232,8 +232,8 @@ def extract_ip_addresses(sources) service_tags = [] ip_addresses = sources.each_with_object([]) do |source, ip_adds| case source - when '*' - ip_adds << IPAddr.new('0.0.0.0/0') + when "*" + ip_adds << IPAddr.new("0.0.0.0/0") when CIDR_IPV4_REG, CIDR_IPV6_REG ip_adds << IPAddr.new(source) else diff --git a/libraries/backend/helpers.rb b/libraries/backend/helpers.rb index 72a583b84..0368343c7 100644 --- a/libraries/backend/helpers.rb +++ b/libraries/backend/helpers.rb @@ -1,4 +1,4 @@ -require 'backend/azure_environment' +require "backend/azure_environment" # TODO: This file should be updated at every release. # Source: @@ -86,51 +86,51 @@ class AzureEnvironments # Following data can be modified if necessary. # TODO: Update API versions if there is a newer version available. ENDPOINTS = { - 'azure_cloud' => { + "azure_cloud" => { resource_manager_endpoint_url: MicrosoftRestAzure::AzureEnvironments::AzureCloud.resource_manager_endpoint_url, active_directory_endpoint_url: MicrosoftRestAzure::AzureEnvironments::AzureCloud.active_directory_endpoint_url, storage_endpoint_suffix: MicrosoftRestAzure::AzureEnvironments::AzureCloud.storage_endpoint_suffix, key_vault_dns_suffix: MicrosoftRestAzure::AzureEnvironments::AzureCloud.key_vault_dns_suffix, - resource_manager_endpoint_api_version: '2020-01-01', - graph_api_endpoint_url: 'https://graph.microsoft.com', - graph_api_endpoint_api_version: 'v1.0', + resource_manager_endpoint_api_version: "2020-01-01", + graph_api_endpoint_url: "https://graph.microsoft.com", + graph_api_endpoint_api_version: "v1.0", }, # The latest version can be acquired from the error message if the current ones don't work. - 'azure_china_cloud' => { + "azure_china_cloud" => { resource_manager_endpoint_url: MicrosoftRestAzure::AzureEnvironments::AzureChinaCloud.resource_manager_endpoint_url, active_directory_endpoint_url: MicrosoftRestAzure::AzureEnvironments::AzureChinaCloud.active_directory_endpoint_url, storage_endpoint_suffix: MicrosoftRestAzure::AzureEnvironments::AzureChinaCloud.storage_endpoint_suffix, key_vault_dns_suffix: MicrosoftRestAzure::AzureEnvironments::AzureChinaCloud.key_vault_dns_suffix, - resource_manager_endpoint_api_version: '2020-01-01', - graph_api_endpoint_url: 'https://microsoftgraph.chinacloudapi.cn', - graph_api_endpoint_url_api_version: 'v1.0', + resource_manager_endpoint_api_version: "2020-01-01", + graph_api_endpoint_url: "https://microsoftgraph.chinacloudapi.cn", + graph_api_endpoint_url_api_version: "v1.0", }, - 'azure_us_government_L4' => { + "azure_us_government_L4" => { resource_manager_endpoint_url: MicrosoftRestAzure::AzureEnvironments::AzureUSGovernment.resource_manager_endpoint_url, active_directory_endpoint_url: MicrosoftRestAzure::AzureEnvironments::AzureUSGovernment.active_directory_endpoint_url, storage_endpoint_suffix: MicrosoftRestAzure::AzureEnvironments::AzureUSGovernment.storage_endpoint_suffix, key_vault_dns_suffix: MicrosoftRestAzure::AzureEnvironments::AzureUSGovernment.key_vault_dns_suffix, - resource_manager_endpoint_api_version: '2020-01-01', - graph_api_endpoint_url: 'https://graph.microsoft.us', - graph_api_endpoint_url_api_version: 'v1.0', + resource_manager_endpoint_api_version: "2020-01-01", + graph_api_endpoint_url: "https://graph.microsoft.us", + graph_api_endpoint_url_api_version: "v1.0", }, - 'azure_us_government_L5' => { + "azure_us_government_L5" => { resource_manager_endpoint_url: MicrosoftRestAzure::AzureEnvironments::AzureUSGovernment.resource_manager_endpoint_url, active_directory_endpoint_url: MicrosoftRestAzure::AzureEnvironments::AzureUSGovernment.active_directory_endpoint_url, storage_endpoint_suffix: MicrosoftRestAzure::AzureEnvironments::AzureUSGovernment.storage_endpoint_suffix, key_vault_dns_suffix: MicrosoftRestAzure::AzureEnvironments::AzureUSGovernment.key_vault_dns_suffix, - resource_manager_endpoint_api_version: '2020-01-01', - graph_api_endpoint_url: 'https://dod-graph.microsoft.us', - graph_api_endpoint_url_api_version: 'v1.0', + resource_manager_endpoint_api_version: "2020-01-01", + graph_api_endpoint_url: "https://dod-graph.microsoft.us", + graph_api_endpoint_url_api_version: "v1.0", }, - 'azure_german_cloud' => { + "azure_german_cloud" => { resource_manager_endpoint_url: MicrosoftRestAzure::AzureEnvironments::AzureGermanCloud.resource_manager_endpoint_url, active_directory_endpoint_url: MicrosoftRestAzure::AzureEnvironments::AzureGermanCloud.active_directory_endpoint_url, storage_endpoint_suffix: MicrosoftRestAzure::AzureEnvironments::AzureGermanCloud.storage_endpoint_suffix, key_vault_dns_suffix: MicrosoftRestAzure::AzureEnvironments::AzureGermanCloud.key_vault_dns_suffix, - resource_manager_endpoint_api_version: '2020-01-01', - graph_api_endpoint_url: 'https://graph.microsoft.de', - graph_api_endpoint_url_api_version: 'v1.0', + resource_manager_endpoint_api_version: "2020-01-01", + graph_api_endpoint_url: "https://graph.microsoft.de", + graph_api_endpoint_url_api_version: "v1.0", }, }.freeze @@ -228,14 +228,14 @@ def self.validate_params_only_one_of(resource_name = nil, require_only_one_of, o # @return [Array] Required parameters # @param required [Array] def self.validate_params_required(resource_name = nil, required, opts) - raise ArgumentError, "#{resource_name}: `#{required.uniq - opts.keys.uniq}` must be provided" unless opts.is_a?(Hash) && required.all? { |req| opts.key?(req) && !opts[req].nil? && opts[req] != '' } + raise ArgumentError, "#{resource_name}: `#{required.uniq - opts.keys.uniq}` must be provided" unless opts.is_a?(Hash) && required.all? { |req| opts.key?(req) && !opts[req].nil? && opts[req] != "" } required end # @return [Array] Require any of parameters # @param require_any_of [Array] def self.validate_params_require_any_of(resource_name = nil, require_any_of, opts) - raise ArgumentError, "#{resource_name}: One of `#{require_any_of}` must be provided." unless opts.is_a?(Hash) && require_any_of.any? { |req| opts.key?(req) && !opts[req].nil? && opts[req] != '' } + raise ArgumentError, "#{resource_name}: One of `#{require_any_of}` must be provided." unless opts.is_a?(Hash) && require_any_of.any? { |req| opts.key?(req) && !opts[req].nil? && opts[req] != "" } require_any_of end @@ -243,11 +243,11 @@ def self.validate_params_require_any_of(resource_name = nil, require_any_of, opt # @param allow [Array] def self.validate_params_allow(allow, opts, skip_length = false) # rubocop:disable Style/OptionalBooleanParameter TODO: Fix this. if !opts[:resource_data] && !skip_length - raise ArgumentError, 'Arguments or values can not be longer than 500 characters.' if opts.any? { |k, v| k.size > 100 || v.to_s.size > 500 } # rubocop:disable Style/SoleNestedConditional TODO: Fix this. + raise ArgumentError, "Arguments or values can not be longer than 500 characters." if opts.any? { |k, v| k.size > 100 || v.to_s.size > 500 } # rubocop:disable Style/SoleNestedConditional TODO: Fix this. end - raise ArgumentError, 'Scalar arguments not supported.' unless defined?(opts.keys) + raise ArgumentError, "Scalar arguments not supported." unless defined?(opts.keys) raise ArgumentError, "Unexpected arguments found: #{opts.keys.uniq - allow.uniq}" unless opts.keys.all? { |a| allow.include?(a) } - raise ArgumentError, 'Provided parameter should not be empty.' unless opts.values.all? do |a| + raise ArgumentError, "Provided parameter should not be empty." unless opts.values.all? do |a| return true if a.instance_of?(Integer) return true if [TrueClass, FalseClass].include?(a.class) !a.empty? @@ -255,10 +255,10 @@ def self.validate_params_allow(allow, opts, skip_length = false) # rubocop:disab end def self.validate_resource_uri(resource_uri) - resource_uri_format = '/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/'\ - 'Microsoft.Compute/virtualMachines/{resource_name}' + resource_uri_format = "/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/"\ + "Microsoft.Compute/virtualMachines/{resource_name}" raise ArgumentError, "Resource URI should be in the format of #{resource_uri_format}. Found: #{resource_uri}" \ - unless resource_uri.start_with?('/subscriptions/') || resource_uri.include?('providers') + unless resource_uri.start_with?("/subscriptions/") || resource_uri.include?("providers") end end @@ -286,19 +286,19 @@ def self.odata_query(data) if data.is_a?(Hash) # TODO: implement 'ne' operator query = data.each_with_object([]) do |(k, v), acc| - v = v.delete_suffix('/').delete_prefix('/') - if k.to_s.start_with?('substring_of_') + v = v.delete_suffix("/").delete_prefix("/") + if k.to_s.start_with?("substring_of_") acc << "substringof('#{v}',#{k.to_s[13..-1].camelcase(:lower)})" - elsif k.to_s.start_with?('starts_with_') + elsif k.to_s.start_with?("starts_with_") acc << "startswith(#{k.to_s[12..-1].camelcase(:lower)},'#{v}')" else acc << "#{k.to_s.camelcase(:lower)} eq '#{v}'" end - end.join(' and ') + end.join(" and ") end # This works for `$select, $expand`. if data.is_a?(Array) - query = data.join(',') + query = data.join(",") end query end @@ -321,9 +321,9 @@ def self.odata_query(data) # Microsoft.Compute/virtualMachines/{resource_name} def self.res_group_provider_type_from_uri(resource_uri) Validators.validate_resource_uri(resource_uri) - subscription_resource_group, provider_resource_type = resource_uri.split('/providers/') - resource_group = subscription_resource_group.split('/').last - interim_array = provider_resource_type.split('/') + subscription_resource_group, provider_resource_type = resource_uri.split("/providers/") + resource_group = subscription_resource_group.split("/").last + interim_array = provider_resource_type.split("/") provider = interim_array[0] # interim array can be one of two # 1- provider/resource_provider/resource/name @@ -334,7 +334,7 @@ def self.res_group_provider_type_from_uri(resource_uri) # providers/Microsoft.Compute/virtualMachines/{vm_name}/extensions/{extension_name}" # provider => "Microsoft.Compute" # resource_provider => "virtualMachines/extensions" - resource_type = [interim_array[1], interim_array[3]].compact.join('/') + resource_type = [interim_array[1], interim_array[3]].compact.join("/") [resource_group, provider, resource_type] end @@ -359,12 +359,12 @@ def self.normalize_api_list(age_criteria, stable_versions, preview_versions) def self.resource_deprecation_message(old_resource_name, new_resource_class) "DEPRECATION: `#{old_resource_name}` uses the new resource `#{new_resource_class}` under the hood. "\ "#{old_resource_name} will be deprecated soon and it is advised to switch to the fully backward compatible new resource. "\ - 'Please see the documentation for the additional features available.' + "Please see the documentation for the additional features available." end def self.construct_url(input_list) raise ArgumentError, "An array has to be provided. Found: #{input_list.class}." unless input_list.is_a?(Array) - input_list.each_with_object([]) { |input, list| list << input.delete_suffix('/').delete_prefix('/') }.join('/') + input_list.each_with_object([]) { |input, list| list << input.delete_suffix("/").delete_prefix("/") }.join("/") end end diff --git a/test/integration/verify/controls/azure_active_directory_domain_service.rb b/test/integration/verify/controls/azure_active_directory_domain_service.rb index 1e88ab4f3..85ce92261 100644 --- a/test/integration/verify/controls/azure_active_directory_domain_service.rb +++ b/test/integration/verify/controls/azure_active_directory_domain_service.rb @@ -1,16 +1,16 @@ -control 'azure_active_directory_domain_service' do +control "azure_active_directory_domain_service" do - title 'Testing the singular resource of azure_active_directory_domain_service.' - desc 'Testing the singular resource of azure_active_directory_domain_service.' + title "Testing the singular resource of azure_active_directory_domain_service." + desc "Testing the singular resource of azure_active_directory_domain_service." azure_active_directory_domain_services.ids.each do |domain_service_id| describe azure_active_directory_domain_service(id: domain_service_id) do it { should exist } - its('isVerified') { should eq true } + its("isVerified") { should eq true } end end - describe azure_active_directory_domain_service(id: 'dummy') do + describe azure_active_directory_domain_service(id: "dummy") do it { should_not exist } end end diff --git a/test/integration/verify/controls/azure_active_directory_domain_services.rb b/test/integration/verify/controls/azure_active_directory_domain_services.rb index b262eb3ff..10feff9a6 100644 --- a/test/integration/verify/controls/azure_active_directory_domain_services.rb +++ b/test/integration/verify/controls/azure_active_directory_domain_services.rb @@ -1,7 +1,7 @@ -control 'azure_active_directory_domain_services' do +control "azure_active_directory_domain_services" do - title 'Testing the plural resource of azure_active_directory_domain_services.' - desc 'Testing the plural resource of azure_active_directory_domain_services.' + title "Testing the plural resource of azure_active_directory_domain_services." + desc "Testing the plural resource of azure_active_directory_domain_services." describe azure_active_directory_domain_services do it { should exist } diff --git a/test/integration/verify/controls/azure_active_directory_object.rb b/test/integration/verify/controls/azure_active_directory_object.rb index e628a07d8..f65d91f66 100644 --- a/test/integration/verify/controls/azure_active_directory_object.rb +++ b/test/integration/verify/controls/azure_active_directory_object.rb @@ -1,14 +1,14 @@ -directory_object = input(:sample_directory_object, value: '') +directory_object = input(:sample_directory_object, value: "") -control 'azure active directory object' do +control "azure active directory object" do - title 'Testing the singular resource of azure_active_directory_object.' - desc 'Testing the singular resource of azure_active_directory_object.' + title "Testing the singular resource of azure_active_directory_object." + desc "Testing the singular resource of azure_active_directory_object." describe azure_active_directory_object(id: directory_object) do it { should exist } - its('displayName') { should eq 'MyApps_AliBabaCloud' } - its('visibility') { should be_empty } - its('mailEnabled') { should be_falsey } + its("displayName") { should eq "MyApps_AliBabaCloud" } + its("visibility") { should be_empty } + its("mailEnabled") { should be_falsey } end end diff --git a/test/integration/verify/controls/azure_active_directory_objects.rb b/test/integration/verify/controls/azure_active_directory_objects.rb index 1c4926f68..e5ed33548 100644 --- a/test/integration/verify/controls/azure_active_directory_objects.rb +++ b/test/integration/verify/controls/azure_active_directory_objects.rb @@ -1,12 +1,12 @@ -directory_object = input(:sample_directory_object, value: '') +directory_object = input(:sample_directory_object, value: "") -control 'azure active directory objects' do +control "azure active directory objects" do - title 'Testing the plural resource of azure_active_directory_objects.' - desc 'Testing the plural resource of azure_active_directory_objects.' + title "Testing the plural resource of azure_active_directory_objects." + desc "Testing the plural resource of azure_active_directory_objects." describe azure_active_directory_objects do it { should exist } - its('values') { should include directory_object } + its("values") { should include directory_object } end end diff --git a/test/integration/verify/controls/azure_bastion_hosts_resource.rb b/test/integration/verify/controls/azure_bastion_hosts_resource.rb index ce0c187b0..c02bfda83 100644 --- a/test/integration/verify/controls/azure_bastion_hosts_resource.rb +++ b/test/integration/verify/controls/azure_bastion_hosts_resource.rb @@ -1,25 +1,25 @@ -resource_group = input('resource_group', value: nil) -bastion_host_name = input('bastionHostName', value: nil) -df_location = input('bastionHostLocation', value: nil) +resource_group = input("resource_group", value: nil) +bastion_host_name = input("bastionHostName", value: nil) +df_location = input("bastionHostLocation", value: nil) -control 'azure_bastion_hosts_resource' do +control "azure_bastion_hosts_resource" do - title 'Testing the singular resource of azure_bastion_hosts_resource.' - desc 'Testing the singular resource of azure_bastion_hosts_resource.' + title "Testing the singular resource of azure_bastion_hosts_resource." + desc "Testing the singular resource of azure_bastion_hosts_resource." describe azure_bastion_hosts_resource(resource_group: resource_group, name: bastion_host_name) do it { should exist } - its('name') { should eq bastion_host_name } - its('type') { should eq 'Microsoft.Network/bastionHosts' } - its('provisioning_state') { should include('Succeeded') } - its('location') { should include df_location } + its("name") { should eq bastion_host_name } + its("type") { should eq "Microsoft.Network/bastionHosts" } + its("provisioning_state") { should include("Succeeded") } + its("location") { should include df_location } end - describe azure_bastion_hosts_resource(resource_group: resource_group, name: 'fake') do + describe azure_bastion_hosts_resource(resource_group: resource_group, name: "fake") do it { should_not exist } end - describe azure_bastion_hosts_resource(resource_group: 'fake', name: bastion_host_name) do + describe azure_bastion_hosts_resource(resource_group: "fake", name: bastion_host_name) do it { should_not exist } end end diff --git a/test/integration/verify/controls/azure_bastion_hosts_resources.rb b/test/integration/verify/controls/azure_bastion_hosts_resources.rb index c713e0b42..55e42323e 100644 --- a/test/integration/verify/controls/azure_bastion_hosts_resources.rb +++ b/test/integration/verify/controls/azure_bastion_hosts_resources.rb @@ -1,17 +1,17 @@ -resource_group = input('resource_group', value: nil) -bastion_host_name = input('bastionHostName', value: nil) -df_location = input('bastionHostLocation', value: nil) +resource_group = input("resource_group", value: nil) +bastion_host_name = input("bastionHostName", value: nil) +df_location = input("bastionHostLocation", value: nil) -control 'azure_bastion_hosts_resources' do +control "azure_bastion_hosts_resources" do - title 'Testing the plural resource of azure_bastion_hosts_resources.' - desc 'Testing the plural resource of azure_bastion_hosts_resources.' + title "Testing the plural resource of azure_bastion_hosts_resources." + desc "Testing the plural resource of azure_bastion_hosts_resources." describe azure_bastion_hosts_resources(resource_group: resource_group) do it { should exist } - its('names') { should include bastion_host_name } - its('locations') { should include df_location } - its('types') { should include 'Microsoft.Network/bastionHosts' } - its('provisioning_states') { should include('Succeeded') } + its("names") { should include bastion_host_name } + its("locations") { should include df_location } + its("types") { should include "Microsoft.Network/bastionHosts" } + its("provisioning_states") { should include("Succeeded") } end end diff --git a/test/integration/verify/controls/azure_blob_service.rb b/test/integration/verify/controls/azure_blob_service.rb index 86100be9d..3167df23d 100644 --- a/test/integration/verify/controls/azure_blob_service.rb +++ b/test/integration/verify/controls/azure_blob_service.rb @@ -1,40 +1,40 @@ -resource_group = input('resource_group', value: '', description: '') -storage_account_blob_service_id = input('storage_account_blob_service_id', value: '', description: '') -storage_account_blob_service_name = input('storage_account_blob_service_name', value: '', description: '') -storage_account_blob_type = input('storage_account_blob_type', value: '', description: '') -storage_account = input('storage_account', value: '', description: '') +resource_group = input("resource_group", value: "", description: "") +storage_account_blob_service_id = input("storage_account_blob_service_id", value: "", description: "") +storage_account_blob_service_name = input("storage_account_blob_service_name", value: "", description: "") +storage_account_blob_type = input("storage_account_blob_type", value: "", description: "") +storage_account = input("storage_account", value: "", description: "") -control 'azure_blob_service' do - title 'Testing the singular resource of azure_blob_service.' - desc 'Testing the singular resource of azure_blob_service.' +control "azure_blob_service" do + title "Testing the singular resource of azure_blob_service." + desc "Testing the singular resource of azure_blob_service." describe azure_blob_service(resource_group: resource_group, storage_account_name: storage_account) do it { should exist } end describe azure_blob_service(resource_group: resource_group, storage_account_name: storage_account) do - its('sku.name') { should eq 'Standard_RAGRS' } - its('sku.tier') { should eq 'Standard' } + its("sku.name") { should eq "Standard_RAGRS" } + its("sku.tier") { should eq "Standard" } - its('id') { should eq storage_account_blob_service_id } - its('name') { should eq storage_account_blob_service_name } - its('type') { should eq storage_account_blob_type } + its("id") { should eq storage_account_blob_service_id } + its("name") { should eq storage_account_blob_service_name } + its("type") { should eq storage_account_blob_type } - its('properties.changeFeed.enabled') { should eq true } + its("properties.changeFeed.enabled") { should eq true } - its('properties.restorePolicy.enabled') { should eq true } - its('properties.restorePolicy.days') { should eq 6 } + its("properties.restorePolicy.enabled") { should eq true } + its("properties.restorePolicy.days") { should eq 6 } # its('properties.restorePolicy.minRestoreTime') { should eq Time.parse('2022-09-13T09:34:18.5206216Z') } - its('properties.containerDeleteRetentionPolicy.enabled') { should eq true } - its('properties.containerDeleteRetentionPolicy.days') { should eq 7 } + its("properties.containerDeleteRetentionPolicy.enabled") { should eq true } + its("properties.containerDeleteRetentionPolicy.days") { should eq 7 } - its('properties.corsRules') { should be_empty } + its("properties.corsRules") { should be_empty } - its('properties.deleteRetentionPolicy.allowPermanentDelete') { should eq false } - its('properties.deleteRetentionPolicy.enabled') { should eq true } - its('properties.deleteRetentionPolicy.days') { should eq 7 } + its("properties.deleteRetentionPolicy.allowPermanentDelete") { should eq false } + its("properties.deleteRetentionPolicy.enabled") { should eq true } + its("properties.deleteRetentionPolicy.days") { should eq 7 } - its('properties.isVersioningEnabled') { should eq true } + its("properties.isVersioningEnabled") { should eq true } end end diff --git a/test/integration/verify/controls/azure_blob_services.rb b/test/integration/verify/controls/azure_blob_services.rb index eb2c064af..4dd71cc87 100644 --- a/test/integration/verify/controls/azure_blob_services.rb +++ b/test/integration/verify/controls/azure_blob_services.rb @@ -1,22 +1,22 @@ -resource_group = input('resource_group', value: '', description: '') -storage_account_blob_service_id = input('storage_account_blob_service_id', value: '', description: '') -storage_account_blob_service_name = input('storage_account_blob_service_name', value: '', description: '') -storage_account_blob_type = input('storage_account_blob_type', value: '', description: '') -storage_account = input('storage_account', value: '', description: '') +resource_group = input("resource_group", value: "", description: "") +storage_account_blob_service_id = input("storage_account_blob_service_id", value: "", description: "") +storage_account_blob_service_name = input("storage_account_blob_service_name", value: "", description: "") +storage_account_blob_type = input("storage_account_blob_type", value: "", description: "") +storage_account = input("storage_account", value: "", description: "") -control 'azure_blob_services' do - title 'Testing the plural resource of azure_blob_services.' - desc 'Testing the plural resource of azure_blob_services.' +control "azure_blob_services" do + title "Testing the plural resource of azure_blob_services." + desc "Testing the plural resource of azure_blob_services." describe azure_blob_services(resource_group: resource_group, storage_account_name: storage_account) do it { should exist } end describe azure_blob_services(resource_group: resource_group, storage_account_name: storage_account) do - its('skus') { should_not be_empty } - its('ids') { should include(storage_account_blob_service_id) } - its('names') { should include(storage_account_blob_service_name) } - its('types') { should include(storage_account_blob_type) } - its('properties') { should_not be_empty } + its("skus") { should_not be_empty } + its("ids") { should include(storage_account_blob_service_id) } + its("names") { should include(storage_account_blob_service_name) } + its("types") { should include(storage_account_blob_type) } + its("properties") { should_not be_empty } end end diff --git a/test/integration/verify/controls/azure_cdn_profile.rb b/test/integration/verify/controls/azure_cdn_profile.rb index 9eafe279e..0a6c4d176 100644 --- a/test/integration/verify/controls/azure_cdn_profile.rb +++ b/test/integration/verify/controls/azure_cdn_profile.rb @@ -1,15 +1,15 @@ -name = input(:cdn_profile_name, value: '') -resource_group = input(:resource_group, value: '') -location = input(:location, value: '') +name = input(:cdn_profile_name, value: "") +resource_group = input(:resource_group, value: "") +location = input(:location, value: "") -control 'azure_cdn_profile' do - title 'Testing the singular resource of azure_cdn_profile.' - desc 'Testing the singular resource of azure_cdn_profile.' +control "azure_cdn_profile" do + title "Testing the singular resource of azure_cdn_profile." + desc "Testing the singular resource of azure_cdn_profile." describe azure_cdn_profile(resource_group: resource_group, name: name) do it { should exist } - its('location') { should eq location } - its('provisioningState') { should eq 'Succeeded' } - its('resourceState') { should eq 'Active' } + its("location") { should eq location } + its("provisioningState") { should eq "Succeeded" } + its("resourceState") { should eq "Active" } end end diff --git a/test/integration/verify/controls/azure_cdn_profiles.rb b/test/integration/verify/controls/azure_cdn_profiles.rb index 198135f94..d0450a1aa 100644 --- a/test/integration/verify/controls/azure_cdn_profiles.rb +++ b/test/integration/verify/controls/azure_cdn_profiles.rb @@ -1,14 +1,14 @@ -name = input(:cdn_profile_name, value: '') -location = input(:location, value: '') +name = input(:cdn_profile_name, value: "") +location = input(:location, value: "") -control 'azure_cdn_profiles' do - title 'Testing the plural resource of azure_cdn_profile.' - desc 'Testing the plural resource of azure_cdn_profile.' +control "azure_cdn_profiles" do + title "Testing the plural resource of azure_cdn_profile." + desc "Testing the plural resource of azure_cdn_profile." describe azure_cdn_profiles do it { should exist } - its('locations') { should include location } - its('names') { should include name } - its('resourceStates') { should include 'Active' } + its("locations") { should include location } + its("names") { should include name } + its("resourceStates") { should include "Active" } end end diff --git a/test/integration/verify/controls/azure_container_group.rb b/test/integration/verify/controls/azure_container_group.rb index a7fc665ce..6d36d9646 100644 --- a/test/integration/verify/controls/azure_container_group.rb +++ b/test/integration/verify/controls/azure_container_group.rb @@ -1,15 +1,15 @@ -resource_group = input(:resource_group, value: '') -container_group_name = input(:inspec_container_group_name, value: '') +resource_group = input(:resource_group, value: "") +container_group_name = input(:inspec_container_group_name, value: "") -control 'check container group properties' do +control "check container group properties" do - title 'Testing the singular resource of azure_container_group.' - desc 'Testing the singular resource of azure_container_group.' + title "Testing the singular resource of azure_container_group." + desc "Testing the singular resource of azure_container_group." describe azure_container_group(resource_group: resource_group, name: container_group_name) do it { should exist } - its('location') { should eq 'eastus' } - its('properties.ipAddress.type') { should eq 'Public' } - its('properties.containers.first.properties.resources.requests.item') { should cmp({ memoryInGB: 0.5, cpu: 0.5 }) } + its("location") { should eq "eastus" } + its("properties.ipAddress.type") { should eq "Public" } + its("properties.containers.first.properties.resources.requests.item") { should cmp({ memoryInGB: 0.5, cpu: 0.5 }) } end end diff --git a/test/integration/verify/controls/azure_container_groups.rb b/test/integration/verify/controls/azure_container_groups.rb index 4f8b9dcea..f6243dc42 100644 --- a/test/integration/verify/controls/azure_container_groups.rb +++ b/test/integration/verify/controls/azure_container_groups.rb @@ -1,17 +1,17 @@ -control 'check container groups' do +control "check container groups" do - title 'Testing the plural resource of azure_container_groups.' - desc 'Testing the plural resource of azure_container_groups.' + title "Testing the plural resource of azure_container_groups." + desc "Testing the plural resource of azure_container_groups." describe azure_container_groups do it { should exist } - its('types') { should include 'Microsoft.ContainerInstance/containerGroups' } - its('locations') { should include 'eastus' } - its('restart_policies') { should include 'OnFailure' } - its('os_types') { should include 'Linux' } + its("types") { should include "Microsoft.ContainerInstance/containerGroups" } + its("locations") { should include "eastus" } + its("restart_policies") { should include "OnFailure" } + its("os_types") { should include "Linux" } end - describe azure_container_groups.where(provisioning_state: 'Succeeded') do + describe azure_container_groups.where(provisioning_state: "Succeeded") do it { should exist } end end diff --git a/test/integration/verify/controls/azure_container_registries.rb b/test/integration/verify/controls/azure_container_registries.rb index 6f200cae4..ae1f34393 100644 --- a/test/integration/verify/controls/azure_container_registries.rb +++ b/test/integration/verify/controls/azure_container_registries.rb @@ -1,18 +1,18 @@ -resource_group = attribute('resource_group', value: nil) -container_registry_name = attribute('container_registry_name', value: nil) +resource_group = attribute("resource_group", value: nil) +container_registry_name = attribute("container_registry_name", value: nil) -control 'azure_container_registries' do +control "azure_container_registries" do - title 'Testing the plural resource of azure_container_registries.' - desc 'Testing the plural resource of azure_container_registries.' + title "Testing the plural resource of azure_container_registries." + desc "Testing the plural resource of azure_container_registries." describe azure_container_registries(resource_group: resource_group) do it { should exist } - its('names') { should include container_registry_name } + its("names") { should include container_registry_name } end describe azure_container_registries do it { should exist } - its('names') { should include container_registry_name } + its("names") { should include container_registry_name } end end diff --git a/test/integration/verify/controls/azure_container_registry.rb b/test/integration/verify/controls/azure_container_registry.rb index 3f4fb84df..6e3b4f212 100644 --- a/test/integration/verify/controls/azure_container_registry.rb +++ b/test/integration/verify/controls/azure_container_registry.rb @@ -1,16 +1,16 @@ -resource_group = attribute('resource_group', value: nil) -container_registry_name = attribute('container_registry_name', value: nil) +resource_group = attribute("resource_group", value: nil) +container_registry_name = attribute("container_registry_name", value: nil) -control 'azure_container_registry' do +control "azure_container_registry" do - title 'Testing the singular resource of azure_container_registry.' - desc 'Testing the singular resource of azure_container_registry.' + title "Testing the singular resource of azure_container_registry." + desc "Testing the singular resource of azure_container_registry." describe azure_container_registry(resource_group: resource_group, name: container_registry_name) do it { should exist } - its('id') { should_not be_nil } - its('name') { should eq container_registry_name } - its('sku.name') { should cmp 'Basic' } - its('location') { should_not be_nil } + its("id") { should_not be_nil } + its("name") { should eq container_registry_name } + its("sku.name") { should cmp "Basic" } + its("location") { should_not be_nil } end end diff --git a/test/integration/verify/controls/azure_data_factories.rb b/test/integration/verify/controls/azure_data_factories.rb index 6597cc499..42c4d25f8 100644 --- a/test/integration/verify/controls/azure_data_factories.rb +++ b/test/integration/verify/controls/azure_data_factories.rb @@ -1,17 +1,17 @@ -resource_group = input('resource_group', value: nil) -factory_name = input('df_name', value: nil) -df_location = input('df_location', value: nil) +resource_group = input("resource_group", value: nil) +factory_name = input("df_name", value: nil) +df_location = input("df_location", value: nil) -control 'azure_data_factories' do +control "azure_data_factories" do - title 'Testing the plural resource of azure_data_factories.' - desc 'Testing the plural resource of azure_data_factories.' + title "Testing the plural resource of azure_data_factories." + desc "Testing the plural resource of azure_data_factories." describe azure_data_factories(resource_group: resource_group) do it { should exist } - its('names') { should include factory_name } - its('locations') { should include df_location } - its('types') { should include 'Microsoft.DataFactory/factories' } - its('provisioning_states') { should include('Succeeded') } + its("names") { should include factory_name } + its("locations") { should include df_location } + its("types") { should include "Microsoft.DataFactory/factories" } + its("provisioning_states") { should include("Succeeded") } end end diff --git a/test/integration/verify/controls/azure_data_factory.rb b/test/integration/verify/controls/azure_data_factory.rb index 04b23a60d..5035f8061 100644 --- a/test/integration/verify/controls/azure_data_factory.rb +++ b/test/integration/verify/controls/azure_data_factory.rb @@ -1,25 +1,25 @@ -resource_group = input('resource_group', value: nil) -factory_name = input('df_name', value: nil) -df_location = input('df_location', value: nil) +resource_group = input("resource_group", value: nil) +factory_name = input("df_name", value: nil) +df_location = input("df_location", value: nil) -control 'azure_data_factory' do +control "azure_data_factory" do - title 'Testing the singular resource of azure_data_factory.' - desc 'Testing the singular resource of azure_data_factory.' + title "Testing the singular resource of azure_data_factory." + desc "Testing the singular resource of azure_data_factory." describe azure_data_factory(resource_group: resource_group, name: factory_name) do it { should exist } - its('name') { should eq factory_name } - its('type') { should eq 'Microsoft.DataFactory/factories' } - its('provisioning_state') { should include('Succeeded') } - its('location') { should include df_location } + its("name") { should eq factory_name } + its("type") { should eq "Microsoft.DataFactory/factories" } + its("provisioning_state") { should include("Succeeded") } + its("location") { should include df_location } end - describe azure_data_factory(resource_group: resource_group, name: 'fake') do + describe azure_data_factory(resource_group: resource_group, name: "fake") do it { should_not exist } end - describe azure_data_factory(resource_group: 'fake', name: factory_name) do + describe azure_data_factory(resource_group: "fake", name: factory_name) do it { should_not exist } end end diff --git a/test/integration/verify/controls/azure_data_factory_dataset.rb b/test/integration/verify/controls/azure_data_factory_dataset.rb index f7aabdaed..da561080b 100644 --- a/test/integration/verify/controls/azure_data_factory_dataset.rb +++ b/test/integration/verify/controls/azure_data_factory_dataset.rb @@ -1,28 +1,28 @@ -resource_group = input('resource_group', value: nil) -factory_name = input('df_name', value: nil) -dataset_name = input('dataset_name', value: nil) -description = input('description', value: '') -linked_service_name = input('linked_service_name', value: nil) -dataset_type = input('dataset_type', value: nil) +resource_group = input("resource_group", value: nil) +factory_name = input("df_name", value: nil) +dataset_name = input("dataset_name", value: nil) +description = input("description", value: "") +linked_service_name = input("linked_service_name", value: nil) +dataset_type = input("dataset_type", value: nil) -control 'azure_data_factory_dataset' do +control "azure_data_factory_dataset" do - title 'Testing the singular resource of azure_data_factory_dataset.' - desc 'Testing the singular resource of azure_data_factory_dataset.' + title "Testing the singular resource of azure_data_factory_dataset." + desc "Testing the singular resource of azure_data_factory_dataset." describe azure_data_factory_dataset(resource_group: resource_group, factory_name: factory_name, dataset_name: dataset_name) do it { should exist } - its('name') { should eq dataset_name } - its('type') { should eq 'Microsoft.DataFactory/factories/datasets' } - its('properties.description') { should eq description } - its('properties.type') { should eq dataset_type } - its('properties.linkedServiceName.referenceName') { should eq linked_service_name } - its('properties.linkedServiceName.type') { should eq 'LinkedServiceReference' } + its("name") { should eq dataset_name } + its("type") { should eq "Microsoft.DataFactory/factories/datasets" } + its("properties.description") { should eq description } + its("properties.type") { should eq dataset_type } + its("properties.linkedServiceName.referenceName") { should eq linked_service_name } + its("properties.linkedServiceName.type") { should eq "LinkedServiceReference" } end - describe azure_data_factory_dataset(resource_group: resource_group, factory_name: 'fake', dataset_name: dataset_name) do + describe azure_data_factory_dataset(resource_group: resource_group, factory_name: "fake", dataset_name: dataset_name) do it { should_not exist } end - describe azure_data_factory_dataset(resource_group: resource_group, factory_name: factory_name, dataset_name: 'fake') do + describe azure_data_factory_dataset(resource_group: resource_group, factory_name: factory_name, dataset_name: "fake") do it { should_not exist } end end diff --git a/test/integration/verify/controls/azure_data_factory_datasets.rb b/test/integration/verify/controls/azure_data_factory_datasets.rb index 1cff3d703..23dd8bb5b 100644 --- a/test/integration/verify/controls/azure_data_factory_datasets.rb +++ b/test/integration/verify/controls/azure_data_factory_datasets.rb @@ -1,25 +1,25 @@ -resource_group = input('resource_group', value: nil) -factory_name = input('df_name', value: nil) -dataset_name = input('dataset_name', value: nil) -description = input('description', value: '') -linked_service_name = input('linked_service_name', value: nil) -dataset_type = input('dataset_type', value: nil) +resource_group = input("resource_group", value: nil) +factory_name = input("df_name", value: nil) +dataset_name = input("dataset_name", value: nil) +description = input("description", value: "") +linked_service_name = input("linked_service_name", value: nil) +dataset_type = input("dataset_type", value: nil) -control 'azure_data_factory_datasets' do +control "azure_data_factory_datasets" do - title 'Testing the plural resource of azure_data_factory_datasets.' - desc 'Testing the plural resource of azure_data_factory_datasets.' + title "Testing the plural resource of azure_data_factory_datasets." + desc "Testing the plural resource of azure_data_factory_datasets." describe azure_data_factory_datasets(resource_group: resource_group, factory_name: factory_name) do it { should exist } - its('names') { should include dataset_name } - its('types') { should include dataset_type } - its('descriptions') { should include description } - its('linkedServiceName_referenceNames') { should include linked_service_name } - its('linkedServiceName_types') { should include 'LinkedServiceReference' } + its("names") { should include dataset_name } + its("types") { should include dataset_type } + its("descriptions") { should include description } + its("linkedServiceName_referenceNames") { should include linked_service_name } + its("linkedServiceName_types") { should include "LinkedServiceReference" } end - describe azure_data_factory_datasets(resource_group: resource_group, factory_name: 'fake') do + describe azure_data_factory_datasets(resource_group: resource_group, factory_name: "fake") do it { should_not exist } end end diff --git a/test/integration/verify/controls/azure_data_factory_linked_service.rb b/test/integration/verify/controls/azure_data_factory_linked_service.rb index a54d8a82e..c347bcaa8 100644 --- a/test/integration/verify/controls/azure_data_factory_linked_service.rb +++ b/test/integration/verify/controls/azure_data_factory_linked_service.rb @@ -1,27 +1,27 @@ -resource_group1 = input('resource_group', value: nil) -factory_name1 = input('df_name', value: nil) -linked_service_name1 = input('linked_service_name', value: nil) +resource_group1 = input("resource_group", value: nil) +factory_name1 = input("df_name", value: nil) +linked_service_name1 = input("linked_service_name", value: nil) -control 'azure_data_factory_linked_service' do +control "azure_data_factory_linked_service" do - title 'Testing the singular resource of azure_data_factory_linked_service.' - desc 'Testing the singular resource of azure_data_factory_linked_service.' + title "Testing the singular resource of azure_data_factory_linked_service." + desc "Testing the singular resource of azure_data_factory_linked_service." describe azure_data_factory_linked_service(resource_group: resource_group1, factory_name: factory_name1, linked_service_name: linked_service_name1) do - it { should exist } - its('name') { should eq linked_service_name1 } - its('type') { should eq 'Microsoft.DataFactory/factories/linkedservices' } - its('linked_service_type') { should eq 'MySql' } - end + it { should exist } + its("name") { should eq linked_service_name1 } + its("type") { should eq "Microsoft.DataFactory/factories/linkedservices" } + its("linked_service_type") { should eq "MySql" } + end describe azure_data_factory_linked_service(resource_group: resource_group1, - factory_name: 'fake', linked_service_name: linked_service_name1) do - it { should_not exist } - end + factory_name: "fake", linked_service_name: linked_service_name1) do + it { should_not exist } + end describe azure_data_factory_linked_service(resource_group: resource_group1, - factory_name: factory_name1, linked_service_name: 'should_not_exist') do - it { should_not exist } - end + factory_name: factory_name1, linked_service_name: "should_not_exist") do + it { should_not exist } + end end diff --git a/test/integration/verify/controls/azure_data_factory_pipeline.rb b/test/integration/verify/controls/azure_data_factory_pipeline.rb index a37c018ba..2d947fae1 100644 --- a/test/integration/verify/controls/azure_data_factory_pipeline.rb +++ b/test/integration/verify/controls/azure_data_factory_pipeline.rb @@ -1,23 +1,23 @@ -resource_group = input('resource_group', value: nil) -factory_name = input('df_name', value: nil) -pipelines_name = input('df_pipeline_name', value: nil) +resource_group = input("resource_group", value: nil) +factory_name = input("df_name", value: nil) +pipelines_name = input("df_pipeline_name", value: nil) -control 'azure_data_factory_pipeline' do +control "azure_data_factory_pipeline" do - title 'Testing the singular resource of azure_data_factory_pipeline.' - desc 'Testing the singular resource of azure_data_factory_pipeline.' + title "Testing the singular resource of azure_data_factory_pipeline." + desc "Testing the singular resource of azure_data_factory_pipeline." describe azure_data_factory_pipeline(resource_group: resource_group, factory_name: factory_name, pipeline_name: pipelines_name) do it { should exist } - its('name') { should eq pipelines_name } - its('type') { should eq 'Microsoft.DataFactory/factories/pipelines' } + its("name") { should eq pipelines_name } + its("type") { should eq "Microsoft.DataFactory/factories/pipelines" } end - describe azure_data_factory_pipeline(resource_group: resource_group, factory_name: 'fake', pipeline_name: pipelines_name) do + describe azure_data_factory_pipeline(resource_group: resource_group, factory_name: "fake", pipeline_name: pipelines_name) do it { should_not exist } end - describe azure_data_factory_pipeline(resource_group: 'fake', factory_name: factory_name, pipeline_name: pipelines_name) do + describe azure_data_factory_pipeline(resource_group: "fake", factory_name: factory_name, pipeline_name: pipelines_name) do it { should_not exist } end end diff --git a/test/integration/verify/controls/azure_data_factory_pipelines.rb b/test/integration/verify/controls/azure_data_factory_pipelines.rb index 775a25a55..93c484c27 100644 --- a/test/integration/verify/controls/azure_data_factory_pipelines.rb +++ b/test/integration/verify/controls/azure_data_factory_pipelines.rb @@ -1,15 +1,15 @@ -resource_group = input('resource_group', value: nil) -factory_name = input('df_name', value: nil) -pipelines_name = input('df_pipeline_name', value: nil) +resource_group = input("resource_group", value: nil) +factory_name = input("df_name", value: nil) +pipelines_name = input("df_pipeline_name", value: nil) -control 'azure_data_factory_pipelines' do +control "azure_data_factory_pipelines" do - title 'Testing the plural resource of azure_data_factory_pipelines.' - desc 'Testing the plural resource of azure_data_factory_pipelines.' + title "Testing the plural resource of azure_data_factory_pipelines." + desc "Testing the plural resource of azure_data_factory_pipelines." describe azure_data_factory_pipelines(resource_group: resource_group, factory_name: factory_name) do it { should exist } - its('names') { should include pipelines_name } - its('types') { should include 'Microsoft.DataFactory/factories/pipelines' } + its("names") { should include pipelines_name } + its("types") { should include "Microsoft.DataFactory/factories/pipelines" } end end diff --git a/test/integration/verify/controls/azure_data_lake_storage_gen2_filesystem.rb b/test/integration/verify/controls/azure_data_lake_storage_gen2_filesystem.rb index b8be605f7..fb04a626e 100644 --- a/test/integration/verify/controls/azure_data_lake_storage_gen2_filesystem.rb +++ b/test/integration/verify/controls/azure_data_lake_storage_gen2_filesystem.rb @@ -1,15 +1,15 @@ -account_name = input(:inspec_adls_account_name, value: '') -filesystem = input(:inspec_adls_fs_name, value: '') +account_name = input(:inspec_adls_account_name, value: "") +filesystem = input(:inspec_adls_fs_name, value: "") -control 'verify settings of Azure Data Lake Gen2 Filesystem' do +control "verify settings of Azure Data Lake Gen2 Filesystem" do - title 'Testing the singular resource of azure_data_lake_storage_gen2_filesystem.' - desc 'Testing the singular resource of azure_data_lake_storage_gen2_filesystem.' + title "Testing the singular resource of azure_data_lake_storage_gen2_filesystem." + desc "Testing the singular resource of azure_data_lake_storage_gen2_filesystem." describe azure_data_lake_storage_gen2_filesystem(account_name: account_name, name: filesystem) do it { should exist } - its('x_ms_namespace_enabled') { should eq 'false' } - its('x_ms_default_encryption_scope') { should eq '$account-encryption-key' } - its('x_ms_deny_encryption_scope_override') { should eq 'false' } + its("x_ms_namespace_enabled") { should eq "false" } + its("x_ms_default_encryption_scope") { should eq "$account-encryption-key" } + its("x_ms_deny_encryption_scope_override") { should eq "false" } end end diff --git a/test/integration/verify/controls/azure_data_lake_storage_gen2_filesystems.rb b/test/integration/verify/controls/azure_data_lake_storage_gen2_filesystems.rb index 112318c88..f83456e3c 100644 --- a/test/integration/verify/controls/azure_data_lake_storage_gen2_filesystems.rb +++ b/test/integration/verify/controls/azure_data_lake_storage_gen2_filesystems.rb @@ -1,15 +1,15 @@ -account_name = input(:inspec_adls_account_name, value: '') -filesystem = input(:inspec_adls_fs_name, value: '') +account_name = input(:inspec_adls_account_name, value: "") +filesystem = input(:inspec_adls_fs_name, value: "") -control 'verify settings of all Azure Data Lake Gen2 Filesystems' do +control "verify settings of all Azure Data Lake Gen2 Filesystems" do - title 'Testing the plural resource of azure_data_lake_storage_gen2_filesystems.' - desc 'Testing the plural resource of azure_data_lake_storage_gen2_filesystems.' + title "Testing the plural resource of azure_data_lake_storage_gen2_filesystems." + desc "Testing the plural resource of azure_data_lake_storage_gen2_filesystems." describe azure_data_lake_storage_gen2_filesystems(account_name: account_name) do it { should exist } - its('names') { should include filesystem } - its('etags') { should_not be_empty } - its('DefaultEncryptionScopes') { should include '$account-encryption-key' } + its("names") { should include filesystem } + its("etags") { should_not be_empty } + its("DefaultEncryptionScopes") { should include "$account-encryption-key" } end end diff --git a/test/integration/verify/controls/azure_data_lake_storage_gen2_path.rb b/test/integration/verify/controls/azure_data_lake_storage_gen2_path.rb index 12c5a9ff0..2a57f61b7 100644 --- a/test/integration/verify/controls/azure_data_lake_storage_gen2_path.rb +++ b/test/integration/verify/controls/azure_data_lake_storage_gen2_path.rb @@ -1,13 +1,13 @@ -account_name = input(:inspec_adls_account_name, value: '') -filesystem = input(:inspec_adls_fs_name, value: '') -pathname = input(:inspec_adls_fs_path, value: '') +account_name = input(:inspec_adls_account_name, value: "") +filesystem = input(:inspec_adls_fs_name, value: "") +pathname = input(:inspec_adls_fs_path, value: "") -control 'verify settings of Azure Data Lake Gen2 Filesystem Path' do +control "verify settings of Azure Data Lake Gen2 Filesystem Path" do describe azure_data_lake_storage_gen2_path(account_name: account_name, filesystem: filesystem, name: pathname) do it { should exist } - its('x_ms_resource_type') { should eq 'file' } - its('x_ms_lease_state') { should eq 'available' } - its('x_ms_lease_status') { should eq 'unlocked' } - its('x_ms_server_encrypted') { should eq 'true' } + its("x_ms_resource_type") { should eq "file" } + its("x_ms_lease_state") { should eq "available" } + its("x_ms_lease_status") { should eq "unlocked" } + its("x_ms_server_encrypted") { should eq "true" } end end diff --git a/test/integration/verify/controls/azure_data_lake_storage_gen2_paths.rb b/test/integration/verify/controls/azure_data_lake_storage_gen2_paths.rb index 8c67e791c..8828c4034 100644 --- a/test/integration/verify/controls/azure_data_lake_storage_gen2_paths.rb +++ b/test/integration/verify/controls/azure_data_lake_storage_gen2_paths.rb @@ -1,10 +1,10 @@ -account_name = input(:inspec_adls_account_name, value: '') -filesystem = input(:inspec_adls_fs_name, value: '') +account_name = input(:inspec_adls_account_name, value: "") +filesystem = input(:inspec_adls_fs_name, value: "") -control 'verify settings of all Azure Data Lake Gen2 Paths' do +control "verify settings of all Azure Data Lake Gen2 Paths" do describe azure_data_lake_storage_gen2_paths(account_name: account_name, filesystem: filesystem) do it { should exist } - its('names') { should include filesystem } - its('etags') { should_not be_empty } + its("names") { should include filesystem } + its("etags") { should_not be_empty } end end diff --git a/test/integration/verify/controls/azure_db_migration_service.rb b/test/integration/verify/controls/azure_db_migration_service.rb index a3a6da892..d4b35dc59 100644 --- a/test/integration/verify/controls/azure_db_migration_service.rb +++ b/test/integration/verify/controls/azure_db_migration_service.rb @@ -3,15 +3,15 @@ sku_name = attribute(:inspec_db_migration_service_sku_name, value: nil) location = attribute(:location, value: nil) -control 'azure_db_migration_service' do +control "azure_db_migration_service" do - title 'Testing the singular resource of azure_db_migration_service.' - desc 'Testing the singular resource of azure_db_migration_service.' + title "Testing the singular resource of azure_db_migration_service." + desc "Testing the singular resource of azure_db_migration_service." describe azure_db_migration_service(resource_group: resource_group_name, service_name: service_name) do it { should exist } - its('sku.name') { should eq sku_name } - its('location') { should eq location.downcase.gsub("\s", '') } - its('properties.provisioningState') { should eq 'Succeeded' } + its("sku.name") { should eq sku_name } + its("location") { should eq location.downcase.gsub("\s", "") } + its("properties.provisioningState") { should eq "Succeeded" } end end diff --git a/test/integration/verify/controls/azure_db_migration_services.rb b/test/integration/verify/controls/azure_db_migration_services.rb index ae8061553..388eb253c 100644 --- a/test/integration/verify/controls/azure_db_migration_services.rb +++ b/test/integration/verify/controls/azure_db_migration_services.rb @@ -2,15 +2,15 @@ sku_name = attribute(:inspec_db_migration_service_sku_name, value: nil) location = attribute(:location, value: nil) -control 'azure_db_migration_services' do +control "azure_db_migration_services" do - title 'Testing the plural resource of azure_db_migration_services.' - desc 'Testing the plural resource of azure_db_migration_services.' + title "Testing the plural resource of azure_db_migration_services." + desc "Testing the plural resource of azure_db_migration_services." describe azure_db_migration_services do it { should exist } - its('names') { should include service_name } - its('sku_names') { should include sku_name } - its('locations') { should include location.downcase.gsub("\s", '') } + its("names") { should include service_name } + its("sku_names") { should include sku_name } + its("locations") { should include location.downcase.gsub("\s", "") } end end diff --git a/test/integration/verify/controls/azure_ddos_protection_resource.rb b/test/integration/verify/controls/azure_ddos_protection_resource.rb index 474678b01..c73b720a7 100644 --- a/test/integration/verify/controls/azure_ddos_protection_resource.rb +++ b/test/integration/verify/controls/azure_ddos_protection_resource.rb @@ -1,25 +1,25 @@ -resource_group = input('resource_group', value: nil) -ddos_protection_plan_name = input('ddos_protection_plan_name', value: nil) -df_location = input('ddos_protection_plan_location', value: nil) +resource_group = input("resource_group", value: nil) +ddos_protection_plan_name = input("ddos_protection_plan_name", value: nil) +df_location = input("ddos_protection_plan_location", value: nil) -control 'azure_ddos_protection_resource' do +control "azure_ddos_protection_resource" do - title 'Testing the singular resource of azure_ddos_protection_resource.' - desc 'Testing the singular resource of azure_ddos_protection_resource.' + title "Testing the singular resource of azure_ddos_protection_resource." + desc "Testing the singular resource of azure_ddos_protection_resource." describe azure_ddos_protection_resource(resource_group: resource_group, name: ddos_protection_plan_name) do it { should exist } - its('name') { should eq ddos_protection_plan_name } - its('type') { should eq 'Microsoft.Network/ddosProtectionPlans' } - its('provisioning_state') { should include('Succeeded') } - its('location') { should include df_location } + its("name") { should eq ddos_protection_plan_name } + its("type") { should eq "Microsoft.Network/ddosProtectionPlans" } + its("provisioning_state") { should include("Succeeded") } + its("location") { should include df_location } end - describe azure_ddos_protection_resource(resource_group: resource_group, name: 'fake') do + describe azure_ddos_protection_resource(resource_group: resource_group, name: "fake") do it { should_not exist } end - describe azure_ddos_protection_resource(resource_group: 'fake', name: ddos_protection_plan_name) do + describe azure_ddos_protection_resource(resource_group: "fake", name: ddos_protection_plan_name) do it { should_not exist } end end diff --git a/test/integration/verify/controls/azure_ddos_protection_resources.rb b/test/integration/verify/controls/azure_ddos_protection_resources.rb index 9ffe905f2..aade87110 100644 --- a/test/integration/verify/controls/azure_ddos_protection_resources.rb +++ b/test/integration/verify/controls/azure_ddos_protection_resources.rb @@ -1,17 +1,17 @@ -resource_group = input('resource_group', value: nil) -ddos_protection_plan_name = input('ddos_protection_plan_name', value: nil) -df_location = input('ddos_protection_plan_location', value: nil) +resource_group = input("resource_group", value: nil) +ddos_protection_plan_name = input("ddos_protection_plan_name", value: nil) +df_location = input("ddos_protection_plan_location", value: nil) -control 'azure_ddos_protection_resources' do +control "azure_ddos_protection_resources" do - title 'Testing the plural resource of azure_ddos_protection_resources.' - desc 'Testing the plural resource of azure_ddos_protection_resources.' + title "Testing the plural resource of azure_ddos_protection_resources." + desc "Testing the plural resource of azure_ddos_protection_resources." describe azure_ddos_protection_resources(resource_group: resource_group) do it { should exist } - its('names') { should include ddos_protection_plan_name } - its('locations') { should include df_location } - its('types') { should include 'Microsoft.Network/ddosProtectionPlans' } - its('provisioning_states') { should include('Succeeded') } + its("names") { should include ddos_protection_plan_name } + its("locations") { should include df_location } + its("types") { should include "Microsoft.Network/ddosProtectionPlans" } + its("provisioning_states") { should include("Succeeded") } end end diff --git a/test/integration/verify/controls/azure_dns_zones_resource.rb b/test/integration/verify/controls/azure_dns_zones_resource.rb index 6bd4252b0..4d04426cb 100644 --- a/test/integration/verify/controls/azure_dns_zones_resource.rb +++ b/test/integration/verify/controls/azure_dns_zones_resource.rb @@ -1,24 +1,24 @@ -resource_group = input('resource_group', value: nil) -dns_zones = input('dns_zones', value: nil) -dns_location = input('dns_location', value: nil) +resource_group = input("resource_group", value: nil) +dns_zones = input("dns_zones", value: nil) +dns_location = input("dns_location", value: nil) -control 'azure_dns_zones_resource' do +control "azure_dns_zones_resource" do - title 'Testing the singular resource of azure_dns_zones_resource.' - desc 'Testing the singular resource of azure_dns_zones_resource.' + title "Testing the singular resource of azure_dns_zones_resource." + desc "Testing the singular resource of azure_dns_zones_resource." describe azure_dns_zones_resource(resource_group: resource_group, name: dns_zones) do it { should exist } - its('name') { should eq dns_zones } - its('type') { should eq 'Microsoft.Network/dnszones' } - its('location') { should include dns_location } + its("name") { should eq dns_zones } + its("type") { should eq "Microsoft.Network/dnszones" } + its("location") { should include dns_location } end - describe azure_dns_zones_resource(resource_group: resource_group, name: 'fake') do + describe azure_dns_zones_resource(resource_group: resource_group, name: "fake") do it { should_not exist } end - describe azure_dns_zones_resource(resource_group: 'fake', name: dns_zones) do + describe azure_dns_zones_resource(resource_group: "fake", name: dns_zones) do it { should_not exist } end end diff --git a/test/integration/verify/controls/azure_dns_zones_resources.rb b/test/integration/verify/controls/azure_dns_zones_resources.rb index b38ac0ca8..9e13d5475 100644 --- a/test/integration/verify/controls/azure_dns_zones_resources.rb +++ b/test/integration/verify/controls/azure_dns_zones_resources.rb @@ -1,15 +1,15 @@ -dns_zones = input('dns_zones', value: nil) -dns_location = input('dns_location', value: nil) +dns_zones = input("dns_zones", value: nil) +dns_location = input("dns_location", value: nil) -control 'azure_dns_zones_resources' do +control "azure_dns_zones_resources" do - title 'Testing the plural resource of azure_dns_zones_resources.' - desc 'Testing the plural resource of azure_dns_zones_resources.' + title "Testing the plural resource of azure_dns_zones_resources." + desc "Testing the plural resource of azure_dns_zones_resources." describe azure_dns_zones_resources do it { should exist } - its('names') { should include dns_zones } - its('locations') { should include dns_location } - its('types') { should include 'Microsoft.Network/dnszones' } + its("names") { should include dns_zones } + its("locations") { should include dns_location } + its("types") { should include "Microsoft.Network/dnszones" } end end diff --git a/test/integration/verify/controls/azure_express_route_circuit.rb b/test/integration/verify/controls/azure_express_route_circuit.rb index c776b7504..9064f25cc 100644 --- a/test/integration/verify/controls/azure_express_route_circuit.rb +++ b/test/integration/verify/controls/azure_express_route_circuit.rb @@ -1,51 +1,51 @@ -resource_group = input('resource_group', value: nil) -circuit_name = input('circuitName', value: nil) -location = input('circuitLocation', value: nil) -global_reach_enabled = input('globalReachEnabled', value: false) -allow_global_reach = input('allowGlobalReach', value: false) -service_provider_provisioning_state = input('serviceProviderProvisioningState', value: nil) -gateway_manager_etag = input('gatewayManagerEtag', value: '') -allow_classic_operations = input('allowClassicOperations', value: false) -circuit_provisioning_state = input('circuitProvisioningState', value: nil) +resource_group = input("resource_group", value: nil) +circuit_name = input("circuitName", value: nil) +location = input("circuitLocation", value: nil) +global_reach_enabled = input("globalReachEnabled", value: false) +allow_global_reach = input("allowGlobalReach", value: false) +service_provider_provisioning_state = input("serviceProviderProvisioningState", value: nil) +gateway_manager_etag = input("gatewayManagerEtag", value: "") +allow_classic_operations = input("allowClassicOperations", value: false) +circuit_provisioning_state = input("circuitProvisioningState", value: nil) -bandwidth_in_mbps = input('bandwidthInMbps', value: nil) -peering_location = input('peeringLocation', value: nil) -service_provider_name = input('serviceProviderName', value: nil) +bandwidth_in_mbps = input("bandwidthInMbps", value: nil) +peering_location = input("peeringLocation", value: nil) +service_provider_name = input("serviceProviderName", value: nil) -sku_name = input('sku_name', value: nil) -sku_tier = input('sku_tier', value: nil) -sku_family = input('sku_family', value: nil) +sku_name = input("sku_name", value: nil) +sku_tier = input("sku_tier", value: nil) +sku_family = input("sku_family", value: nil) -control 'azure_express_route_circuit' do +control "azure_express_route_circuit" do - title 'Testing the singular resource of azure_express_route_circuit.' - desc 'Testing the singular resource of azure_express_route_circuit.' + title "Testing the singular resource of azure_express_route_circuit." + desc "Testing the singular resource of azure_express_route_circuit." describe azure_express_route_circuit(resource_group: resource_group, circuit_name: circuit_name) do it { should exist } - its('name') { should eq circuit_name } - its('type') { should eq 'Microsoft.Network/expressRouteCircuits' } - its('provisioning_state') { should include('Succeeded') } - its('location') { should include location } - its('service_provider_properties_bandwidth_in_mbps') { should eq bandwidth_in_mbps } - its('service_provider_properties_peering_location') { should include peering_location } - its('service_provider_properties_name') { should include service_provider_name } - its('service_provider_provisioning_state') { should eq service_provider_provisioning_state } - its('global_reach_enabled') { should eq global_reach_enabled } - its('allow_global_reach') { should eq allow_global_reach } - its('gateway_manager_etag') { should include gateway_manager_etag } - its('allow_classic_operations') { should eq allow_classic_operations } - its('circuit_provisioning_state') { should include circuit_provisioning_state } - its('sku_name') { should include sku_name } - its('sku_tier') { should include sku_tier } - its('sku_family') { should include sku_family } + its("name") { should eq circuit_name } + its("type") { should eq "Microsoft.Network/expressRouteCircuits" } + its("provisioning_state") { should include("Succeeded") } + its("location") { should include location } + its("service_provider_properties_bandwidth_in_mbps") { should eq bandwidth_in_mbps } + its("service_provider_properties_peering_location") { should include peering_location } + its("service_provider_properties_name") { should include service_provider_name } + its("service_provider_provisioning_state") { should eq service_provider_provisioning_state } + its("global_reach_enabled") { should eq global_reach_enabled } + its("allow_global_reach") { should eq allow_global_reach } + its("gateway_manager_etag") { should include gateway_manager_etag } + its("allow_classic_operations") { should eq allow_classic_operations } + its("circuit_provisioning_state") { should include circuit_provisioning_state } + its("sku_name") { should include sku_name } + its("sku_tier") { should include sku_tier } + its("sku_family") { should include sku_family } end - describe azure_express_route_circuit(resource_group: resource_group, circuit_name: 'fake') do + describe azure_express_route_circuit(resource_group: resource_group, circuit_name: "fake") do it { should_not exist } end - describe azure_express_route_circuit(resource_group: 'fake', circuit_name: circuit_name) do + describe azure_express_route_circuit(resource_group: "fake", circuit_name: circuit_name) do it { should_not exist } end end diff --git a/test/integration/verify/controls/azure_express_route_circuits.rb b/test/integration/verify/controls/azure_express_route_circuits.rb index e133eb2cc..0c7fb15b8 100644 --- a/test/integration/verify/controls/azure_express_route_circuits.rb +++ b/test/integration/verify/controls/azure_express_route_circuits.rb @@ -1,41 +1,41 @@ -erc_resource_group = input('resource_group', value: nil) -erc_circuit_name = input('circuitName', value: nil) -erc_location = input('circuitLocation', value: nil) -erc_global_reach_enabled = input('globalReachEnabled', value: false) -erc_allow_global_reach = input('allowGlobalReach', value: false) -erc_gateway_manager_etag = input('gatewayManagerEtag', value: '') -allow_classic_operations = input('allowClassicOperations', value: false) -circuit_provisioning_state = input('circuitProvisioningState', value: nil) +erc_resource_group = input("resource_group", value: nil) +erc_circuit_name = input("circuitName", value: nil) +erc_location = input("circuitLocation", value: nil) +erc_global_reach_enabled = input("globalReachEnabled", value: false) +erc_allow_global_reach = input("allowGlobalReach", value: false) +erc_gateway_manager_etag = input("gatewayManagerEtag", value: "") +allow_classic_operations = input("allowClassicOperations", value: false) +circuit_provisioning_state = input("circuitProvisioningState", value: nil) -bandwidth_in_mbps = input('bandwidthInMbps', value: nil) -peering_location = input('peeringLocation', value: nil) -service_provider_name = input('serviceProviderName', value: nil) +bandwidth_in_mbps = input("bandwidthInMbps", value: nil) +peering_location = input("peeringLocation", value: nil) +service_provider_name = input("serviceProviderName", value: nil) -sku_name = input('sku_name', value: nil) -sku_tier = input('sku_tier', value: nil) -sku_family = input('sku_family', value: nil) +sku_name = input("sku_name", value: nil) +sku_tier = input("sku_tier", value: nil) +sku_family = input("sku_family", value: nil) -control 'azure_express_route_circuits' do +control "azure_express_route_circuits" do - title 'Testing the plural resource of azure_express_route_circuits.' - desc 'Testing the plural resource of azure_express_route_circuits.' + title "Testing the plural resource of azure_express_route_circuits." + desc "Testing the plural resource of azure_express_route_circuits." describe azure_express_route_circuits(resource_group: erc_resource_group) do it { should exist } - its('names') { should include erc_circuit_name } - its('locations') { should include erc_location } - its('types') { should include 'Microsoft.Network/expressRouteCircuits' } - its('provisioning_states') { should include('Succeeded') } - its('service_provider_properties_bandwidth_in_mbps') { should include bandwidth_in_mbps } - its('service_provider_properties_peering_locations') { should include peering_location } - its('service_provider_properties_names') { should include service_provider_name } - its('global_reach_enabled') { should include erc_global_reach_enabled } - its('allow_global_reach') { should include erc_allow_global_reach } - its('gateway_manager_etags') { should include erc_gateway_manager_etag } - its('allow_classic_operations') { should include allow_classic_operations } - its('circuit_provisioning_states') { should include circuit_provisioning_state } - its('sku_names') { should include sku_name } - its('sku_tiers') { should include sku_tier } - its('sku_families') { should include sku_family } + its("names") { should include erc_circuit_name } + its("locations") { should include erc_location } + its("types") { should include "Microsoft.Network/expressRouteCircuits" } + its("provisioning_states") { should include("Succeeded") } + its("service_provider_properties_bandwidth_in_mbps") { should include bandwidth_in_mbps } + its("service_provider_properties_peering_locations") { should include peering_location } + its("service_provider_properties_names") { should include service_provider_name } + its("global_reach_enabled") { should include erc_global_reach_enabled } + its("allow_global_reach") { should include erc_allow_global_reach } + its("gateway_manager_etags") { should include erc_gateway_manager_etag } + its("allow_classic_operations") { should include allow_classic_operations } + its("circuit_provisioning_states") { should include circuit_provisioning_state } + its("sku_names") { should include sku_name } + its("sku_tiers") { should include sku_tier } + its("sku_families") { should include sku_family } end end diff --git a/test/integration/verify/controls/azure_express_route_providers.rb b/test/integration/verify/controls/azure_express_route_providers.rb index e31f1740f..a50a4b324 100644 --- a/test/integration/verify/controls/azure_express_route_providers.rb +++ b/test/integration/verify/controls/azure_express_route_providers.rb @@ -1,13 +1,13 @@ -express_route_name = input('express_route_name', value: nil) +express_route_name = input("express_route_name", value: nil) -control 'azure_express_route_providers' do +control "azure_express_route_providers" do - title 'Testing the plural resource of azure_express_route_providers.' - desc 'Testing the plural resource of azure_express_route_providers.' + title "Testing the plural resource of azure_express_route_providers." + desc "Testing the plural resource of azure_express_route_providers." describe azure_express_route_providers do - its('names') { should include express_route_name } - its('types') { should include 'Microsoft.Network/expressRouteServiceProviders' } - its('provisioning_states') { should include('Succeeded') } + its("names") { should include express_route_name } + its("types") { should include "Microsoft.Network/expressRouteServiceProviders" } + its("provisioning_states") { should include("Succeeded") } end end diff --git a/test/integration/verify/controls/azure_generic_resource.rb b/test/integration/verify/controls/azure_generic_resource.rb index a40255e23..f7c5b6aa3 100644 --- a/test/integration/verify/controls/azure_generic_resource.rb +++ b/test/integration/verify/controls/azure_generic_resource.rb @@ -1,76 +1,76 @@ -resource_group = input('resource_group', value: nil) -win_name = input('windows_vm_name', value: nil) -win_id = input('windows_vm_id', value: nil) -win_location = input('windows_vm_location', value: nil) -win_tags = input('windows_vm_tags', value: nil) +resource_group = input("resource_group", value: nil) +win_name = input("windows_vm_name", value: nil) +win_id = input("windows_vm_id", value: nil) +win_location = input("windows_vm_location", value: nil) +win_tags = input("windows_vm_tags", value: nil) -control 'azure_generic_resource' do +control "azure_generic_resource" do - title 'Testing the singular resource of azure_generic_resource.' - desc 'Testing the singular resource of azure_generic_resource.' + title "Testing the singular resource of azure_generic_resource." + desc "Testing the singular resource of azure_generic_resource." describe azure_generic_resource(resource_group: resource_group, name: win_name) do it { should exist } - its('id') { should cmp win_id } - its('name') { should eq win_name } - its('location') { should eq win_location } - its('tags') { should eq win_tags } - its('type') { should eq 'Microsoft.Compute/virtualMachines' } - its('zones') { should be_nil } + its("id") { should cmp win_id } + its("name") { should eq win_name } + its("location") { should eq win_location } + its("tags") { should eq win_tags } + its("type") { should eq "Microsoft.Compute/virtualMachines" } + its("zones") { should be_nil } end describe azure_generic_resource(resource_uri: "/resourceGroups/#{resource_group}/providers/Microsoft.Compute/virtualMachines", name: win_name, add_subscription_id: true) do it { should exist } - its('name') { should eq win_name } + its("name") { should eq win_name } end - describe azure_generic_resource(resource_provider: 'Microsoft.Compute/virtualMachines', resource_group: resource_group, name: win_name) do + describe azure_generic_resource(resource_provider: "Microsoft.Compute/virtualMachines", resource_group: resource_group, name: win_name) do it { should exist } end # If api_version is not provided, latest version should be used. describe azure_generic_resource(resource_group: resource_group, name: win_name) do - its('api_version_used_for_query_state') { should eq 'latest' } + its("api_version_used_for_query_state") { should eq "latest" } end # If supported by the resource type, the default api_version can be asked to use in the query. # If not supported, it will fall back to the latest api version. - describe azure_generic_resource(resource_group: resource_group, name: win_name, api_version: 'default') do - its('api_version_used_for_query_state') { should eq 'default' } + describe azure_generic_resource(resource_group: resource_group, name: win_name, api_version: "default") do + its("api_version_used_for_query_state") { should eq "default" } end # Invalid api version issue should be handled and the latest version should be used. - describe azure_generic_resource(resource_group: resource_group, name: win_name, api_version: 'invalid_api') do - its('api_version_used_for_query_state') { should eq 'latest' } + describe azure_generic_resource(resource_group: resource_group, name: win_name, api_version: "invalid_api") do + its("api_version_used_for_query_state") { should eq "latest" } end # If valid api version is provided, this can be confirmed. - describe azure_generic_resource(resource_group: resource_group, name: win_name, api_version: '2020-06-01') do - its('api_version_used_for_query_state') { should eq 'user_provided' } - its('api_version_used_for_query') { should eq '2020-06-01' } + describe azure_generic_resource(resource_group: resource_group, name: win_name, api_version: "2020-06-01") do + its("api_version_used_for_query_state") { should eq "user_provided" } + its("api_version_used_for_query") { should eq "2020-06-01" } end - describe azure_generic_resource(resource_group: resource_group, name: 'fake') do + describe azure_generic_resource(resource_group: resource_group, name: "fake") do it { should_not exist } end - describe azure_generic_resource(resource_group: 'fake', name: win_name) do + describe azure_generic_resource(resource_group: "fake", name: win_name) do it { should_not exist } end - describe azure_generic_resource(resource_group: 'fake', name: 'fake') do + describe azure_generic_resource(resource_group: "fake", name: "fake") do it { should_not exist } end - describe azure_generic_resource(resource_group: 'does-not-exist', name: win_name) do + describe azure_generic_resource(resource_group: "does-not-exist", name: win_name) do it { should_not exist } end describe azure_generic_resource(resource_group: resource_group, name: win_name) do - its('properties.osProfile.linuxConfiguration.ssh') { should be_nil } + its("properties.osProfile.linuxConfiguration.ssh") { should be_nil } end describe azure_generic_resource(resource_id: win_id) do - its('name') { should eq win_name } + its("name") { should eq win_name } end end diff --git a/test/integration/verify/controls/azure_generic_resources.rb b/test/integration/verify/controls/azure_generic_resources.rb index 2419bb0a7..2326feaf2 100644 --- a/test/integration/verify/controls/azure_generic_resources.rb +++ b/test/integration/verify/controls/azure_generic_resources.rb @@ -1,12 +1,12 @@ -resource_group = input('resource_group', value: nil) -vm_names = input('vm_names', value: []) -win_location = input('windows_vm_location', value: nil) -win_tags = input('windows_vm_tags', value: nil) +resource_group = input("resource_group", value: nil) +vm_names = input("vm_names", value: []) +win_location = input("windows_vm_location", value: nil) +win_tags = input("windows_vm_tags", value: nil) -control 'azure_generic_resources' do +control "azure_generic_resources" do - title 'Testing the plural resource of azure_generic_resources.' - desc 'Testing the plural resource of azure_generic_resources.' + title "Testing the plural resource of azure_generic_resources." + desc "Testing the plural resource of azure_generic_resources." describe azure_generic_resources do it { should exist } @@ -15,24 +15,24 @@ # Loop through resources via singular resource. azure_generic_resources(resource_group: resource_group).ids.each do |id| describe azure_generic_resource(resource_id: id) do - its('resource_group') { should cmp resource_group } + its("resource_group") { should cmp resource_group } end end describe azure_generic_resources(resource_group: resource_group) do - its('names') { should include(vm_names.first) } - its('tags') { should include(win_tags) } - its('locations') { should include(win_location) } - its('types') { should include('Microsoft.Compute/virtualMachines') } - its('provisioning_states') { should include('Succeeded') } + its("names") { should include(vm_names.first) } + its("tags") { should include(win_tags) } + its("locations") { should include(win_location) } + its("types") { should include("Microsoft.Compute/virtualMachines") } + its("provisioning_states") { should include("Succeeded") } end - describe azure_generic_resources(resource_uri: 'resourcegroups', add_subscription_id: true) do + describe azure_generic_resources(resource_uri: "resourcegroups", add_subscription_id: true) do it { should exist } - its('types.uniq') { should cmp ['Microsoft.Resources/resourceGroups'] } + its("types.uniq") { should cmp ["Microsoft.Resources/resourceGroups"] } end - describe azure_generic_resources(resource_group: 'fake-group') do + describe azure_generic_resources(resource_group: "fake-group") do it { should_not exist } end @@ -44,6 +44,6 @@ azure_generic_resources(substring_of_name: vm_names[-10..-1]).names.each do |name| describe azure_generic_resource(resource_group: resource_group, name: name) it { should exist } - its('name') { should cmp name } + its("name") { should cmp name } end end diff --git a/test/integration/verify/controls/azure_graph_generic_resource.rb b/test/integration/verify/controls/azure_graph_generic_resource.rb index da2b0df71..6d2c9c4e8 100644 --- a/test/integration/verify/controls/azure_graph_generic_resource.rb +++ b/test/integration/verify/controls/azure_graph_generic_resource.rb @@ -1,11 +1,11 @@ -control 'azure_graph_generic_resource' do +control "azure_graph_generic_resource" do - title 'Testing the singular resource of azure_graph_generic_resource.' - desc 'Testing the singular resource of azure_graph_generic_resource.' + title "Testing the singular resource of azure_graph_generic_resource." + desc "Testing the singular resource of azure_graph_generic_resource." user_id = azure_graph_users.user_principal_names.sample - describe azure_graph_generic_resource(resource: 'users', id: user_id) do + describe azure_graph_generic_resource(resource: "users", id: user_id) do it { should exist } - its('userPrincipalName') { should eq user_id } + its("userPrincipalName") { should eq user_id } end end diff --git a/test/integration/verify/controls/azure_hpc_asc_operation.rb b/test/integration/verify/controls/azure_hpc_asc_operation.rb index d168b83ed..7d0f042c4 100644 --- a/test/integration/verify/controls/azure_hpc_asc_operation.rb +++ b/test/integration/verify/controls/azure_hpc_asc_operation.rb @@ -1,9 +1,9 @@ -location = input(:location, value: '') +location = input(:location, value: "") -control 'Verify settings of an Azure HPC ASC Operation' do - describe azure_hpc_asc_operation(location: location, operation_id: 'testoperation') do +control "Verify settings of an Azure HPC ASC Operation" do + describe azure_hpc_asc_operation(location: location, operation_id: "testoperation") do it { should exist } - its('name') { should eq 'testoperation' } - its('status') { should eq 'Succeeded' } + its("name") { should eq "testoperation" } + its("status") { should eq "Succeeded" } end end diff --git a/test/integration/verify/controls/azure_hpc_cache.rb b/test/integration/verify/controls/azure_hpc_cache.rb index 4fc30404d..17a00954d 100644 --- a/test/integration/verify/controls/azure_hpc_cache.rb +++ b/test/integration/verify/controls/azure_hpc_cache.rb @@ -1,10 +1,10 @@ -name = input(:inspec_hpc_cache_name, value: '') -resource_group = input(:resource_group, value: '') -location = input(:location, value: '') +name = input(:inspec_hpc_cache_name, value: "") +resource_group = input(:resource_group, value: "") +location = input(:location, value: "") describe azure_hpc_cache(resource_group: resource_group, name: name) do it { should exist } - its('location') { should eq location } - its('provisioningState') { should eq 'Succeeded' } - its('properties.cacheSizeGB') { should eq 3072 } + its("location") { should eq location } + its("provisioningState") { should eq "Succeeded" } + its("properties.cacheSizeGB") { should eq 3072 } end diff --git a/test/integration/verify/controls/azure_hpc_cache_skus.rb b/test/integration/verify/controls/azure_hpc_cache_skus.rb index 3367a9098..8611daec5 100644 --- a/test/integration/verify/controls/azure_hpc_cache_skus.rb +++ b/test/integration/verify/controls/azure_hpc_cache_skus.rb @@ -1,10 +1,10 @@ describe azure_hpc_cache_skus do it { should exist } - its('tier') { should eq 'Standard' } - its('size') { should eq 'A0' } + its("tier") { should eq "Standard" } + its("size") { should eq "A0" } end -describe azure_hpc_cache_skus.where(tier: 'Standard') do +describe azure_hpc_cache_skus.where(tier: "Standard") do it { should exist } - its('size') { should eq 'A0' } + its("size") { should eq "A0" } end diff --git a/test/integration/verify/controls/azure_hpc_caches.rb b/test/integration/verify/controls/azure_hpc_caches.rb index 4a6834ee1..c407f40e2 100644 --- a/test/integration/verify/controls/azure_hpc_caches.rb +++ b/test/integration/verify/controls/azure_hpc_caches.rb @@ -1,10 +1,10 @@ -name = input(:inspec_hpc_cache_name, value: '') -location = input(:location, value: '') +name = input(:inspec_hpc_cache_name, value: "") +location = input(:location, value: "") describe azure_hpc_caches do it { should exist } - its('names') { should include name } - its('locations') { should include location } - its('provisioningStates') { should include 'Succeeded' } - its('cacheSizeGBs') { should include 3072 } + its("names") { should include name } + its("locations") { should include location } + its("provisioningStates") { should include "Succeeded" } + its("cacheSizeGBs") { should include 3072 } end diff --git a/test/integration/verify/controls/azure_hpc_storage_target.rb b/test/integration/verify/controls/azure_hpc_storage_target.rb index aa930a9a8..a9dfd84a8 100644 --- a/test/integration/verify/controls/azure_hpc_storage_target.rb +++ b/test/integration/verify/controls/azure_hpc_storage_target.rb @@ -1,13 +1,13 @@ -resource_group = input(:resource_group, value: '') -location = input(:location, value: '') -cache_name = input(:inspec_hpc_cache_name, value: '') +resource_group = input(:resource_group, value: "") +location = input(:location, value: "") +cache_name = input(:inspec_hpc_cache_name, value: "") -control 'Verify settings of an Azure HPC Storage Target' do - describe azure_hpc_storage_target(resource_group: resource_group, cache_name: cache_name, name: 'st1') do +control "Verify settings of an Azure HPC Storage Target" do + describe azure_hpc_storage_target(resource_group: resource_group, cache_name: cache_name, name: "st1") do it { should exist } - its('location') { should eq location.downcase.gsub("\s", '') } - its('properties.targetType') { should eq 'nfs3' } - its('properties.state') { should eq 'Ready' } - its('properties.nfs3.target') { should eq '10.0.44.44' } + its("location") { should eq location.downcase.gsub("\s", "") } + its("properties.targetType") { should eq "nfs3" } + its("properties.state") { should eq "Ready" } + its("properties.nfs3.target") { should eq "10.0.44.44" } end end diff --git a/test/integration/verify/controls/azure_hpc_storage_targets.rb b/test/integration/verify/controls/azure_hpc_storage_targets.rb index 1632aef4a..14d8a181e 100644 --- a/test/integration/verify/controls/azure_hpc_storage_targets.rb +++ b/test/integration/verify/controls/azure_hpc_storage_targets.rb @@ -1,13 +1,13 @@ -resource_group = input(:resource_group, value: '') -location = input(:location, value: '') -cache_name = input(:inspec_hpc_cache_name, value: '') +resource_group = input(:resource_group, value: "") +location = input(:location, value: "") +cache_name = input(:inspec_hpc_cache_name, value: "") -control 'Verify settings of all Azure HPC Storage Targets' do +control "Verify settings of all Azure HPC Storage Targets" do describe azure_hpc_storage_targets(resource_group: resource_group, cache_name: cache_name) do it { should exist } - its('name') { should include 'st1' } - its('locations') { should include location.downcase.gsub("\s", '') } - its('states') { should include 'Ready' } - its('targetTypes') { should include 'nfs3' } + its("name") { should include "st1" } + its("locations") { should include location.downcase.gsub("\s", "") } + its("states") { should include "Ready" } + its("targetTypes") { should include "nfs3" } end end diff --git a/test/integration/verify/controls/azure_key_vault.rb b/test/integration/verify/controls/azure_key_vault.rb index 22f0865e7..427e9990b 100644 --- a/test/integration/verify/controls/azure_key_vault.rb +++ b/test/integration/verify/controls/azure_key_vault.rb @@ -1,22 +1,22 @@ -resource_group = input('resource_group', value: nil) -vault_name = input('key_vault_name', value: nil) +resource_group = input("resource_group", value: nil) +vault_name = input("key_vault_name", value: nil) -control 'azure_key_vault' do +control "azure_key_vault" do - title 'Testing the singular resource of azure_key_vault.' - desc 'Testing the singular resource of azure_key_vault.' + title "Testing the singular resource of azure_key_vault." + desc "Testing the singular resource of azure_key_vault." describe azure_key_vault(resource_group: resource_group, vault_name: vault_name) do it { should exist } - its('name') { should eq vault_name } - its('type') { should eq 'Microsoft.KeyVault/vaults' } + its("name") { should eq vault_name } + its("type") { should eq "Microsoft.KeyVault/vaults" } end - describe azure_key_vault(resource_group: resource_group, vault_name: 'fake') do + describe azure_key_vault(resource_group: resource_group, vault_name: "fake") do it { should_not exist } end - describe azure_key_vault(resource_group: 'fake', vault_name: vault_name) do + describe azure_key_vault(resource_group: "fake", vault_name: vault_name) do it { should_not exist } end end diff --git a/test/integration/verify/controls/azure_managed_application.rb b/test/integration/verify/controls/azure_managed_application.rb index b1cc0630c..4e1e40485 100644 --- a/test/integration/verify/controls/azure_managed_application.rb +++ b/test/integration/verify/controls/azure_managed_application.rb @@ -1,11 +1,11 @@ -resource_group = input(:resource_group, value: '') -inspec_managed_app = input(:inspec_managed_app, value: '') +resource_group = input(:resource_group, value: "") +inspec_managed_app = input(:inspec_managed_app, value: "") -control 'test the properties of an Azure Managed APP' do +control "test the properties of an Azure Managed APP" do describe azure_managed_application(resource_group: resource_group, name: inspec_managed_app) do it { should exist } - its('kind') { should eq 'ServiceCatalog' } - its('location') { should eq location } - its('properties.provisioningState') { should eq 'Created' } + its("kind") { should eq "ServiceCatalog" } + its("location") { should eq location } + its("properties.provisioningState") { should eq "Created" } end end diff --git a/test/integration/verify/controls/azure_managed_applications.rb b/test/integration/verify/controls/azure_managed_applications.rb index dcbb797ba..e906f8412 100644 --- a/test/integration/verify/controls/azure_managed_applications.rb +++ b/test/integration/verify/controls/azure_managed_applications.rb @@ -1,14 +1,14 @@ -resource_group = input(:resource_group, value: '') -inspec_managed_app = input(:inspec_managed_app, value: '') -location = input(:location, value: '') +resource_group = input(:resource_group, value: "") +inspec_managed_app = input(:inspec_managed_app, value: "") +location = input(:location, value: "") -control 'test the properties of all Azure Service Bus Namespaces' do +control "test the properties of all Azure Service Bus Namespaces" do describe azure_managed_applications(resource_group: resource_group) do it { should exist } - its('names') { should include inspec_managed_app } - its('managementModes') { should include 'Managed' } - its('locations') { should include location } - its('types') { should include 'Microsoft.Solutions/applications' } - its('provisioningStates') { should include 'Created' } + its("names") { should include inspec_managed_app } + its("managementModes") { should include "Managed" } + its("locations") { should include location } + its("types") { should include "Microsoft.Solutions/applications" } + its("provisioningStates") { should include "Created" } end end diff --git a/test/integration/verify/controls/azure_microsoft_defender_pricing.rb b/test/integration/verify/controls/azure_microsoft_defender_pricing.rb index 6a8e68e22..7ce41d44e 100644 --- a/test/integration/verify/controls/azure_microsoft_defender_pricing.rb +++ b/test/integration/verify/controls/azure_microsoft_defender_pricing.rb @@ -1,29 +1,29 @@ -control 'azure_microsoft_defender_pricing' do - title 'Testing the singular resource of azure_microsoft_defender_pricing.' - desc 'Testing the singular resource of azure_microsoft_defender_pricing.' +control "azure_microsoft_defender_pricing" do + title "Testing the singular resource of azure_microsoft_defender_pricing." + desc "Testing the singular resource of azure_microsoft_defender_pricing." - describe azure_microsoft_defender_pricing(name: 'VirtualMachines') do + describe azure_microsoft_defender_pricing(name: "VirtualMachines") do it { should exist } end - describe azure_microsoft_defender_pricing(name: 'VirtualMachines') do - its('id') { should_not be_empty } - its('name') { should eq 'VirtualMachines' } - its('type') { should eq 'Microsoft.Security/pricings' } + describe azure_microsoft_defender_pricing(name: "VirtualMachines") do + its("id") { should_not be_empty } + its("name") { should eq "VirtualMachines" } + its("type") { should eq "Microsoft.Security/pricings" } - its('properties.subPlan') { should eq 'P2' } - its('properties.pricingTier') { should eq 'Standard' } - its('properties.freeTrialRemainingTime') { should eq 'PT0S' } + its("properties.subPlan") { should eq "P2" } + its("properties.pricingTier") { should eq "Standard" } + its("properties.freeTrialRemainingTime") { should eq "PT0S" } end end -control 'Test the Pricing Tier of each resources from the plural resource' do - title 'Checking the pricing tier.' - desc 'Test the Pricing Tier of each resources from the plural resource.' +control "Test the Pricing Tier of each resources from the plural resource" do + title "Checking the pricing tier." + desc "Test the Pricing Tier of each resources from the plural resource." azure_microsoft_defender_pricings.entries.each do |entry| describe azure_microsoft_defender_pricing(name: entry.name) do - its('properties.pricingTier') { should eq 'Standard' } + its("properties.pricingTier") { should eq "Standard" } end end end diff --git a/test/integration/verify/controls/azure_microsoft_defender_pricing_setting.rb b/test/integration/verify/controls/azure_microsoft_defender_pricing_setting.rb index 3f1d4b5bb..004e83365 100644 --- a/test/integration/verify/controls/azure_microsoft_defender_pricing_setting.rb +++ b/test/integration/verify/controls/azure_microsoft_defender_pricing_setting.rb @@ -1,19 +1,19 @@ -control 'azure_microsoft_defender_setting' do - title 'Testing the singular resource of azure_microsoft_defender_setting.' - desc 'Testing the singular resource of azure_microsoft_defender_setting.' +control "azure_microsoft_defender_setting" do + title "Testing the singular resource of azure_microsoft_defender_setting." + desc "Testing the singular resource of azure_microsoft_defender_setting." - describe azure_microsoft_defender_setting(name: 'MCAS') do + describe azure_microsoft_defender_setting(name: "MCAS") do it { should exist } end - describe azure_microsoft_defender_setting(name: 'MCAS') do - its('id') { should_not be_empty } - its('name') { should eq 'MCAS' } - its('type') { should eq 'Microsoft.Security/settings' } - its('kind') { should eq 'DataExportSettings' } + describe azure_microsoft_defender_setting(name: "MCAS") do + its("id") { should_not be_empty } + its("name") { should eq "MCAS" } + its("type") { should eq "Microsoft.Security/settings" } + its("kind") { should eq "DataExportSettings" } end - describe azure_microsoft_defender_setting(name: 'MCAS') do - its('properties.enabled') { should be true } + describe azure_microsoft_defender_setting(name: "MCAS") do + its("properties.enabled") { should be true } end end diff --git a/test/integration/verify/controls/azure_microsoft_defender_pricing_settings.rb b/test/integration/verify/controls/azure_microsoft_defender_pricing_settings.rb index e53c21722..c17ed0b1a 100644 --- a/test/integration/verify/controls/azure_microsoft_defender_pricing_settings.rb +++ b/test/integration/verify/controls/azure_microsoft_defender_pricing_settings.rb @@ -1,16 +1,16 @@ -control 'azure_microsoft_defender_settings' do - title 'Testing the plural resource of azure_microsoft_defender_settings.' - desc 'Testing the plural resource of azure_microsoft_defender_settings.' +control "azure_microsoft_defender_settings" do + title "Testing the plural resource of azure_microsoft_defender_settings." + desc "Testing the plural resource of azure_microsoft_defender_settings." describe azure_microsoft_defender_settings do it { should exist } end describe azure_microsoft_defender_settings do - its('ids') { should_not be_empty } - its('names') { should include 'MCAS' } - its('types') { should include 'Microsoft.Security/settings' } - its('kinds') { should include 'DataExportSettings' } - its('properties') { should_not be_empty } + its("ids") { should_not be_empty } + its("names") { should include "MCAS" } + its("types") { should include "Microsoft.Security/settings" } + its("kinds") { should include "DataExportSettings" } + its("properties") { should_not be_empty } end end diff --git a/test/integration/verify/controls/azure_microsoft_defender_pricings.rb b/test/integration/verify/controls/azure_microsoft_defender_pricings.rb index 7ede26289..99ecd7dc6 100644 --- a/test/integration/verify/controls/azure_microsoft_defender_pricings.rb +++ b/test/integration/verify/controls/azure_microsoft_defender_pricings.rb @@ -1,18 +1,18 @@ -control 'azure_microsoft_defender_pricings' do - title 'Testing the singular resource of azure_microsoft_defender_pricing.' - desc 'Testing the singular resource of azure_microsoft_defender_pricing.' +control "azure_microsoft_defender_pricings" do + title "Testing the singular resource of azure_microsoft_defender_pricing." + desc "Testing the singular resource of azure_microsoft_defender_pricing." describe azure_microsoft_defender_pricings do it { should exist } end describe azure_microsoft_defender_pricings do - its('ids') { should_not be_empty } - its('names') { should include 'VirtualMachines' } - its('types') { should include 'Microsoft.Security/pricings' } + its("ids") { should_not be_empty } + its("names") { should include "VirtualMachines" } + its("types") { should include "Microsoft.Security/pricings" } - its('subPlans') { should include 'P2' } - its('pricingTiers') { should include 'Standard' } - its('freeTrialRemainingTimes') { should include 'PT0S' } + its("subPlans") { should include "P2" } + its("pricingTiers") { should include "Standard" } + its("freeTrialRemainingTimes") { should include "PT0S" } end end diff --git a/test/integration/verify/controls/azure_microsoft_defender_security_contact.rb b/test/integration/verify/controls/azure_microsoft_defender_security_contact.rb index bd0ac9451..96d9d0a0e 100644 --- a/test/integration/verify/controls/azure_microsoft_defender_security_contact.rb +++ b/test/integration/verify/controls/azure_microsoft_defender_security_contact.rb @@ -1,26 +1,26 @@ -control 'azure_microsoft_defender_security_contact' do - title 'Testing the singular resource of azure_microsoft_defender_security_contact.' - desc 'Testing the singular resource of azure_microsoft_defender_security_contact.' +control "azure_microsoft_defender_security_contact" do + title "Testing the singular resource of azure_microsoft_defender_security_contact." + desc "Testing the singular resource of azure_microsoft_defender_security_contact." - describe azure_microsoft_defender_security_contact(name: 'default') do + describe azure_microsoft_defender_security_contact(name: "default") do it { should exist } end - describe azure_microsoft_defender_security_contact(name: 'default') do - its('id') { should_not be_empty } - its('name') { should eq 'default' } - its('type') { should eq 'Microsoft.Security/securityContacts' } - its('etag') { should_not be_empty } - its('location') { should eq 'West Europe' } + describe azure_microsoft_defender_security_contact(name: "default") do + its("id") { should_not be_empty } + its("name") { should eq "default" } + its("type") { should eq "Microsoft.Security/securityContacts" } + its("etag") { should_not be_empty } + its("location") { should eq "West Europe" } end - describe azure_microsoft_defender_security_contact(name: 'default') do - its('properties.notificationsByRole.state') { should eq 'On' } - its('properties.notificationsByRole.roles') { should include 'Owner' } + describe azure_microsoft_defender_security_contact(name: "default") do + its("properties.notificationsByRole.state") { should eq "On" } + its("properties.notificationsByRole.roles") { should include "Owner" } - its('properties.emails') { should be_empty } - its('properties.phone') { should be_empty } - its('properties.alertNotifications.state') { should include 'Off' } - its('properties.alertNotifications.minimalSeverity') { should include 'High' } + its("properties.emails") { should be_empty } + its("properties.phone") { should be_empty } + its("properties.alertNotifications.state") { should include "Off" } + its("properties.alertNotifications.minimalSeverity") { should include "High" } end end diff --git a/test/integration/verify/controls/azure_migrate_assessment.rb b/test/integration/verify/controls/azure_migrate_assessment.rb index ce0287506..ec3afa7d0 100644 --- a/test/integration/verify/controls/azure_migrate_assessment.rb +++ b/test/integration/verify/controls/azure_migrate_assessment.rb @@ -1,21 +1,21 @@ -resource_group = input(:resource_group, value: '') -project_name = input(:inspec_migrate_project_name, value: '') +resource_group = input(:resource_group, value: "") +project_name = input(:inspec_migrate_project_name, value: "") # either way these are manual values since there is no terraform resource available -group_name = 'inspec-migrate-test-assement-group' -name = 'inspec-migrate-test-assement' +group_name = "inspec-migrate-test-assement-group" +name = "inspec-migrate-test-assement" -control 'verify a azure migrate assessment' do +control "verify a azure migrate assessment" do - title 'Testing the singular resource of azure_migrate_assessment.' - desc 'Testing the singular resource of azure_migrate_assessment.' + title "Testing the singular resource of azure_migrate_assessment." + desc "Testing the singular resource of azure_migrate_assessment." describe azure_migrate_assessment(resource_group: resource_group, project_name: project_name, group_name: group_name, name: name) do it { should exist } - its('name') { should eq name } - its('type') { should eq 'Microsoft.Migrate/assessmentprojects/groups/assessments' } - its('properties.azurePricingTier') { should eq 'Standard' } - its('properties.azureStorageRedundancy') { should eq 'LocallyRedundant' } - its('properties.groupType') { should eq 'Import' } - its('properties.scalingFactor') { should eq 1.0 } + its("name") { should eq name } + its("type") { should eq "Microsoft.Migrate/assessmentprojects/groups/assessments" } + its("properties.azurePricingTier") { should eq "Standard" } + its("properties.azureStorageRedundancy") { should eq "LocallyRedundant" } + its("properties.groupType") { should eq "Import" } + its("properties.scalingFactor") { should eq 1.0 } end end diff --git a/test/integration/verify/controls/azure_migrate_assessment_group.rb b/test/integration/verify/controls/azure_migrate_assessment_group.rb index 801e9cbce..b7389e244 100644 --- a/test/integration/verify/controls/azure_migrate_assessment_group.rb +++ b/test/integration/verify/controls/azure_migrate_assessment_group.rb @@ -1,16 +1,16 @@ -resource_group = input(:resource_group, value: '') -project_name = input(:inspec_migrate_project_name, value: '') +resource_group = input(:resource_group, value: "") +project_name = input(:inspec_migrate_project_name, value: "") # either way these are manual values since there is no terraform resource available -name = 'inspec-migrate-test-assement-group' +name = "inspec-migrate-test-assement-group" -control 'Verify a azure migrate assessment' do +control "Verify a azure migrate assessment" do - title 'Testing the singular resource of azure_migrate_assessment.' - desc 'Testing the singular resource of azure_migrate_assessment.' + title "Testing the singular resource of azure_migrate_assessment." + desc "Testing the singular resource of azure_migrate_assessment." describe azure_migrate_assessment(resource_group: resource_group, project_name: project_name, name: name) do it { should exist } - its('name') { should eq name } - its('type') { should eq 'Microsoft.Migrate/assessmentprojects/groups' } + its("name") { should eq name } + its("type") { should eq "Microsoft.Migrate/assessmentprojects/groups" } end end diff --git a/test/integration/verify/controls/azure_migrate_assessment_groups.rb b/test/integration/verify/controls/azure_migrate_assessment_groups.rb index c3aeb6d41..a8ac9c80e 100644 --- a/test/integration/verify/controls/azure_migrate_assessment_groups.rb +++ b/test/integration/verify/controls/azure_migrate_assessment_groups.rb @@ -1,15 +1,15 @@ -resource_group = input(:resource_group, value: '') -project_name = input(:inspec_migrate_project_name, value: '') -name = 'inspec-migrate-test-assement-group' +resource_group = input(:resource_group, value: "") +project_name = input(:inspec_migrate_project_name, value: "") +name = "inspec-migrate-test-assement-group" -control 'verify all azure migrate assessments in a project' do +control "verify all azure migrate assessments in a project" do - title 'Testing the plural resource of azure_migrate_assessment_groups.' - desc 'Testing the plural resource of azure_migrate_assessment_groups.' + title "Testing the plural resource of azure_migrate_assessment_groups." + desc "Testing the plural resource of azure_migrate_assessment_groups." describe azure_migrate_assessment_groups(resource_group: resource_group, project_name: project_name) do it { should exist } - its('names') { should include name } - its('types') { should include 'Microsoft.Migrate/assessmentprojects/groups' } + its("names") { should include name } + its("types") { should include "Microsoft.Migrate/assessmentprojects/groups" } end end diff --git a/test/integration/verify/controls/azure_migrate_assessment_machine.rb b/test/integration/verify/controls/azure_migrate_assessment_machine.rb index 348ed28c4..f9c28b827 100644 --- a/test/integration/verify/controls/azure_migrate_assessment_machine.rb +++ b/test/integration/verify/controls/azure_migrate_assessment_machine.rb @@ -1,19 +1,19 @@ -resource_group = input(:resource_group, value: '') -project_name = input(:inspec_migrate_project_name, value: '') +resource_group = input(:resource_group, value: "") +project_name = input(:inspec_migrate_project_name, value: "") # either way these are manual values since there is no terraform resource available -name = 'inspec-migrate-test-assement' +name = "inspec-migrate-test-assement" -control 'Verify a azure migrate assessment machine' do +control "Verify a azure migrate assessment machine" do - title 'Testing the singular resource of azure_migrate_assessment_machine.' - desc 'Testing the singular resource of azure_migrate_assessment_machine.' + title "Testing the singular resource of azure_migrate_assessment_machine." + desc "Testing the singular resource of azure_migrate_assessment_machine." describe azure_migrate_assessment_machine(resource_group: resource_group, project_name: project_name, name: name) do it { should exist } - its('name') { should eq name } - its('type') { should eq 'Microsoft.Migrate/assessmentprojects/machines' } - its('properties.bootType') { should eq 'BIOS' } - its('properties.megabytesOfMemory') { should eq 16384 } - its('properties.numberOfCores') { should eq 8 } + its("name") { should eq name } + its("type") { should eq "Microsoft.Migrate/assessmentprojects/machines" } + its("properties.bootType") { should eq "BIOS" } + its("properties.megabytesOfMemory") { should eq 16384 } + its("properties.numberOfCores") { should eq 8 } end end diff --git a/test/integration/verify/controls/azure_migrate_assessment_machines.rb b/test/integration/verify/controls/azure_migrate_assessment_machines.rb index 966f38557..9569cd0ac 100644 --- a/test/integration/verify/controls/azure_migrate_assessment_machines.rb +++ b/test/integration/verify/controls/azure_migrate_assessment_machines.rb @@ -1,18 +1,18 @@ -resource_group = input(:resource_group, value: '') -project_name = input(:inspec_migrate_project_name, value: '') -name = 'inspec-migrate-test-assement' +resource_group = input(:resource_group, value: "") +project_name = input(:inspec_migrate_project_name, value: "") +name = "inspec-migrate-test-assement" -control 'verify all azure migrate assessment machines in a project' do +control "verify all azure migrate assessment machines in a project" do - title 'Testing the plural resource of azure_migrate_assessment_machines.' - desc 'Testing the plural resource of azure_migrate_assessment_machines.' + title "Testing the plural resource of azure_migrate_assessment_machines." + desc "Testing the plural resource of azure_migrate_assessment_machines." describe azure_migrate_assessment_machines(resource_group: resource_group, project_name: project_name) do it { should exist } - its('names') { should include name } - its('types') { should include 'Microsoft.Migrate/assessmentprojects/machines' } - its('bootTypes') { should include 'BIOS' } - its('megabytesOfMemories') { should include 16384 } - its('numberOfCores') { should include 8 } + its("names") { should include name } + its("types") { should include "Microsoft.Migrate/assessmentprojects/machines" } + its("bootTypes") { should include "BIOS" } + its("megabytesOfMemories") { should include 16384 } + its("numberOfCores") { should include 8 } end end diff --git a/test/integration/verify/controls/azure_migrate_assessment_project.rb b/test/integration/verify/controls/azure_migrate_assessment_project.rb index 3a788e658..605592f90 100644 --- a/test/integration/verify/controls/azure_migrate_assessment_project.rb +++ b/test/integration/verify/controls/azure_migrate_assessment_project.rb @@ -1,21 +1,21 @@ -location = input(:location, value: '') -resource_group = input(:resource_group, value: '') -project_name = input(:inspec_migrate_project_name, value: '') +location = input(:location, value: "") +resource_group = input(:resource_group, value: "") +project_name = input(:inspec_migrate_project_name, value: "") -control 'Verifies the settings of a Azure Migrate Assessment Project' do +control "Verifies the settings of a Azure Migrate Assessment Project" do - title 'Testing the singular resource of azure_migrate_assessment_project.' - desc 'Testing the singular resource of azure_migrate_assessment_project.' + title "Testing the singular resource of azure_migrate_assessment_project." + desc "Testing the singular resource of azure_migrate_assessment_project." describe azure_migrate_assessment_project(resource_group: resource_group, name: project_name) do it { should exist } - its('location') { should eq location } - its('publicNetworkAccess') { should eq 'Enabled' } - its('numberOfGroups') { should eq '1' } - its('numberOfMachines') { should eq 10 } - its('numberOfImportMachines') { should eq 10 } - its('numberOfAssessments') { should eq 2 } - its('projectStatus') { should eq 'Active' } - its('provisioningState') { should eq 'Succeeded' } + its("location") { should eq location } + its("publicNetworkAccess") { should eq "Enabled" } + its("numberOfGroups") { should eq "1" } + its("numberOfMachines") { should eq 10 } + its("numberOfImportMachines") { should eq 10 } + its("numberOfAssessments") { should eq 2 } + its("projectStatus") { should eq "Active" } + its("provisioningState") { should eq "Succeeded" } end end diff --git a/test/integration/verify/controls/azure_migrate_assessment_projects.rb b/test/integration/verify/controls/azure_migrate_assessment_projects.rb index edc2a4442..b5a0962a6 100644 --- a/test/integration/verify/controls/azure_migrate_assessment_projects.rb +++ b/test/integration/verify/controls/azure_migrate_assessment_projects.rb @@ -1,19 +1,19 @@ -location = input(:location, value: '') +location = input(:location, value: "") -control 'Verifies settings for a collection of Azure Migrate Assessment Projects' do +control "Verifies settings for a collection of Azure Migrate Assessment Projects" do - title 'Testing the plural resource of azure_migrate_assessment_projects.' - desc 'Testing the plural resource of azure_migrate_assessment_projects.' + title "Testing the plural resource of azure_migrate_assessment_projects." + desc "Testing the plural resource of azure_migrate_assessment_projects." describe azure_migrate_assessment_projects do it { should exist } - its('locations') { should include location } - its('publicNetworkAccesses') { should include 'Enabled' } - its('numberOfGroups') { should include '1' } - its('numberOfMachines') { should include 10 } - its('numberOfImportMachines') { should include 10 } - its('numberOfAssessments') { should include 2 } - its('projectStatuses') { should include 'Active' } - its('provisioningStates') { should include 'Succeeded' } + its("locations") { should include location } + its("publicNetworkAccesses") { should include "Enabled" } + its("numberOfGroups") { should include "1" } + its("numberOfMachines") { should include 10 } + its("numberOfImportMachines") { should include 10 } + its("numberOfAssessments") { should include 2 } + its("projectStatuses") { should include "Active" } + its("provisioningStates") { should include "Succeeded" } end end diff --git a/test/integration/verify/controls/azure_migrate_assessments.rb b/test/integration/verify/controls/azure_migrate_assessments.rb index b4f4b9c45..6c86d4876 100644 --- a/test/integration/verify/controls/azure_migrate_assessments.rb +++ b/test/integration/verify/controls/azure_migrate_assessments.rb @@ -1,20 +1,20 @@ -resource_group = input(:resource_group, value: '') -project_name = input(:inspec_migrate_project_name, value: '') +resource_group = input(:resource_group, value: "") +project_name = input(:inspec_migrate_project_name, value: "") -name = 'inspec-migrate-test-assement' +name = "inspec-migrate-test-assement" -control 'verify all azure migrate assessments in a project' do +control "verify all azure migrate assessments in a project" do - title 'Testing the plural resource of azure_migrate_assessments.' - desc 'Testing the plural resource of azure_migrate_assessments.' + title "Testing the plural resource of azure_migrate_assessments." + desc "Testing the plural resource of azure_migrate_assessments." describe azure_migrate_assessments(resource_group: resource_group, project_name: project_name) do it { should exist } - its('names') { should include name } - its('types') { should include 'Microsoft.Migrate/assessmentprojects/groups/assessments' } - its('azurePricingTiers') { should include 'Standard' } - its('azureStorageRedundancies') { should include 'LocallyRedundant' } - its('groupTypes') { should include 'Import' } - its('scalingFactors') { should include 1.0 } + its("names") { should include name } + its("types") { should include "Microsoft.Migrate/assessmentprojects/groups/assessments" } + its("azurePricingTiers") { should include "Standard" } + its("azureStorageRedundancies") { should include "LocallyRedundant" } + its("groupTypes") { should include "Import" } + its("scalingFactors") { should include 1.0 } end end diff --git a/test/integration/verify/controls/azure_migrate_project.rb b/test/integration/verify/controls/azure_migrate_project.rb index 38d58500e..67d5fbf26 100644 --- a/test/integration/verify/controls/azure_migrate_project.rb +++ b/test/integration/verify/controls/azure_migrate_project.rb @@ -1,16 +1,16 @@ -resource_group = input(:resource_group, value: '') -project_name = input(:project_name, value: 'inspec-migrate-integ') +resource_group = input(:resource_group, value: "") +project_name = input(:project_name, value: "inspec-migrate-integ") -control 'Test the properties of an azure migrate project' do +control "Test the properties of an azure migrate project" do - title 'Testing the singular resource of azure_migrate_project.' - desc 'Testing the singular resource of azure_migrate_project.' + title "Testing the singular resource of azure_migrate_project." + desc "Testing the singular resource of azure_migrate_project." describe azure_migrate_project(resource_group: resource_group, name: project_name) do it { should exist } - its('name') { should eq project_name } - its('type') { should eq 'Microsoft.Migrate/MigrateProjects' } - its('properties.registeredTools') { should include 'ServerAssessment' } - its('properties.summary.servers.instanceType') { should eq 'Servers' } + its("name") { should eq project_name } + its("type") { should eq "Microsoft.Migrate/MigrateProjects" } + its("properties.registeredTools") { should include "ServerAssessment" } + its("properties.summary.servers.instanceType") { should eq "Servers" } end end diff --git a/test/integration/verify/controls/azure_migrate_project_database.rb b/test/integration/verify/controls/azure_migrate_project_database.rb index a0a37a1a7..09dd63198 100644 --- a/test/integration/verify/controls/azure_migrate_project_database.rb +++ b/test/integration/verify/controls/azure_migrate_project_database.rb @@ -1,16 +1,16 @@ -resource_group = input(:resource_group, value: '') -project_name = input(:project_name, value: 'inspec-migrate-integ') +resource_group = input(:resource_group, value: "") +project_name = input(:project_name, value: "inspec-migrate-integ") -control 'Test the properties of an azure migrate project database' do +control "Test the properties of an azure migrate project database" do - title 'Testing the singular resource of azure_migrate_project_database.' - desc 'Testing the singular resource of azure_migrate_project_database.' + title "Testing the singular resource of azure_migrate_project_database." + desc "Testing the singular resource of azure_migrate_project_database." - describe azure_migrate_project_database(resource_group: resource_group, project_name: project_name, name: 'myDB') do + describe azure_migrate_project_database(resource_group: resource_group, project_name: project_name, name: "myDB") do it { should exist } - its('name') { should eq 'mydb' } - its('type') { should eq 'Microsoft.Migrate/MigrateProjects/Databases' } - its('assessmentIds') { should include 'myassessment' } - its('assessmentTargetTypes') { should include 'SQL' } + its("name") { should eq "mydb" } + its("type") { should eq "Microsoft.Migrate/MigrateProjects/Databases" } + its("assessmentIds") { should include "myassessment" } + its("assessmentTargetTypes") { should include "SQL" } end end diff --git a/test/integration/verify/controls/azure_migrate_project_database_instance.rb b/test/integration/verify/controls/azure_migrate_project_database_instance.rb index cde3aad2e..362953d3d 100644 --- a/test/integration/verify/controls/azure_migrate_project_database_instance.rb +++ b/test/integration/verify/controls/azure_migrate_project_database_instance.rb @@ -1,16 +1,16 @@ -resource_group = input(:resource_group, value: '') -project_name = input(:project_name, value: 'inspec-migrate-integ') +resource_group = input(:resource_group, value: "") +project_name = input(:project_name, value: "inspec-migrate-integ") -control 'Test the properties of an azure migrate project database' do +control "Test the properties of an azure migrate project database" do - title 'Testing the singular resource of azure_migrate_project_database_instance.' - desc 'Testing the singular resource of azure_migrate_project_database_instance.' + title "Testing the singular resource of azure_migrate_project_database_instance." + desc "Testing the singular resource of azure_migrate_project_database_instance." - describe azure_migrate_project_database_instance(resource_group: resource_group, project_name: project_name, name: 'my_db_instance') do + describe azure_migrate_project_database_instance(resource_group: resource_group, project_name: project_name, name: "my_db_instance") do it { should exist } - its('name') { should eq 'my_db_instance' } - its('type') { should eq 'Microsoft.Migrate/MigrateProjects/DatabaseInstances' } - its('instanceIds') { should include 'instance-1' } - its('instanceTypes') { should include 'SQL' } + its("name") { should eq "my_db_instance" } + its("type") { should eq "Microsoft.Migrate/MigrateProjects/DatabaseInstances" } + its("instanceIds") { should include "instance-1" } + its("instanceTypes") { should include "SQL" } end end diff --git a/test/integration/verify/controls/azure_migrate_project_database_instances.rb b/test/integration/verify/controls/azure_migrate_project_database_instances.rb index 7ef069880..f6a72da67 100644 --- a/test/integration/verify/controls/azure_migrate_project_database_instances.rb +++ b/test/integration/verify/controls/azure_migrate_project_database_instances.rb @@ -1,16 +1,16 @@ -resource_group = input(:resource_group, value: '') -project_name = input(:project_name, value: 'inspec-migrate-integ') +resource_group = input(:resource_group, value: "") +project_name = input(:project_name, value: "inspec-migrate-integ") -control 'test the properties of all azure migrate project database' do +control "test the properties of all azure migrate project database" do - title 'Testing the plural resource of azure_migrate_project_database_instances.' - desc 'Testing the plural resource of azure_migrate_project_database_instances.' + title "Testing the plural resource of azure_migrate_project_database_instances." + desc "Testing the plural resource of azure_migrate_project_database_instances." describe azure_migrate_project_database_instances(resource_group: resource_group, project_name: project_name) do it { should exist } - its('names') { should include 'my_db_instance' } - its('types') { should include 'Microsoft.Migrate/MigrateProjects/DatabaseInstances' } - its('instanceIds') { should include 'instance-1' } - its('instanceTypes') { should include 'SQL' } + its("names") { should include "my_db_instance" } + its("types") { should include "Microsoft.Migrate/MigrateProjects/DatabaseInstances" } + its("instanceIds") { should include "instance-1" } + its("instanceTypes") { should include "SQL" } end end diff --git a/test/integration/verify/controls/azure_migrate_project_databases.rb b/test/integration/verify/controls/azure_migrate_project_databases.rb index ed1b1c6f8..9234b8040 100644 --- a/test/integration/verify/controls/azure_migrate_project_databases.rb +++ b/test/integration/verify/controls/azure_migrate_project_databases.rb @@ -1,16 +1,16 @@ -resource_group = input(:resource_group, value: '') -project_name = input(:project_name, value: 'inspec-migrate-integ') +resource_group = input(:resource_group, value: "") +project_name = input(:project_name, value: "inspec-migrate-integ") -control 'test the properties of all azure migrate project database' do +control "test the properties of all azure migrate project database" do - title 'Testing the plural resource of azure_migrate_project_databases.' - desc 'Testing the plural resource of azure_migrate_project_databases.' + title "Testing the plural resource of azure_migrate_project_databases." + desc "Testing the plural resource of azure_migrate_project_databases." describe azure_migrate_project_databases(resource_group: resource_group, project_name: project_name) do it { should exist } - its('names') { should include 'mydb' } - its('types') { should include 'Microsoft.Migrate/MigrateProjects/Databases' } - its('assessmentIds') { should include 'myassessment' } - its('assessmentTargetTypes') { should include 'SQL' } + its("names") { should include "mydb" } + its("types") { should include "Microsoft.Migrate/MigrateProjects/Databases" } + its("assessmentIds") { should include "myassessment" } + its("assessmentTargetTypes") { should include "SQL" } end end diff --git a/test/integration/verify/controls/azure_migrate_project_event.rb b/test/integration/verify/controls/azure_migrate_project_event.rb index b9f9396d5..9ba03e5d4 100644 --- a/test/integration/verify/controls/azure_migrate_project_event.rb +++ b/test/integration/verify/controls/azure_migrate_project_event.rb @@ -1,15 +1,15 @@ -resource_group = input(:resource_group, value: '') -project_name = input(:project_name, value: 'inspec-migrate-integ') -event_name = 'c042be9e-3d93-42cf-917f-b92c68318ded' +resource_group = input(:resource_group, value: "") +project_name = input(:project_name, value: "inspec-migrate-integ") +event_name = "c042be9e-3d93-42cf-917f-b92c68318ded" -control 'Test the properties of an azure migrate project event' do +control "Test the properties of an azure migrate project event" do - title 'Testing the singular resource of azure_migrate_project_machine.' - desc 'Testing the singular resource of azure_migrate_project_machine.' + title "Testing the singular resource of azure_migrate_project_machine." + desc "Testing the singular resource of azure_migrate_project_machine." describe azure_migrate_project_machine(resource_group: resource_group, project_name: project_name, name: event_name) do it { should exist } - its('type') { should eq 'Microsoft.Migrate/MigrateProjects/MigrateEvents' } - its('properties.instanceType') { should eq 'Servers' } + its("type") { should eq "Microsoft.Migrate/MigrateProjects/MigrateEvents" } + its("properties.instanceType") { should eq "Servers" } end end diff --git a/test/integration/verify/controls/azure_migrate_project_events.rb b/test/integration/verify/controls/azure_migrate_project_events.rb index 66fcc8a08..a18caed3d 100644 --- a/test/integration/verify/controls/azure_migrate_project_events.rb +++ b/test/integration/verify/controls/azure_migrate_project_events.rb @@ -1,14 +1,14 @@ -resource_group = input(:resource_group, value: '') -project_name = input(:project_name, value: 'inspec-migrate-integ') +resource_group = input(:resource_group, value: "") +project_name = input(:project_name, value: "inspec-migrate-integ") -control 'test the properties of all azure migrate project events' do +control "test the properties of all azure migrate project events" do - title 'Testing the plural resource of azure_migrate_project_events.' - desc 'Testing the plural resource of azure_migrate_project_events.' + title "Testing the plural resource of azure_migrate_project_events." + desc "Testing the plural resource of azure_migrate_project_events." describe azure_migrate_project_events(resource_group: resource_group, project_name: project_name) do it { should exist } - its('types') { should include 'Microsoft.Migrate/MigrateProjects/MigrateEvents' } - its('instanceTypes') { should include 'Servers' } + its("types") { should include "Microsoft.Migrate/MigrateProjects/MigrateEvents" } + its("instanceTypes") { should include "Servers" } end end diff --git a/test/integration/verify/controls/azure_migrate_project_machine.rb b/test/integration/verify/controls/azure_migrate_project_machine.rb index 757f93066..6ffb323cb 100644 --- a/test/integration/verify/controls/azure_migrate_project_machine.rb +++ b/test/integration/verify/controls/azure_migrate_project_machine.rb @@ -1,16 +1,16 @@ -resource_group = input(:resource_group, value: '') -project_name = input(:project_name, value: 'inspec-migrate-integ') -machine_name = 'c042be9e-3d93-42cf-917f-b92c68318ded' +resource_group = input(:resource_group, value: "") +project_name = input(:project_name, value: "inspec-migrate-integ") +machine_name = "c042be9e-3d93-42cf-917f-b92c68318ded" -control 'test the properties of an azure migrate project machine' do +control "test the properties of an azure migrate project machine" do - title 'Testing the singular resource of azure_migrate_project_machine.' - desc 'Testing the singular resource of azure_migrate_project_machine.' + title "Testing the singular resource of azure_migrate_project_machine." + desc "Testing the singular resource of azure_migrate_project_machine." describe azure_migrate_project_machine(resource_group: resource_group, project_name: project_name, name: machine_name) do it { should exist } - its('types') { should eq 'Microsoft.Migrate/MigrateProjects/Machines' } - its('properties.discoveryData') { should_not be_empty } - its('properties.discoveryData.first') { should eq({ osType: 'windowsguest' }) } + its("types") { should eq "Microsoft.Migrate/MigrateProjects/Machines" } + its("properties.discoveryData") { should_not be_empty } + its("properties.discoveryData.first") { should eq({ osType: "windowsguest" }) } end end diff --git a/test/integration/verify/controls/azure_migrate_project_machines.rb b/test/integration/verify/controls/azure_migrate_project_machines.rb index b9bbda34b..69289ad72 100644 --- a/test/integration/verify/controls/azure_migrate_project_machines.rb +++ b/test/integration/verify/controls/azure_migrate_project_machines.rb @@ -1,15 +1,15 @@ -resource_group = input(:resource_group, value: '') -project_name = input(:project_name, value: 'inspec-migrate-integ') +resource_group = input(:resource_group, value: "") +project_name = input(:project_name, value: "inspec-migrate-integ") -control 'test the properties of all azure migrate project machines' do +control "test the properties of all azure migrate project machines" do - title 'Testing the plural resource of azure_migrate_project_machines.' - desc 'Testing the plural resource of azure_migrate_project_machines.' + title "Testing the plural resource of azure_migrate_project_machines." + desc "Testing the plural resource of azure_migrate_project_machines." describe azure_migrate_project_machines(resource_group: resource_group, project_name: project_name) do it { should exist } - its('types') { should include 'Microsoft.Migrate/MigrateProjects/Machines' } - its('discoveryData') { should_not be_empty } - its('discoveryData.first') { should include({ osType: 'windowsguest' }) } + its("types") { should include "Microsoft.Migrate/MigrateProjects/Machines" } + its("discoveryData") { should_not be_empty } + its("discoveryData.first") { should include({ osType: "windowsguest" }) } end end diff --git a/test/integration/verify/controls/azure_migrate_project_solution.rb b/test/integration/verify/controls/azure_migrate_project_solution.rb index e7b8c2036..ffb3ecdc6 100644 --- a/test/integration/verify/controls/azure_migrate_project_solution.rb +++ b/test/integration/verify/controls/azure_migrate_project_solution.rb @@ -1,16 +1,16 @@ -resource_group = input(:resource_group, value: '') -project_name = input(:project_name, value: 'inspec-migrate-integ') -name = input(:name, value: 'Servers-Assessment-ServerAssessment') +resource_group = input(:resource_group, value: "") +project_name = input(:project_name, value: "inspec-migrate-integ") +name = input(:name, value: "Servers-Assessment-ServerAssessment") -control 'Verify settings for Azure Migrate Project Solution' do +control "Verify settings for Azure Migrate Project Solution" do - title 'Testing the singular resource of azure_migrate_project_solution.' - desc 'Testing the singular resource of azure_migrate_project_solution.' + title "Testing the singular resource of azure_migrate_project_solution." + desc "Testing the singular resource of azure_migrate_project_solution." describe azure_migrate_project_solution(resource_group: resource_group, project_name: project_name, name: name) do it { should exist } - its('name') { should eq name } - its('type') { should eq 'Microsoft.Migrate/MigrateProjects/Solutions' } - its('tool') { should eq 'ServerAssessment' } + its("name") { should eq name } + its("type") { should eq "Microsoft.Migrate/MigrateProjects/Solutions" } + its("tool") { should eq "ServerAssessment" } end end diff --git a/test/integration/verify/controls/azure_migrate_project_solutions.rb b/test/integration/verify/controls/azure_migrate_project_solutions.rb index 9063085b4..9f444c192 100644 --- a/test/integration/verify/controls/azure_migrate_project_solutions.rb +++ b/test/integration/verify/controls/azure_migrate_project_solutions.rb @@ -1,15 +1,15 @@ -resource_group = input(:resource_group, value: '') -project_name = input(:project_name, value: 'inspec-migrate-integ') +resource_group = input(:resource_group, value: "") +project_name = input(:project_name, value: "inspec-migrate-integ") -control 'verify settings for Azure Migrate Project Solutions' do +control "verify settings for Azure Migrate Project Solutions" do - title 'Testing the plural resource of azure_migrate_project_solutions.' - desc 'Testing the plural resource of azure_migrate_project_solutions.' + title "Testing the plural resource of azure_migrate_project_solutions." + desc "Testing the plural resource of azure_migrate_project_solutions." describe azure_migrate_project_solutions(resource_group: resource_group, project_name: project_name) do it { should exist } - its('names') { should include 'Servers-Assessment-ServerAssessment' } - its('types') { should include 'Microsoft.Migrate/MigrateProjects/Solutions' } - its('tools') { should include 'ServerAssessment' } + its("names") { should include "Servers-Assessment-ServerAssessment" } + its("types") { should include "Microsoft.Migrate/MigrateProjects/Solutions" } + its("tools") { should include "ServerAssessment" } end end diff --git a/test/integration/verify/controls/azure_mysql_database_configuration.rb b/test/integration/verify/controls/azure_mysql_database_configuration.rb index f049ce9f5..022480645 100644 --- a/test/integration/verify/controls/azure_mysql_database_configuration.rb +++ b/test/integration/verify/controls/azure_mysql_database_configuration.rb @@ -1,28 +1,28 @@ -resource_group = input('resource_group', value: nil) -mysql_server_name = input('mysql_server_name', value: nil) +resource_group = input("resource_group", value: nil) +mysql_server_name = input("mysql_server_name", value: nil) -control 'azure_mysql_database_configuration' do - title 'Testing the singular resource of azure_mysql_database_configuration.' - desc 'Testing the singular resource of azure_mysql_database_configuration.' +control "azure_mysql_database_configuration" do + title "Testing the singular resource of azure_mysql_database_configuration." + desc "Testing the singular resource of azure_mysql_database_configuration." - describe azure_mysql_database_configuration(resource_group: resource_group, server_name: mysql_server_name, name: 'audit_log_enabled') do + describe azure_mysql_database_configuration(resource_group: resource_group, server_name: mysql_server_name, name: "audit_log_enabled") do it { should exist } end - describe azure_mysql_database_configuration(resource_group: resource_group, server_name: mysql_server_name, name: 'audit_log_enabled') do - its('id') { should_not be_empty } - its('name') { should eq 'audit_log_enabled' } - its('type') { should eq 'Microsoft.DBforMySQL/servers/configurations' } + describe azure_mysql_database_configuration(resource_group: resource_group, server_name: mysql_server_name, name: "audit_log_enabled") do + its("id") { should_not be_empty } + its("name") { should eq "audit_log_enabled" } + its("type") { should eq "Microsoft.DBforMySQL/servers/configurations" } end - describe azure_mysql_server_configuration(resource_group: resource_group, server_name: mysql_server_name, name: 'audit_log_enabled') do - its('properties.value') { should eq 'ON' } - its('properties.description') { should eq 'Allow to audit the log.' } - its('properties.defaultValue') { should eq 'OFF' } - its('properties.dataType') { should eq 'Enumeration' } - its('properties.allowedValues') { should eq 'ON,OFF' } - its('properties.source') { should eq 'user-override' } - its('properties.isConfigPendingRestart') { should eq 'False' } - its('properties.isDynamicConfig') { should eq 'True' } + describe azure_mysql_server_configuration(resource_group: resource_group, server_name: mysql_server_name, name: "audit_log_enabled") do + its("properties.value") { should eq "ON" } + its("properties.description") { should eq "Allow to audit the log." } + its("properties.defaultValue") { should eq "OFF" } + its("properties.dataType") { should eq "Enumeration" } + its("properties.allowedValues") { should eq "ON,OFF" } + its("properties.source") { should eq "user-override" } + its("properties.isConfigPendingRestart") { should eq "False" } + its("properties.isDynamicConfig") { should eq "True" } end end diff --git a/test/integration/verify/controls/azure_mysql_database_configurations.rb b/test/integration/verify/controls/azure_mysql_database_configurations.rb index 24dbd984e..81adbd955 100644 --- a/test/integration/verify/controls/azure_mysql_database_configurations.rb +++ b/test/integration/verify/controls/azure_mysql_database_configurations.rb @@ -1,18 +1,18 @@ -resource_group = input('resource_group', value: nil) -mysql_server_name = input('mysql_server_name', value: nil) +resource_group = input("resource_group", value: nil) +mysql_server_name = input("mysql_server_name", value: nil) -control 'azure_mysql_database_configurations' do - title 'Testing the plural resource of azure_mysql_database_configurations.' - desc 'Testing the plural resource of azure_mysql_database_configurations.' +control "azure_mysql_database_configurations" do + title "Testing the plural resource of azure_mysql_database_configurations." + desc "Testing the plural resource of azure_mysql_database_configurations." describe azure_mysql_database_configurations(resource_group: resource_group, server_name: mysql_server_name) do it { should exist } end describe azure_mysql_database_configurations(resource_group: resource_group, server_name: mysql_server_name) do - its('ids') { should_not be_empty } - its('names') { should include 'audit_log_enabled' } - its('types') { should include 'Microsoft.DBforMySQL/servers/configurations' } - its('properties') { should_not be_empty } + its("ids") { should_not be_empty } + its("names") { should include "audit_log_enabled" } + its("types") { should include "Microsoft.DBforMySQL/servers/configurations" } + its("properties") { should_not be_empty } end end diff --git a/test/integration/verify/controls/azure_policy_assignments.rb b/test/integration/verify/controls/azure_policy_assignments.rb index 2991a8728..a2a5d1fbd 100644 --- a/test/integration/verify/controls/azure_policy_assignments.rb +++ b/test/integration/verify/controls/azure_policy_assignments.rb @@ -1,11 +1,11 @@ -control 'azure_policy_assignments' do +control "azure_policy_assignments" do - title 'Testing the plural resource of azure_policy_assignments.' - desc 'Testing the plural resource of azure_policy_assignments.' + title "Testing the plural resource of azure_policy_assignments." + desc "Testing the plural resource of azure_policy_assignments." describe azure_policy_assignments do it { should exist } - its('names.class') { should eq 'Array' } - its('displayNames.class') { should eq 'Array' } + its("names.class") { should eq "Array" } + its("displayNames.class") { should eq "Array" } end end diff --git a/test/integration/verify/controls/azure_policy_definition.rb b/test/integration/verify/controls/azure_policy_definition.rb index a7ef17406..05b96cfa0 100644 --- a/test/integration/verify/controls/azure_policy_definition.rb +++ b/test/integration/verify/controls/azure_policy_definition.rb @@ -1,12 +1,12 @@ -control 'azure_policy_definition' do +control "azure_policy_definition" do - title 'Testing the singular resource of azure_policy_definition.' - desc 'Testing the singular resource of azure_policy_definition.' + title "Testing the singular resource of azure_policy_definition." + desc "Testing the singular resource of azure_policy_definition." - describe azure_policy_definition(name: '0062eb8b-dc75-4718-8ea5-9bb4a9606655', built_in: true) do + describe azure_policy_definition(name: "0062eb8b-dc75-4718-8ea5-9bb4a9606655", built_in: true) do it { should exist } - its('properties.policyType') { should cmp 'Static' } - its('properties.policyRule.then.effect') { should cmp 'audit' } + its("properties.policyType") { should cmp "Static" } + its("properties.policyRule.then.effect") { should cmp "audit" } it { should_not be_custom } end end diff --git a/test/integration/verify/controls/azure_policy_definitions.rb b/test/integration/verify/controls/azure_policy_definitions.rb index 07ab01a86..59b2d6028 100644 --- a/test/integration/verify/controls/azure_policy_definitions.rb +++ b/test/integration/verify/controls/azure_policy_definitions.rb @@ -1,10 +1,10 @@ -control 'azure_policy_definitions' do +control "azure_policy_definitions" do - title 'Testing the plural resource of azure_policy_definitions.' - desc 'Testing the plural resource of azure_policy_definitions.' + title "Testing the plural resource of azure_policy_definitions." + desc "Testing the plural resource of azure_policy_definitions." describe azure_policy_definitions(built_in_only: true) do it { should exist } - its('policy_types') { should_not include 'Custom' } + its("policy_types") { should_not include "Custom" } end end diff --git a/test/integration/verify/controls/azure_policy_exemption.rb b/test/integration/verify/controls/azure_policy_exemption.rb index 08854e43a..c94b86e7a 100644 --- a/test/integration/verify/controls/azure_policy_exemption.rb +++ b/test/integration/verify/controls/azure_policy_exemption.rb @@ -1,24 +1,24 @@ -exemption_name = input(:policy_exemption_name, value: '') -resource_group = input(:resource_group, value: '') +exemption_name = input(:policy_exemption_name, value: "") +resource_group = input(:resource_group, value: "") -control 'verify an exemption' do +control "verify an exemption" do - title 'Testing the singular resource of azure_policy_exemption.' - desc 'Testing the singular resource of azure_policy_exemption.' + title "Testing the singular resource of azure_policy_exemption." + desc "Testing the singular resource of azure_policy_exemption." describe azure_policy_exemption(exemption_name: exemption_name) do it { should exist } - its('properties.exemptionCategory') { should eq 'Waiver' } + its("properties.exemptionCategory") { should eq "Waiver" } end end -control 'verify an exemption within a resource group' do +control "verify an exemption within a resource group" do - title 'Testing the singular resource of azure_data_factory.' - desc 'Testing the singular resource of azure_data_factory.' + title "Testing the singular resource of azure_data_factory." + desc "Testing the singular resource of azure_data_factory." describe azure_policy_exemption(resource_group: resource_group, exemption_name: exemption_name) do it { should exist } - its('properties.exemptionCategory') { should eq 'Waiver' } + its("properties.exemptionCategory") { should eq "Waiver" } end end diff --git a/test/integration/verify/controls/azure_policy_exemptions.rb b/test/integration/verify/controls/azure_policy_exemptions.rb index 77a93529d..27133a79b 100644 --- a/test/integration/verify/controls/azure_policy_exemptions.rb +++ b/test/integration/verify/controls/azure_policy_exemptions.rb @@ -1,28 +1,28 @@ -exemption_name = input(:policy_exemption_name, value: '') +exemption_name = input(:policy_exemption_name, value: "") -control 'check if azure policy exemptions has waiver category' do +control "check if azure policy exemptions has waiver category" do - title 'Testing the plural resource of azure_policy_exemption.' - desc 'Testing the plural resource of azure_policy_exemption.' + title "Testing the plural resource of azure_policy_exemption." + desc "Testing the plural resource of azure_policy_exemption." describe azure_policy_exemptions do it { should exist } - its('created_by_types') { should include 'User' } - its('exemption_categories') { should include 'Waiver' } - its('types') { should include 'Microsoft.Authorization/policyExemptions' } + its("created_by_types") { should include "User" } + its("exemption_categories") { should include "Waiver" } + its("types") { should include "Microsoft.Authorization/policyExemptions" } end end -control 'check exemptions using nested filtering' do +control "check exemptions using nested filtering" do - title 'Testing the plural resource of azure_policy_exemption.' - desc 'Testing the plural resource of azure_policy_exemption.' + title "Testing the plural resource of azure_policy_exemption." + desc "Testing the plural resource of azure_policy_exemption." - azure_policy_exemptions.where(name: exemption_name, type: 'Microsoft.Authorization/policyExemptions').names.each do |name| + azure_policy_exemptions.where(name: exemption_name, type: "Microsoft.Authorization/policyExemptions").names.each do |name| control "check exemptions using nested filtering for exemption: #{name}" do describe azure_policy_exemption(exemption_name: name) do it { should exist } - its('properties.exemptionCategory') { should eq 'Waiver' } + its("properties.exemptionCategory") { should eq "Waiver" } end end end diff --git a/test/integration/verify/controls/azure_policy_insights_query_result.rb b/test/integration/verify/controls/azure_policy_insights_query_result.rb index 79f726254..394ab44d7 100644 --- a/test/integration/verify/controls/azure_policy_insights_query_result.rb +++ b/test/integration/verify/controls/azure_policy_insights_query_result.rb @@ -1,11 +1,11 @@ policy_definition = input(:policy_definition_id, value: nil) resource_id = input(:policy_definition_associated_cosmodb_id, - value: '/subscriptions/80b824de-ec53-4116-9868-3deeab10b0cd/resourcegroups/315-releng-e2e-test/providers/microsoft.compute/virtualmachines/chefserver-ubuntu-1804') + value: "/subscriptions/80b824de-ec53-4116-9868-3deeab10b0cd/resourcegroups/315-releng-e2e-test/providers/microsoft.compute/virtualmachines/chefserver-ubuntu-1804") -control 'azure_policy_insights_query_result for a specified resource' do +control "azure_policy_insights_query_result for a specified resource" do - title 'A simple example to check if a specified resource has policy setup and is compliant' - desc 'A simple example to check if a specified resource has policy setup and is compliant' + title "A simple example to check if a specified resource has policy setup and is compliant" + desc "A simple example to check if a specified resource has policy setup and is compliant" describe azure_policy_insights_query_result(policy_definition: policy_definition, resource_id: resource_id) do it { should exist } diff --git a/test/integration/verify/controls/azure_policy_insights_query_results.rb b/test/integration/verify/controls/azure_policy_insights_query_results.rb index a74086817..030adc71d 100644 --- a/test/integration/verify/controls/azure_policy_insights_query_results.rb +++ b/test/integration/verify/controls/azure_policy_insights_query_results.rb @@ -1,25 +1,25 @@ # # policy_definition = input(:policy_definition_id, value: nil) -control 'azure_policy_insights_query_results for non-compliant resources' do - text = 'IsCompliant eq false' +control "azure_policy_insights_query_results for non-compliant resources" do + text = "IsCompliant eq false" - title 'Testing the plural resource of azure_policy_insights_query_results.' - desc 'Testing the plural resource of azure_policy_insights_query_results.' + title "Testing the plural resource of azure_policy_insights_query_results." + desc "Testing the plural resource of azure_policy_insights_query_results." describe azure_policy_insights_query_results(filter_free_text: text) do it { should exist } - its('count') { should eq 1000 } + its("count") { should eq 1000 } end end -control 'azure_policy_insights_query_results for virtualMachines' do +control "azure_policy_insights_query_results for virtualMachines" do text = "IsCompliant eq false and resourceId eq resourceType eq 'Microsoft.Compute/virtualMachines'" - title 'Testing the plural resource of azure_policy_insights_query_results.' - desc 'Testing the plural resource of azure_policy_insights_query_results.' + title "Testing the plural resource of azure_policy_insights_query_results." + desc "Testing the plural resource of azure_policy_insights_query_results." describe azure_policy_insights_query_results(filter_free_text: text) do it { should exist } - its('is_compliant') { should cmp false } + its("is_compliant") { should cmp false } end end diff --git a/test/integration/verify/controls/azure_power_bi_app.rb b/test/integration/verify/controls/azure_power_bi_app.rb index 83ab08f33..5afe33cb5 100644 --- a/test/integration/verify/controls/azure_power_bi_app.rb +++ b/test/integration/verify/controls/azure_power_bi_app.rb @@ -1,9 +1,9 @@ -app_id = input(:app_id, value: '') +app_id = input(:app_id, value: "") -control 'Verify the settings of a Power BI App' do +control "Verify the settings of a Power BI App" do - title 'Testing the singular resource of azure_power_bi_app.' - desc 'Testing the singular resource of azure_power_bi_app.' + title "Testing the singular resource of azure_power_bi_app." + desc "Testing the singular resource of azure_power_bi_app." describe azure_power_bi_app(app_id: app_id) do it { should exist } diff --git a/test/integration/verify/controls/azure_power_bi_app_dashboard.rb b/test/integration/verify/controls/azure_power_bi_app_dashboard.rb index 160e1e479..b40bc1901 100644 --- a/test/integration/verify/controls/azure_power_bi_app_dashboard.rb +++ b/test/integration/verify/controls/azure_power_bi_app_dashboard.rb @@ -1,9 +1,9 @@ -app_id = input(:app_id, value: '') -dashboard_id = input(:dashboard_id, value: '') -control 'Verify the settings of a Power BI App Dashboard' do +app_id = input(:app_id, value: "") +dashboard_id = input(:dashboard_id, value: "") +control "Verify the settings of a Power BI App Dashboard" do describe azure_power_bi_app_dashboard(app_id: app_id, dashboard_id: dashboard_id) do it { should exist } - its('publishedBy') { should eq 'inspec-dev' } - its('name') { should eq 'inspec-bi-dashboard' } + its("publishedBy") { should eq "inspec-dev" } + its("name") { should eq "inspec-bi-dashboard" } end end diff --git a/test/integration/verify/controls/azure_power_bi_app_dashboard_tile.rb b/test/integration/verify/controls/azure_power_bi_app_dashboard_tile.rb index 50eeaa7b0..5e68cc58f 100644 --- a/test/integration/verify/controls/azure_power_bi_app_dashboard_tile.rb +++ b/test/integration/verify/controls/azure_power_bi_app_dashboard_tile.rb @@ -1,15 +1,15 @@ -app_id = input(:app_id, value: '') -dashboard_id = input(:dashboard_id, value: '') -tile_id = input(:tile_id, value: '') +app_id = input(:app_id, value: "") +dashboard_id = input(:dashboard_id, value: "") +tile_id = input(:tile_id, value: "") -control 'Verify the settings of a Power BI App Dashboard Tile' do +control "Verify the settings of a Power BI App Dashboard Tile" do - title 'Testing the singular resource of azure_power_bi_app_dashboard_tile.' - desc 'Testing the singular resource of azure_power_bi_app_dashboard_tile.' + title "Testing the singular resource of azure_power_bi_app_dashboard_tile." + desc "Testing the singular resource of azure_power_bi_app_dashboard_tile." describe azure_power_bi_app_dashboard_tile(app_id: app_id, dashboard_id: dashboard_id, tile_id: tile_id) do it { should exist } - its('rowSpan') { should eq 0 } - its('colSpan') { should eq 0 } + its("rowSpan") { should eq 0 } + its("colSpan") { should eq 0 } end end diff --git a/test/integration/verify/controls/azure_power_bi_app_dashboard_tiles.rb b/test/integration/verify/controls/azure_power_bi_app_dashboard_tiles.rb index fa8cf73ee..bc3a6c668 100644 --- a/test/integration/verify/controls/azure_power_bi_app_dashboard_tiles.rb +++ b/test/integration/verify/controls/azure_power_bi_app_dashboard_tiles.rb @@ -1,14 +1,14 @@ -app_id = input(:app_id, value: '') -dashboard_id = input(:dashboard_id, value: '') +app_id = input(:app_id, value: "") +dashboard_id = input(:dashboard_id, value: "") -control 'Verify the settings of all Power BI App Dashboard Tiles' do +control "Verify the settings of all Power BI App Dashboard Tiles" do - title 'Testing the plural resource of azure_power_bi_app_dashboard_tiles.' - desc 'Testing the plural resource of azure_power_bi_app_dashboard_tiles.' + title "Testing the plural resource of azure_power_bi_app_dashboard_tiles." + desc "Testing the plural resource of azure_power_bi_app_dashboard_tiles." describe azure_power_bi_app_dashboard_tiles(app_id: app_id, dashboard_id: dashboard_id) do it { should exist } - its('rowSpan') { should include 0 } - its('colSpan') { should include 0 } + its("rowSpan") { should include 0 } + its("colSpan") { should include 0 } end end diff --git a/test/integration/verify/controls/azure_power_bi_app_dashboards.rb b/test/integration/verify/controls/azure_power_bi_app_dashboards.rb index af5e325d4..c01b6c959 100644 --- a/test/integration/verify/controls/azure_power_bi_app_dashboards.rb +++ b/test/integration/verify/controls/azure_power_bi_app_dashboards.rb @@ -1,7 +1,7 @@ -app_id = input(:app_id, value: '') -control 'Verify the settings of all Power BI App Dashboards' do +app_id = input(:app_id, value: "") +control "Verify the settings of all Power BI App Dashboards" do describe azure_power_bi_app_dashboards(app_id: app_id) do it { should exist } - its('names') { should include 'inspec-bi-dashboard' } + its("names") { should include "inspec-bi-dashboard" } end end diff --git a/test/integration/verify/controls/azure_power_bi_app_report.rb b/test/integration/verify/controls/azure_power_bi_app_report.rb index a59d22d39..985043cd0 100644 --- a/test/integration/verify/controls/azure_power_bi_app_report.rb +++ b/test/integration/verify/controls/azure_power_bi_app_report.rb @@ -1,10 +1,10 @@ -app_id = input(:app_id, value: '') -report_id = input(:report_id, value: '') +app_id = input(:app_id, value: "") +report_id = input(:report_id, value: "") -control 'Verify the settings of a Power BI App Report' do +control "Verify the settings of a Power BI App Report" do describe azure_power_bi_app_report(app_id: app_id, report_id: report_id) do it { should exist } - its('name') { should eq 'Finance' } - its('webUrl') { should_not be_empty } + its("name") { should eq "Finance" } + its("webUrl") { should_not be_empty } end end diff --git a/test/integration/verify/controls/azure_power_bi_app_reports.rb b/test/integration/verify/controls/azure_power_bi_app_reports.rb index d76af08f3..17e67c3cb 100644 --- a/test/integration/verify/controls/azure_power_bi_app_reports.rb +++ b/test/integration/verify/controls/azure_power_bi_app_reports.rb @@ -1,9 +1,9 @@ -app_id = input(:app_id, value: '') +app_id = input(:app_id, value: "") -control 'Verify the settings of all Power BI App Reports' do +control "Verify the settings of all Power BI App Reports" do describe azure_power_bi_app_reports(app_id: app_id) do it { should exist } - its('names') { should include 'Finance' } - its('webUrls') { should_not be_empty } + its("names") { should include "Finance" } + its("webUrls") { should_not be_empty } end end diff --git a/test/integration/verify/controls/azure_power_bi_apps.rb b/test/integration/verify/controls/azure_power_bi_apps.rb index 482598dc7..d9f3d1e5d 100644 --- a/test/integration/verify/controls/azure_power_bi_apps.rb +++ b/test/integration/verify/controls/azure_power_bi_apps.rb @@ -1,12 +1,12 @@ -app_id = input(:app_id, value: '') +app_id = input(:app_id, value: "") -control 'Verify the settings of all Power BI Apps' do +control "Verify the settings of all Power BI Apps" do - title 'Testing the plural resource of azure_power_bi_apps.' - desc 'Testing the plural resource of azure_power_bi_apps.' + title "Testing the plural resource of azure_power_bi_apps." + desc "Testing the plural resource of azure_power_bi_apps." describe azure_power_bi_apps do it { should exist } - its('ids') { should include app_id } + its("ids") { should include app_id } end end diff --git a/test/integration/verify/controls/azure_power_bi_capacities.rb b/test/integration/verify/controls/azure_power_bi_capacities.rb index fda5b41e5..21b0311b0 100644 --- a/test/integration/verify/controls/azure_power_bi_capacities.rb +++ b/test/integration/verify/controls/azure_power_bi_capacities.rb @@ -1,13 +1,13 @@ -control 'Verify the settings of all Power BI App Capacities' do +control "Verify the settings of all Power BI App Capacities" do - title 'Testing the plural resource of azure_power_bi_app_capacities.' - desc 'Testing the plural resource of azure_power_bi_app_capacities.' + title "Testing the plural resource of azure_power_bi_app_capacities." + desc "Testing the plural resource of azure_power_bi_app_capacities." describe azure_power_bi_app_capacities do it { should exist } - its('skus') { should include 'A1' } - its('states') { should include 'Active' } - its('regions') { should include 'West Central US' } - its('capacityUserAccessRights') { should include 'Admin' } + its("skus") { should include "A1" } + its("states") { should include "Active" } + its("regions") { should include "West Central US" } + its("capacityUserAccessRights") { should include "Admin" } end end diff --git a/test/integration/verify/controls/azure_power_bi_capacity_refreshable.rb b/test/integration/verify/controls/azure_power_bi_capacity_refreshable.rb index fafa08635..c2619f394 100644 --- a/test/integration/verify/controls/azure_power_bi_capacity_refreshable.rb +++ b/test/integration/verify/controls/azure_power_bi_capacity_refreshable.rb @@ -1,13 +1,13 @@ -control 'verify the settings of an Azure Power BI Capacity Refreshable' do +control "verify the settings of an Azure Power BI Capacity Refreshable" do - title 'Testing the singular resource of azure_power_bi_capacity_refreshable.' - desc 'Testing the singular resource of azure_power_bi_capacity_refreshable.' + title "Testing the singular resource of azure_power_bi_capacity_refreshable." + desc "Testing the singular resource of azure_power_bi_capacity_refreshable." - describe azure_power_bi_capacity_refreshable(capacity_id: '0f084df7-c13d-451b-af5f-ed0c466403b2', refreshable_id: 'cfafbeb1-8037-4d0c-896e-a46fb27ff229') do + describe azure_power_bi_capacity_refreshable(capacity_id: "0f084df7-c13d-451b-af5f-ed0c466403b2", refreshable_id: "cfafbeb1-8037-4d0c-896e-a46fb27ff229") do it { should exist } - its('refreshesPerDays') { should eq 11 } - its('refreshCounts') { should eq 22 } - its('kinds') { should eq 'Dataset' } - its('refreshSchedules.enabled') { should be_truthy } + its("refreshesPerDays") { should eq 11 } + its("refreshCounts") { should eq 22 } + its("kinds") { should eq "Dataset" } + its("refreshSchedules.enabled") { should be_truthy } end end diff --git a/test/integration/verify/controls/azure_power_bi_capacity_refreshables.rb b/test/integration/verify/controls/azure_power_bi_capacity_refreshables.rb index ffee284df..4e497dc08 100644 --- a/test/integration/verify/controls/azure_power_bi_capacity_refreshables.rb +++ b/test/integration/verify/controls/azure_power_bi_capacity_refreshables.rb @@ -1,13 +1,13 @@ -control 'verify the settings of all Azure Power BI Capacity Refreshable' do +control "verify the settings of all Azure Power BI Capacity Refreshable" do - title 'Testing the plural resource of azure_power_bi_capacity_refreshables.' - desc 'Testing the plural resource of azure_power_bi_capacity_refreshables.' + title "Testing the plural resource of azure_power_bi_capacity_refreshables." + desc "Testing the plural resource of azure_power_bi_capacity_refreshables." describe azure_power_bi_capacity_refreshables do it { should exist } - its('refreshesPerDays') { should include 11 } - its('refreshCounts') { should include 22 } - its('kinds') { should include 'Dataset' } - its('refreshSchedules') { should_not be empty } + its("refreshesPerDays") { should include 11 } + its("refreshCounts") { should include 22 } + its("kinds") { should include "Dataset" } + its("refreshSchedules") { should_not be empty } end end diff --git a/test/integration/verify/controls/azure_power_bi_capacity_workload.rb b/test/integration/verify/controls/azure_power_bi_capacity_workload.rb index ee7a768da..eea3bd007 100644 --- a/test/integration/verify/controls/azure_power_bi_capacity_workload.rb +++ b/test/integration/verify/controls/azure_power_bi_capacity_workload.rb @@ -1,8 +1,8 @@ -control 'verify the settings of a Azure Power BI Capacity Workloads' do - describe azure_power_bi_capacity_workload(capacity_id: '0f084df7-c13d-451b-af5f-ed0c466403b2', name: 'Dataflows') do +control "verify the settings of a Azure Power BI Capacity Workloads" do + describe azure_power_bi_capacity_workload(capacity_id: "0f084df7-c13d-451b-af5f-ed0c466403b2", name: "Dataflows") do it { should exist } - its('state') { should eq 'Enabled' } - its('name') { should eq 'Dataflows' } - its('maxMemoryPercentageSetByUser') { should eq '66' } + its("state") { should eq "Enabled" } + its("name") { should eq "Dataflows" } + its("maxMemoryPercentageSetByUser") { should eq "66" } end end diff --git a/test/integration/verify/controls/azure_power_bi_capacity_workloads.rb b/test/integration/verify/controls/azure_power_bi_capacity_workloads.rb index bbe068121..e77be5f82 100644 --- a/test/integration/verify/controls/azure_power_bi_capacity_workloads.rb +++ b/test/integration/verify/controls/azure_power_bi_capacity_workloads.rb @@ -1,8 +1,8 @@ -control 'verify the settings of all Azure Power BI Capacity Workloads' do - describe azure_power_bi_capacity_workloads(capacity_id: '0f084df7-c13d-451b-af5f-ed0c466403b2') do +control "verify the settings of all Azure Power BI Capacity Workloads" do + describe azure_power_bi_capacity_workloads(capacity_id: "0f084df7-c13d-451b-af5f-ed0c466403b2") do it { should exist } - its('states') { should include 'Enabled' } - its('names') { should include 'Dataflows' } - its('maxMemoryPercentageSetByUsers') { should include '66' } + its("states") { should include "Enabled" } + its("names") { should include "Dataflows" } + its("maxMemoryPercentageSetByUsers") { should include "66" } end end diff --git a/test/integration/verify/controls/azure_power_bi_dashboard.rb b/test/integration/verify/controls/azure_power_bi_dashboard.rb index 1a3acc0f2..a89cad573 100644 --- a/test/integration/verify/controls/azure_power_bi_dashboard.rb +++ b/test/integration/verify/controls/azure_power_bi_dashboard.rb @@ -1,15 +1,15 @@ -group_id = input(:inspec_powerbi_workspace_id, value: '') -dashboard_id = 'b84b01c6-3262-4671-bdc8-ff99becf2a0b' +group_id = input(:inspec_powerbi_workspace_id, value: "") +dashboard_id = "b84b01c6-3262-4671-bdc8-ff99becf2a0b" -control 'Verify settings of a Power BI Dashboard' do +control "Verify settings of a Power BI Dashboard" do - title 'Testing the singular resource of azure_power_bi_dashboard.' - desc 'Testing the singular resource of azure_power_bi_dashboard.' + title "Testing the singular resource of azure_power_bi_dashboard." + desc "Testing the singular resource of azure_power_bi_dashboard." describe azure_power_bi_dashboard(group_id: group_id, dashboard_id: dashboard_id) do it { should exist } - its('displayName') { should eq 'inspec-dev-dashboard' } - its('isReadOnly') { should be_truthy } - its('users') { should be_empty } + its("displayName") { should eq "inspec-dev-dashboard" } + its("isReadOnly") { should be_truthy } + its("users") { should be_empty } end end diff --git a/test/integration/verify/controls/azure_power_bi_dashboard_tile.rb b/test/integration/verify/controls/azure_power_bi_dashboard_tile.rb index a6769f394..2aa992bf1 100644 --- a/test/integration/verify/controls/azure_power_bi_dashboard_tile.rb +++ b/test/integration/verify/controls/azure_power_bi_dashboard_tile.rb @@ -1,7 +1,7 @@ -group_id = input(:inspec_powerbi_workspace_id, value: '') -dashboard_id = 'b84b01c6-3262-4671-bdc8-ff99becf2a0b' -tile_id = '3262-4671-bdc8-' -control 'Verify settings of a Power BI Dashboard tile' do +group_id = input(:inspec_powerbi_workspace_id, value: "") +dashboard_id = "b84b01c6-3262-4671-bdc8-ff99becf2a0b" +tile_id = "3262-4671-bdc8-" +control "Verify settings of a Power BI Dashboard tile" do describe azure_power_bi_dashboard_tile(group_id: group_id, dashboard_id: dashboard_id, tile_id: tile_id) do it { should exist } end diff --git a/test/integration/verify/controls/azure_power_bi_dashboard_tiles.rb b/test/integration/verify/controls/azure_power_bi_dashboard_tiles.rb index 907819e90..f2bfbed0d 100644 --- a/test/integration/verify/controls/azure_power_bi_dashboard_tiles.rb +++ b/test/integration/verify/controls/azure_power_bi_dashboard_tiles.rb @@ -1,6 +1,6 @@ -group_id = input(:inspec_powerbi_workspace_id, value: '') -control 'verify settings of all Power BI Dashboard Tiles in a group' do - describe azure_power_bi_dashboards(group_id: group_id, dashboard_id: 'b84b01c6-3262-4671-bdc8-ff99becf2a0b') do +group_id = input(:inspec_powerbi_workspace_id, value: "") +control "verify settings of all Power BI Dashboard Tiles in a group" do + describe azure_power_bi_dashboards(group_id: group_id, dashboard_id: "b84b01c6-3262-4671-bdc8-ff99becf2a0b") do it { should exist } end end diff --git a/test/integration/verify/controls/azure_power_bi_dashboards.rb b/test/integration/verify/controls/azure_power_bi_dashboards.rb index 514cad505..80e4cacdc 100644 --- a/test/integration/verify/controls/azure_power_bi_dashboards.rb +++ b/test/integration/verify/controls/azure_power_bi_dashboards.rb @@ -1,14 +1,14 @@ -group_id = input(:inspec_powerbi_workspace_id, value: '') +group_id = input(:inspec_powerbi_workspace_id, value: "") -control 'verify settings of Power BI Dashboards in a group' do +control "verify settings of Power BI Dashboards in a group" do - title 'Testing the plural resource of azure_power_bi_dashboards.' - desc 'Testing the plural resource of azure_power_bi_dashboards.' + title "Testing the plural resource of azure_power_bi_dashboards." + desc "Testing the plural resource of azure_power_bi_dashboards." describe azure_power_bi_dashboards(group_id: group_id) do it { should exist } - its('displayNames') { should include 'inspec-dev-dashboard' } - its('isReadOnlies') { should include true } - its('users') { should be_empty } + its("displayNames") { should include "inspec-dev-dashboard" } + its("isReadOnlies") { should include true } + its("users") { should be_empty } end end diff --git a/test/integration/verify/controls/azure_power_bi_dataflow.rb b/test/integration/verify/controls/azure_power_bi_dataflow.rb index 423818d3f..70fb2a866 100644 --- a/test/integration/verify/controls/azure_power_bi_dataflow.rb +++ b/test/integration/verify/controls/azure_power_bi_dataflow.rb @@ -1,11 +1,11 @@ -control 'verify the settings of all Azure Power BI Dataflows' do +control "verify the settings of all Azure Power BI Dataflows" do - title 'Testing the singular resource of azure_power_bi_dataflow.' - desc 'Testing the singular resource of azure_power_bi_dataflow.' + title "Testing the singular resource of azure_power_bi_dataflow." + desc "Testing the singular resource of azure_power_bi_dataflow." - describe azure_power_bi_dataflow(group_id: 'f089354e-8366-4e18-aea3-4cb4a3a50b48') do + describe azure_power_bi_dataflow(group_id: "f089354e-8366-4e18-aea3-4cb4a3a50b48") do it { should exist } - its('objectId') { should eq 'bd32e5c0-363f-430b-a03b-5535a4804b9b' } - its('name') { should eq 'AdventureWorks' } + its("objectId") { should eq "bd32e5c0-363f-430b-a03b-5535a4804b9b" } + its("name") { should eq "AdventureWorks" } end end diff --git a/test/integration/verify/controls/azure_power_bi_dataflow_storage_accounts.rb b/test/integration/verify/controls/azure_power_bi_dataflow_storage_accounts.rb index d42e04c88..9e376b3ed 100644 --- a/test/integration/verify/controls/azure_power_bi_dataflow_storage_accounts.rb +++ b/test/integration/verify/controls/azure_power_bi_dataflow_storage_accounts.rb @@ -1,7 +1,7 @@ -control 'verify the settings of all Azure Power BI Dataflow Storage Accounts' do +control "verify the settings of all Azure Power BI Dataflow Storage Accounts" do describe azure_power_bi_dataflow_storage_accounts do it { should exist } - its('isEnableds') { should include true } - its('names') { should include 'test-dt-storage-account' } + its("isEnableds") { should include true } + its("names") { should include "test-dt-storage-account" } end end diff --git a/test/integration/verify/controls/azure_power_bi_dataflows.rb b/test/integration/verify/controls/azure_power_bi_dataflows.rb index c6f29bdcd..668279c3b 100644 --- a/test/integration/verify/controls/azure_power_bi_dataflows.rb +++ b/test/integration/verify/controls/azure_power_bi_dataflows.rb @@ -1,11 +1,11 @@ -control 'verify the settings of all Azure Power BI Dataflows' do +control "verify the settings of all Azure Power BI Dataflows" do - title 'Testing the plural resource of azure_power_bi_dataflows.' - desc 'Testing the plural resource of azure_power_bi_dataflows.' + title "Testing the plural resource of azure_power_bi_dataflows." + desc "Testing the plural resource of azure_power_bi_dataflows." - describe azure_power_bi_dataflows(group_id: 'f089354e-8366-4e18-aea3-4cb4a3a50b48') do + describe azure_power_bi_dataflows(group_id: "f089354e-8366-4e18-aea3-4cb4a3a50b48") do it { should exist } - its('objectIds') { should include 'bd32e5c0-363f-430b-a03b-5535a4804b9b' } - its('names') { should include 'AdventureWorks' } + its("objectIds") { should include "bd32e5c0-363f-430b-a03b-5535a4804b9b" } + its("names") { should include "AdventureWorks" } end end diff --git a/test/integration/verify/controls/azure_power_bi_dataset.rb b/test/integration/verify/controls/azure_power_bi_dataset.rb index e1441c557..6b5b113e6 100644 --- a/test/integration/verify/controls/azure_power_bi_dataset.rb +++ b/test/integration/verify/controls/azure_power_bi_dataset.rb @@ -1,13 +1,13 @@ -control 'verify the settings of an Azure Power BI Dataset' do +control "verify the settings of an Azure Power BI Dataset" do - title 'Testing the singular resource of azure_power_bi_dataset.' - desc 'Testing the singular resource of azure_power_bi_dataset.' + title "Testing the singular resource of azure_power_bi_dataset." + desc "Testing the singular resource of azure_power_bi_dataset." - describe azure_power_bi_dataset(dataset_id: 'cfafbeb1-8037-4d0c-896e-a46fb27ff229') do + describe azure_power_bi_dataset(dataset_id: "cfafbeb1-8037-4d0c-896e-a46fb27ff229") do it { should exist } - its('name') { should eq 'SalesMarketing' } - its('addRowsAPIEnabled') { should eq false } - its('isRefreshable') { should eq true } - its('isEffectiveIdentityRequired') { should eq true } + its("name") { should eq "SalesMarketing" } + its("addRowsAPIEnabled") { should eq false } + its("isRefreshable") { should eq true } + its("isEffectiveIdentityRequired") { should eq true } end end diff --git a/test/integration/verify/controls/azure_power_bi_dataset_datasources.rb b/test/integration/verify/controls/azure_power_bi_dataset_datasources.rb index 01e130b9e..a3b0b3d7c 100644 --- a/test/integration/verify/controls/azure_power_bi_dataset_datasources.rb +++ b/test/integration/verify/controls/azure_power_bi_dataset_datasources.rb @@ -1,8 +1,8 @@ -control 'verify the settings of all Azure Power BI Dataset Datasources' do - describe azure_power_bi_dataset_datasources(dataset_id: 'cfafbeb1-8037-4d0c-896e-a46fb27ff229') do +control "verify the settings of all Azure Power BI Dataset Datasources" do + describe azure_power_bi_dataset_datasources(dataset_id: "cfafbeb1-8037-4d0c-896e-a46fb27ff229") do it { should exist } - its('datasourceTypes') { should include 'AnalysisServices' } - its('datasourceIds') { should include '33cc5222-3fb9-44f7-b19d-ffbff18aaaf5' } - its('gatewayIds') { should include '0a2dafe6-0e93-4120-8d2c-fae123c111b1' } + its("datasourceTypes") { should include "AnalysisServices" } + its("datasourceIds") { should include "33cc5222-3fb9-44f7-b19d-ffbff18aaaf5" } + its("gatewayIds") { should include "0a2dafe6-0e93-4120-8d2c-fae123c111b1" } end end diff --git a/test/integration/verify/controls/azure_power_bi_datasets.rb b/test/integration/verify/controls/azure_power_bi_datasets.rb index f05ccc20d..480740621 100644 --- a/test/integration/verify/controls/azure_power_bi_datasets.rb +++ b/test/integration/verify/controls/azure_power_bi_datasets.rb @@ -1,13 +1,13 @@ -control 'verify the settings of all Azure Power BI Datasets' do +control "verify the settings of all Azure Power BI Datasets" do - title 'Testing the plural resource of azure_power_bi_dataset.' - desc 'Testing the plural resource of azure_power_bi_dataset.' + title "Testing the plural resource of azure_power_bi_dataset." + desc "Testing the plural resource of azure_power_bi_dataset." describe azure_power_bi_datasets do it { should exist } - its('names') { should include 'SalesMarketing' } - its('addRowsAPIEnableds') { should include false } - its('isRefreshables') { should include true } - its('isEffectiveIdentityRequireds') { should include true } + its("names") { should include "SalesMarketing" } + its("addRowsAPIEnableds") { should include false } + its("isRefreshables") { should include true } + its("isEffectiveIdentityRequireds") { should include true } end end diff --git a/test/integration/verify/controls/azure_power_bi_embedded_capacities.rb b/test/integration/verify/controls/azure_power_bi_embedded_capacities.rb index 40f3f57d2..f082c5d57 100644 --- a/test/integration/verify/controls/azure_power_bi_embedded_capacities.rb +++ b/test/integration/verify/controls/azure_power_bi_embedded_capacities.rb @@ -1,13 +1,13 @@ -power_bi_embedded_name = input(:power_bi_embedded_name, value: '') -location = input(:location, value: '') +power_bi_embedded_name = input(:power_bi_embedded_name, value: "") +location = input(:location, value: "") -control 'Verify settings for all Azure Power BI Embedded Capacities' do +control "Verify settings for all Azure Power BI Embedded Capacities" do describe azure_power_bi_embedded_capacities do it { should exist } - its('names') { should include power_bi_embedded_name } - its('locations') { should include location } - its('modes') { should include 'Gen2' } - its('sku_names') { should include 'A1' } - its('sku_capacities') { should include 1 } + its("names") { should include power_bi_embedded_name } + its("locations") { should include location } + its("modes") { should include "Gen2" } + its("sku_names") { should include "A1" } + its("sku_capacities") { should include 1 } end end diff --git a/test/integration/verify/controls/azure_power_bi_embedded_capacity.rb b/test/integration/verify/controls/azure_power_bi_embedded_capacity.rb index ca7b19854..bccddbd17 100644 --- a/test/integration/verify/controls/azure_power_bi_embedded_capacity.rb +++ b/test/integration/verify/controls/azure_power_bi_embedded_capacity.rb @@ -1,11 +1,11 @@ -resource_group = input(:resource_group, value: '') -power_bi_embedded_name = input(:power_bi_embedded_name, value: '') +resource_group = input(:resource_group, value: "") +power_bi_embedded_name = input(:power_bi_embedded_name, value: "") -control 'Verify settings for Azure Power BI Embedded Capacity' do +control "Verify settings for Azure Power BI Embedded Capacity" do describe azure_power_bi_embedded_capacity(resource_group: resource_group, name: power_bi_embedded_name) do it { should exist } - its('properties.mode') { should include 'Gen2' } - its('sku.name') { should eq 'A1' } - its('sku.capacity') { should eq 1 } + its("properties.mode") { should include "Gen2" } + its("sku.name") { should eq "A1" } + its("sku.capacity") { should eq 1 } end end diff --git a/test/integration/verify/controls/azure_power_bi_gateway.rb b/test/integration/verify/controls/azure_power_bi_gateway.rb index c7e11b4f0..fb3d6e0c0 100644 --- a/test/integration/verify/controls/azure_power_bi_gateway.rb +++ b/test/integration/verify/controls/azure_power_bi_gateway.rb @@ -1,13 +1,13 @@ -gateway_id = input(:gateway_id, value: '') +gateway_id = input(:gateway_id, value: "") -control 'Verify settings of a Power BI Dashboard' do +control "Verify settings of a Power BI Dashboard" do - title 'Testing the singular resource of azure_power_bi_gateway.' - desc 'Testing the singular resource of azure_power_bi_gateway.' + title "Testing the singular resource of azure_power_bi_gateway." + desc "Testing the singular resource of azure_power_bi_gateway." describe azure_power_bi_gateway(gateway_id: gateway_id) do it { should exist } - its('type') { should eq 'Resource' } - its('publicKey.exponent') { should eq 'AQAB' } + its("type") { should eq "Resource" } + its("publicKey.exponent") { should eq "AQAB" } end end diff --git a/test/integration/verify/controls/azure_power_bi_gateways.rb b/test/integration/verify/controls/azure_power_bi_gateways.rb index fe645ccbc..c75f26a49 100644 --- a/test/integration/verify/controls/azure_power_bi_gateways.rb +++ b/test/integration/verify/controls/azure_power_bi_gateways.rb @@ -1,11 +1,11 @@ -control 'verify settings of Power BI Gateways' do +control "verify settings of Power BI Gateways" do - title 'Testing the plural resource of azure_power_bi_gateways.' - desc 'Testing the plural resource of azure_power_bi_gateways.' + title "Testing the plural resource of azure_power_bi_gateways." + desc "Testing the plural resource of azure_power_bi_gateways." describe azure_power_bi_gateways do it { should exist } - its('types') { should include 'Resource' } - its('exponents') { should include 'AQAB' } + its("types") { should include "Resource" } + its("exponents") { should include "AQAB" } end end diff --git a/test/integration/verify/controls/azure_redis_cache.rb b/test/integration/verify/controls/azure_redis_cache.rb index 896319a1b..cd8c8de84 100644 --- a/test/integration/verify/controls/azure_redis_cache.rb +++ b/test/integration/verify/controls/azure_redis_cache.rb @@ -1,20 +1,20 @@ resource_group_name = attribute(:resource_group, value: nil) inspec_redis_cache_name = attribute(:inspec_redis_cache_name, value: nil) -control 'azure_redis_cache' do +control "azure_redis_cache" do - title 'Testing the singular resource of azure_redis_cache.' - desc 'Testing the singular resource of azure_redis_cache.' + title "Testing the singular resource of azure_redis_cache." + desc "Testing the singular resource of azure_redis_cache." describe azure_redis_cache(resource_group: resource_group_name, name: inspec_redis_cache_name) do it { should exist } it { should_not be_enabled_non_ssl_port } - its('location') { should eq 'East US' } - its('properties.port') { should eq 6379 } - its('properties.sslPort') { should eq 6380 } - its('properties.redisConfiguration') { should have_attributes('maxmemory-policy': 'volatile-lru') } - its('properties.hostName') { should eq 'inspec-compliance-redis-cache.redis.cache.windows.net' } - its('properties.sku.name') { should eq 'Standard' } - its('properties.enableNonSslPort') { should eq false } + its("location") { should eq "East US" } + its("properties.port") { should eq 6379 } + its("properties.sslPort") { should eq 6380 } + its("properties.redisConfiguration") { should have_attributes('maxmemory-policy': "volatile-lru") } + its("properties.hostName") { should eq "inspec-compliance-redis-cache.redis.cache.windows.net" } + its("properties.sku.name") { should eq "Standard" } + its("properties.enableNonSslPort") { should eq false } end end diff --git a/test/integration/verify/controls/azure_redis_caches.rb b/test/integration/verify/controls/azure_redis_caches.rb index bf5b3af12..408bb4f5a 100644 --- a/test/integration/verify/controls/azure_redis_caches.rb +++ b/test/integration/verify/controls/azure_redis_caches.rb @@ -1,13 +1,13 @@ resource_group_name = attribute(:resource_group, value: nil) -control 'azure redis caches test' do +control "azure redis caches test" do - title 'Testing the plural resource of azure_redis_caches.' - desc 'Testing the plural resource of azure_redis_caches.' + title "Testing the plural resource of azure_redis_caches." + desc "Testing the plural resource of azure_redis_caches." describe azure_redis_caches(resource_group: resource_group_name) do it { should exist } - its('sku_names') { should include 'Standard' } + its("sku_names") { should include "Standard" } end describe azure_redis_caches(resource_group: resource_group_name).where(enable_non_ssl_port: true) do diff --git a/test/integration/verify/controls/azure_resource_group.rb b/test/integration/verify/controls/azure_resource_group.rb index 54a8c912b..eb7b5a4a4 100644 --- a/test/integration/verify/controls/azure_resource_group.rb +++ b/test/integration/verify/controls/azure_resource_group.rb @@ -1,11 +1,11 @@ -resource_group = input('resource_group', value: nil) +resource_group = input("resource_group", value: nil) -control 'azure_resource_group' do +control "azure_resource_group" do - title 'Testing the singular resource of azure_resource_group.' - desc 'Testing the singular resource of azure_resource_group.' + title "Testing the singular resource of azure_resource_group." + desc "Testing the singular resource of azure_resource_group." describe azure_resource_group(name: resource_group) do - its('tags') { should include('ExampleTag'=>'example') } + its("tags") { should include("ExampleTag"=>"example") } end end diff --git a/test/integration/verify/controls/azure_resource_health_availability_status.rb b/test/integration/verify/controls/azure_resource_health_availability_status.rb index 3d37d9c22..4155552ad 100644 --- a/test/integration/verify/controls/azure_resource_health_availability_status.rb +++ b/test/integration/verify/controls/azure_resource_health_availability_status.rb @@ -1,15 +1,15 @@ -resource_group = input('resource_group', value: nil) -storage_account = input('storage_account', value: nil) +resource_group = input("resource_group", value: nil) +storage_account = input("storage_account", value: nil) -control 'azure availability status' do +control "azure availability status" do - title 'Testing the singular resource of azure_resource_health_availability_status.' - desc 'Testing the singular resource of azure_resource_health_availability_status.' + title "Testing the singular resource of azure_resource_health_availability_status." + desc "Testing the singular resource of azure_resource_health_availability_status." - describe azure_resource_health_availability_status(resource_group: resource_group, resource_type: 'microsoft.storage/storageaccounts', name: storage_account) do + describe azure_resource_health_availability_status(resource_group: resource_group, resource_type: "microsoft.storage/storageaccounts", name: storage_account) do it { should exist } - its('location') { should eq 'ukwest' } - its('properties.availabilityState') { should eq 'Available' } - its('properties.reasonChronicity') { should eq 'Persistent' } + its("location") { should eq "ukwest" } + its("properties.availabilityState") { should eq "Available" } + its("properties.reasonChronicity") { should eq "Persistent" } end end diff --git a/test/integration/verify/controls/azure_resource_health_availability_statuses.rb b/test/integration/verify/controls/azure_resource_health_availability_statuses.rb index 94f73ab5d..f394d0383 100644 --- a/test/integration/verify/controls/azure_resource_health_availability_statuses.rb +++ b/test/integration/verify/controls/azure_resource_health_availability_statuses.rb @@ -1,10 +1,10 @@ -control 'azure_resource_health_availability_statuses' do +control "azure_resource_health_availability_statuses" do - title 'Testing the plural resource of azure_resource_health_availability_statuses.' - desc 'Testing the plural resource of azure_resource_health_availability_statuses.' + title "Testing the plural resource of azure_resource_health_availability_statuses." + desc "Testing the plural resource of azure_resource_health_availability_statuses." describe azure_resource_health_availability_statuses do it { should exist } - its('locations') { should include 'ukwest' } + its("locations") { should include "ukwest" } end end diff --git a/test/integration/verify/controls/azure_resource_health_emerging_issue.rb b/test/integration/verify/controls/azure_resource_health_emerging_issue.rb index 5372bd42c..2aa647bee 100644 --- a/test/integration/verify/controls/azure_resource_health_emerging_issue.rb +++ b/test/integration/verify/controls/azure_resource_health_emerging_issue.rb @@ -1,12 +1,12 @@ -control 'verify default emerging issue for services' do +control "verify default emerging issue for services" do - title 'Testing the singular resource of azure_resource_health_emerging_issue.' - desc 'Testing the singular resource of azure_resource_health_emerging_issue.' + title "Testing the singular resource of azure_resource_health_emerging_issue." + desc "Testing the singular resource of azure_resource_health_emerging_issue." - describe azure_resource_health_emerging_issue(name: 'default') do + describe azure_resource_health_emerging_issue(name: "default") do it { should exist } - its('name') { should eq 'default' } - its('type') { should eq '/providers/Microsoft.ResourceHealth/emergingissues' } - its('properties.statusActiveEvents') { should be_empty } + its("name") { should eq "default" } + its("type") { should eq "/providers/Microsoft.ResourceHealth/emergingissues" } + its("properties.statusActiveEvents") { should be_empty } end end diff --git a/test/integration/verify/controls/azure_resource_health_emerging_issues.rb b/test/integration/verify/controls/azure_resource_health_emerging_issues.rb index fc375756f..0f3aa9c36 100644 --- a/test/integration/verify/controls/azure_resource_health_emerging_issues.rb +++ b/test/integration/verify/controls/azure_resource_health_emerging_issues.rb @@ -1,11 +1,11 @@ -control 'verify service emerging issues' do +control "verify service emerging issues" do - title 'Testing the plural resource of azure_resource_health_emerging_issues.' - desc 'Testing the plural resource of azure_resource_health_emerging_issues.' + title "Testing the plural resource of azure_resource_health_emerging_issues." + desc "Testing the plural resource of azure_resource_health_emerging_issues." describe azure_resource_health_emerging_issues do it { should exist } - its('names') { should include 'default' } - its('types') { should include '/providers/Microsoft.ResourceHealth/emergingissues' } + its("names") { should include "default" } + its("types") { should include "/providers/Microsoft.ResourceHealth/emergingissues" } end end diff --git a/test/integration/verify/controls/azure_resource_health_events.rb b/test/integration/verify/controls/azure_resource_health_events.rb index 5c6f8d61c..aed2791b9 100644 --- a/test/integration/verify/controls/azure_resource_health_events.rb +++ b/test/integration/verify/controls/azure_resource_health_events.rb @@ -1,14 +1,14 @@ -resource_group = input(:resource_group, value: '') -resource_id = input(:windows_vm_id, value: '') +resource_group = input(:resource_group, value: "") +resource_id = input(:windows_vm_id, value: "") -control 'azure_resource_health_events' do +control "azure_resource_health_events" do - title 'Testing the plural resource of azure_resource_health_events.' - desc 'Testing the plural resource of azure_resource_health_events.' + title "Testing the plural resource of azure_resource_health_events." + desc "Testing the plural resource of azure_resource_health_events." - describe azure_resource_health_events(resource_group: resource_group, resource_type: 'Microsoft.Compute/virtualMachines', resource_id: resource_id) do + describe azure_resource_health_events(resource_group: resource_group, resource_type: "Microsoft.Compute/virtualMachines", resource_id: resource_id) do it { should exist } - its('names') { should include 'BC_1-FXZ' } - its('types') { should include '/providers/Microsoft.ResourceHealth/events' } + its("names") { should include "BC_1-FXZ" } + its("types") { should include "/providers/Microsoft.ResourceHealth/events" } end end diff --git a/test/integration/verify/controls/azure_sentinel_alert_rule.rb b/test/integration/verify/controls/azure_sentinel_alert_rule.rb index 6f5b7e3c8..585fa6cc8 100644 --- a/test/integration/verify/controls/azure_sentinel_alert_rule.rb +++ b/test/integration/verify/controls/azure_sentinel_alert_rule.rb @@ -1,22 +1,22 @@ -resource_group = input('resource_group', value: nil) -alert_rule_id = input('alert_rule_id', value: nil) -workspace_name = input('workspace_name', value: nil) -display_name = input('alert_rule_display_name', value: nil) -alert_rule_name = input('alert_rule_name', value: nil) +resource_group = input("resource_group", value: nil) +alert_rule_id = input("alert_rule_id", value: nil) +workspace_name = input("workspace_name", value: nil) +display_name = input("alert_rule_display_name", value: nil) +alert_rule_name = input("alert_rule_name", value: nil) -control 'azure_sentinel_alert_rule' do +control "azure_sentinel_alert_rule" do describe azure_sentinel_alert_rule(resource_group: resource_group, workspace_name: workspace_name, rule_id: alert_rule_id) do it { should exist } - its('name') { should eq alert_rule_name } - its('type') { should eq 'Microsoft.SecurityInsights/alertRules' } - its('kind') { should eq 'Scheduled' } - its('properties.displayName') { should eq display_name } - its('properties.enabled') { should eq true } - its('properties.severity') { should eq 'High' } + its("name") { should eq alert_rule_name } + its("type") { should eq "Microsoft.SecurityInsights/alertRules" } + its("kind") { should eq "Scheduled" } + its("properties.displayName") { should eq display_name } + its("properties.enabled") { should eq true } + its("properties.severity") { should eq "High" } end - describe azure_sentinel_alert_rule(resource_group: 'fake', workspace_name: workspace_name, rule_id: 'fake') do + describe azure_sentinel_alert_rule(resource_group: "fake", workspace_name: workspace_name, rule_id: "fake") do it { should_not exist } end end diff --git a/test/integration/verify/controls/azure_sentinel_alert_rules.rb b/test/integration/verify/controls/azure_sentinel_alert_rules.rb index c5bf8de64..d7c471f4c 100644 --- a/test/integration/verify/controls/azure_sentinel_alert_rules.rb +++ b/test/integration/verify/controls/azure_sentinel_alert_rules.rb @@ -1,16 +1,16 @@ -resource_group = attribute('resource_group', value: nil) -workspace_name = attribute('workspace_name', value: nil) -display_name = attribute('alert_rule_display_name', value: nil) -alert_rule_name = attribute('alert_rule_name', value: nil) +resource_group = attribute("resource_group", value: nil) +workspace_name = attribute("workspace_name", value: nil) +display_name = attribute("alert_rule_display_name", value: nil) +alert_rule_name = attribute("alert_rule_name", value: nil) -control 'azure_sentinel_alert_rules' do +control "azure_sentinel_alert_rules" do describe azure_sentinel_alert_rules(resource_group: resource_group, workspace_name: workspace_name) do it { should exist } - its('names') { should include alert_rule_name } - its('types') { should include 'Microsoft.SecurityInsights/alertRules' } - its('kinds') { should include 'Fusion' } - its('severities') { should include 'High' } - its('enableds') { should include true } - its('displayNames') { should include display_name } + its("names") { should include alert_rule_name } + its("types") { should include "Microsoft.SecurityInsights/alertRules" } + its("kinds") { should include "Fusion" } + its("severities") { should include "High" } + its("enableds") { should include true } + its("displayNames") { should include display_name } end end diff --git a/test/integration/verify/controls/azure_sentinel_incidents_resource.rb b/test/integration/verify/controls/azure_sentinel_incidents_resource.rb index 3507a7738..0638da3f7 100644 --- a/test/integration/verify/controls/azure_sentinel_incidents_resource.rb +++ b/test/integration/verify/controls/azure_sentinel_incidents_resource.rb @@ -1,21 +1,21 @@ -resource_group = input('resource_group', value: nil) -incident_id = input('incident_id', value: nil) -workspace_name = input('workspace_name', value: nil) +resource_group = input("resource_group", value: nil) +incident_id = input("incident_id", value: nil) +workspace_name = input("workspace_name", value: nil) -control 'azure_sentinel_incidents_resource' do +control "azure_sentinel_incidents_resource" do - title 'Testing the singular resource of azure_sentinel_incidents_resource.' - desc 'Testing the singular resource of azure_sentinel_incidents_resource.' + title "Testing the singular resource of azure_sentinel_incidents_resource." + desc "Testing the singular resource of azure_sentinel_incidents_resource." describe azure_sentinel_incidents_resource(resource_group: resource_group, workspace_name: workspace_name, incident_id: incident_id) do it { should exist } - its('type') { should eq 'Microsoft.OperationalInsights/workspaces' } - its('severity') { should include 'Informational' } - its('title') { should include 'test-ana' } - its('status') { should include 'new' } - its('owner.email') { should include 'samir.anand@progress.com' } - its('owner.userPrincipalName') { should include 'samir.anand@progress.com' } - its('owner.assignedTo') { should include 'Samir Anand' } + its("type") { should eq "Microsoft.OperationalInsights/workspaces" } + its("severity") { should include "Informational" } + its("title") { should include "test-ana" } + its("status") { should include "new" } + its("owner.email") { should include "samir.anand@progress.com" } + its("owner.userPrincipalName") { should include "samir.anand@progress.com" } + its("owner.assignedTo") { should include "Samir Anand" } end describe azure_sentinel_incidents_resource(resource_group: resource_group, workspace_name: workspace_name, incident_id: incident_id) do diff --git a/test/integration/verify/controls/azure_sentinel_incidents_resources.rb b/test/integration/verify/controls/azure_sentinel_incidents_resources.rb index d5bac4111..3831bd6f1 100644 --- a/test/integration/verify/controls/azure_sentinel_incidents_resources.rb +++ b/test/integration/verify/controls/azure_sentinel_incidents_resources.rb @@ -1,25 +1,25 @@ -resource_group = input('resource_group', value: nil) -incident_name = input('incident_name', value: nil) -workspace_name = input('workspace_name', value: nil) +resource_group = input("resource_group", value: nil) +incident_name = input("incident_name", value: nil) +workspace_name = input("workspace_name", value: nil) -control 'azure_sentinel_incidents_resources' do +control "azure_sentinel_incidents_resources" do - title 'Testing the plural resource of azure_sentinel_incidents_resources.' - desc 'Testing the plural resource of azure_sentinel_incidents_resources.' + title "Testing the plural resource of azure_sentinel_incidents_resources." + desc "Testing the plural resource of azure_sentinel_incidents_resources." describe azure_sentinel_incidents_resources(resource_group: resource_group, workspace_name: workspace_name) do it { should exist } - its('names') { should include incident_name } - its('types') { should include 'Microsoft.OperationalInsights/workspaces' } - its('severity') { should include 'High' } - its('classification') { should include 'High' } - its('classificationComment') { should include 'High' } - its('classificationReason') { should include 'Closed' } - its('status') { should include 'Closed' } - its('owner.objectId') { should include 'Closed' } - its('owner.email') { should include 'Closed' } - its('owner.userPrincipalName') { should include 'Closed' } - its('owner.assignedTo') { should include 'Closed' } - its('owner.assignedTo') { should include 'incidentNumber' } + its("names") { should include incident_name } + its("types") { should include "Microsoft.OperationalInsights/workspaces" } + its("severity") { should include "High" } + its("classification") { should include "High" } + its("classificationComment") { should include "High" } + its("classificationReason") { should include "Closed" } + its("status") { should include "Closed" } + its("owner.objectId") { should include "Closed" } + its("owner.email") { should include "Closed" } + its("owner.userPrincipalName") { should include "Closed" } + its("owner.assignedTo") { should include "Closed" } + its("owner.assignedTo") { should include "incidentNumber" } end end diff --git a/test/integration/verify/controls/azure_service_bus_namespace.rb b/test/integration/verify/controls/azure_service_bus_namespace.rb index 88351cb1c..cffa615c9 100644 --- a/test/integration/verify/controls/azure_service_bus_namespace.rb +++ b/test/integration/verify/controls/azure_service_bus_namespace.rb @@ -1,12 +1,12 @@ -resource_group = input(:resource_group, value: '') -service_bus_namespace_name = input(:service_bus_namespace_name, value: '') -location = input(:location, value: '') +resource_group = input(:resource_group, value: "") +service_bus_namespace_name = input(:service_bus_namespace_name, value: "") +location = input(:location, value: "") -control 'test the properties of an Azure Service Bus Namespace' do +control "test the properties of an Azure Service Bus Namespace" do describe azure_service_bus_namespace(resource_group: resource_group, name: service_bus_namespace_name) do it { should exist } - its('sku.name') { should eq 'Standard' } - its('location') { should eq location } - its('properties.provisioningState') { should eq 'Succeeded' } + its("sku.name") { should eq "Standard" } + its("location") { should eq location } + its("properties.provisioningState") { should eq "Succeeded" } end end diff --git a/test/integration/verify/controls/azure_service_bus_namespaces.rb b/test/integration/verify/controls/azure_service_bus_namespaces.rb index e83886395..035076449 100644 --- a/test/integration/verify/controls/azure_service_bus_namespaces.rb +++ b/test/integration/verify/controls/azure_service_bus_namespaces.rb @@ -1,14 +1,14 @@ -resource_group = input(:resource_group, value: '') -service_bus_namespace_name = input(:service_bus_namespace_name, value: '') -location = input(:location, value: '') +resource_group = input(:resource_group, value: "") +service_bus_namespace_name = input(:service_bus_namespace_name, value: "") +location = input(:location, value: "") -control 'test the properties of all Azure Service Bus Namespaces' do +control "test the properties of all Azure Service Bus Namespaces" do describe azure_service_bus_namespaces(resource_group: resource_group) do it { should exist } - its('names') { should include service_bus_namespace_name } - its('sku_names') { should include 'Standard' } - its('locations') { should include location } - its('types') { should include 'Microsoft.ServiceBus/Namespaces' } - its('provisioningStates') { should include 'Succeeded' } + its("names") { should include service_bus_namespace_name } + its("sku_names") { should include "Standard" } + its("locations") { should include location } + its("types") { should include "Microsoft.ServiceBus/Namespaces" } + its("provisioningStates") { should include "Succeeded" } end end diff --git a/test/integration/verify/controls/azure_service_bus_regions.rb b/test/integration/verify/controls/azure_service_bus_regions.rb index ae6a8d94b..f3f8376b9 100644 --- a/test/integration/verify/controls/azure_service_bus_regions.rb +++ b/test/integration/verify/controls/azure_service_bus_regions.rb @@ -1,9 +1,9 @@ -sku_name = 'Standard' -control 'test the properties of all Azure Service Bus Topics' do +sku_name = "Standard" +control "test the properties of all Azure Service Bus Topics" do describe azure_service_bus_regions(sku: sku_name) do it { should exist } - its('names') { should include 'Central US' } - its('codes') { should include 'Central US' } - its('fullNames') { should include 'Central US' } + its("names") { should include "Central US" } + its("codes") { should include "Central US" } + its("fullNames") { should include "Central US" } end end diff --git a/test/integration/verify/controls/azure_service_bus_subscription.rb b/test/integration/verify/controls/azure_service_bus_subscription.rb index 5fe31e260..215da8beb 100644 --- a/test/integration/verify/controls/azure_service_bus_subscription.rb +++ b/test/integration/verify/controls/azure_service_bus_subscription.rb @@ -1,13 +1,13 @@ -resource_group = input(:resource_group, value: '') -service_bus_namespace_name = input(:service_bus_namespace_name, value: '') -service_bus_subscription_name = input(:service_bus_subscription_name, value: '') -service_bus_topic_name = input(:service_bus_topic_name, value: '') +resource_group = input(:resource_group, value: "") +service_bus_namespace_name = input(:service_bus_namespace_name, value: "") +service_bus_subscription_name = input(:service_bus_subscription_name, value: "") +service_bus_topic_name = input(:service_bus_topic_name, value: "") -control 'Verify the settings for an Azure Service Bus Subscription' do +control "Verify the settings for an Azure Service Bus Subscription" do describe azure_service_bus_subscription(resource_group: resource_group, namespace_name: service_bus_namespace_name, topic_name: service_bus_topic_name, name: service_bus_subscription_name) do it { should exist } - its('type') { should eq 'Microsoft.ServiceBus/Namespaces/Topics/Subscriptions/Rules' } - its('properties.lockDuration') { should eq 'PT1M' } - its('properties.status') { should eq 'Active' } + its("type") { should eq "Microsoft.ServiceBus/Namespaces/Topics/Subscriptions/Rules" } + its("properties.lockDuration") { should eq "PT1M" } + its("properties.status") { should eq "Active" } end end diff --git a/test/integration/verify/controls/azure_service_bus_subscription_rule.rb b/test/integration/verify/controls/azure_service_bus_subscription_rule.rb index e764d2dcd..d3553fb35 100644 --- a/test/integration/verify/controls/azure_service_bus_subscription_rule.rb +++ b/test/integration/verify/controls/azure_service_bus_subscription_rule.rb @@ -1,14 +1,14 @@ -resource_group = input(:resource_group, value: '') -service_bus_namespace_name = input(:service_bus_namespace_name, value: '') -service_bus_subscription_name = input(:service_bus_subscription_name, value: '') -service_bus_topic_name = input(:service_bus_topic_name, value: '') -service_bus_subscription_rule_name = input(:service_bus_subscription_rule_name, value: '') +resource_group = input(:resource_group, value: "") +service_bus_namespace_name = input(:service_bus_namespace_name, value: "") +service_bus_subscription_name = input(:service_bus_subscription_name, value: "") +service_bus_topic_name = input(:service_bus_topic_name, value: "") +service_bus_subscription_rule_name = input(:service_bus_subscription_rule_name, value: "") -control 'Verify the settings for an Azure Service Bus Subscription Rule' do +control "Verify the settings for an Azure Service Bus Subscription Rule" do describe azure_service_bus_subscription_rule(resource_group: resource_group, namespace_name: service_bus_namespace_name, subscription_name: service_bus_subscription_name, topic_name: service_bus_topic_name, name: service_bus_subscription_rule_name) do it { should exist } - its('type') { should eq 'Microsoft.ServiceBus/Namespaces/Topics/Subscriptions/Rules' } - its('properties.filterType') { should eq 'SqlFilter' } - its('properties.sqlFilter.compatibilityLevel') { should eq 20 } + its("type") { should eq "Microsoft.ServiceBus/Namespaces/Topics/Subscriptions/Rules" } + its("properties.filterType") { should eq "SqlFilter" } + its("properties.sqlFilter.compatibilityLevel") { should eq 20 } end end diff --git a/test/integration/verify/controls/azure_service_bus_subscription_rules.rb b/test/integration/verify/controls/azure_service_bus_subscription_rules.rb index ba9159ea4..9d7454737 100644 --- a/test/integration/verify/controls/azure_service_bus_subscription_rules.rb +++ b/test/integration/verify/controls/azure_service_bus_subscription_rules.rb @@ -1,14 +1,14 @@ -resource_group = input(:resource_group, value: '') -service_bus_namespace_name = input(:service_bus_namespace_name, value: '') -service_bus_subscription_name = input(:service_bus_subscription_name, value: '') -service_bus_topic_name = input(:service_bus_topic_name, value: '') -service_bus_subscription_rule_name = input(:service_bus_subscription_rule_name, value: '') +resource_group = input(:resource_group, value: "") +service_bus_namespace_name = input(:service_bus_namespace_name, value: "") +service_bus_subscription_name = input(:service_bus_subscription_name, value: "") +service_bus_topic_name = input(:service_bus_topic_name, value: "") +service_bus_subscription_rule_name = input(:service_bus_subscription_rule_name, value: "") -control 'Verify the settings for all Azure Service Bus Subscription Rules' do +control "Verify the settings for all Azure Service Bus Subscription Rules" do describe azure_service_bus_subscription_rules(resource_group: resource_group, namespace_name: service_bus_namespace_name, subscription_name: service_bus_subscription_name, topic_name: service_bus_topic_name) do it { should exist } - its('name') { should include service_bus_subscription_rule_name } - its('type') { should include 'Microsoft.ServiceBus/Namespaces/Topics/Subscriptions/Rules' } - its('filterTypes') { should include 'SqlFilter' } + its("name") { should include service_bus_subscription_rule_name } + its("type") { should include "Microsoft.ServiceBus/Namespaces/Topics/Subscriptions/Rules" } + its("filterTypes") { should include "SqlFilter" } end end diff --git a/test/integration/verify/controls/azure_service_bus_subscriptions.rb b/test/integration/verify/controls/azure_service_bus_subscriptions.rb index 16570428c..86353ddaf 100644 --- a/test/integration/verify/controls/azure_service_bus_subscriptions.rb +++ b/test/integration/verify/controls/azure_service_bus_subscriptions.rb @@ -1,14 +1,14 @@ -resource_group = input(:resource_group, value: '') -service_bus_namespace_name = input(:service_bus_namespace_name, value: '') -service_bus_subscription_name = input(:service_bus_subscription_name, value: '') -service_bus_topic_name = input(:service_bus_topic_name, value: '') +resource_group = input(:resource_group, value: "") +service_bus_namespace_name = input(:service_bus_namespace_name, value: "") +service_bus_subscription_name = input(:service_bus_subscription_name, value: "") +service_bus_topic_name = input(:service_bus_topic_name, value: "") -control 'Verify the settings for all Azure Service Bus Subscriptions' do +control "Verify the settings for all Azure Service Bus Subscriptions" do describe azure_service_bus_subscriptions(resource_group: resource_group, namespace_name: service_bus_namespace_name, topic_name: service_bus_topic_name) do it { should exist } - its('name') { should include service_bus_subscription_name } - its('type') { should include 'Microsoft.ServiceBus/Namespaces/Topics/Subscriptions' } - its('lockDurations') { should include 'PT1M' } - its('statuses') { should include 'Active' } + its("name") { should include service_bus_subscription_name } + its("type") { should include "Microsoft.ServiceBus/Namespaces/Topics/Subscriptions" } + its("lockDurations") { should include "PT1M" } + its("statuses") { should include "Active" } end end diff --git a/test/integration/verify/controls/azure_service_bus_topic.rb b/test/integration/verify/controls/azure_service_bus_topic.rb index 479478999..f1954e75e 100644 --- a/test/integration/verify/controls/azure_service_bus_topic.rb +++ b/test/integration/verify/controls/azure_service_bus_topic.rb @@ -1,12 +1,12 @@ -resource_group = input(:resource_group, value: '') -service_bus_namespace_name = input(:service_bus_namespace_name, value: '') +resource_group = input(:resource_group, value: "") +service_bus_namespace_name = input(:service_bus_namespace_name, value: "") -control 'test the properties of all Azure Service Bus Topic' do - describe azure_service_bus_topic(resource_group: resource_group, namespace_name: service_bus_namespace_name, name: 'inspec-topic') do +control "test the properties of all Azure Service Bus Topic" do + describe azure_service_bus_topic(resource_group: resource_group, namespace_name: service_bus_namespace_name, name: "inspec-topic") do it { should exist } - its('properties.status') { should eq 'Active' } - its('properties.supportOrdering') { should eq true } - its('properties.enableBatchedOperations') { should eq true } - its('properties.maxSizeInMegabytes') { should eq 1024 } + its("properties.status") { should eq "Active" } + its("properties.supportOrdering") { should eq true } + its("properties.enableBatchedOperations") { should eq true } + its("properties.maxSizeInMegabytes") { should eq 1024 } end end diff --git a/test/integration/verify/controls/azure_service_bus_topics.rb b/test/integration/verify/controls/azure_service_bus_topics.rb index 84043c410..762c70753 100644 --- a/test/integration/verify/controls/azure_service_bus_topics.rb +++ b/test/integration/verify/controls/azure_service_bus_topics.rb @@ -1,11 +1,11 @@ -resource_group = input(:resource_group, value: '') -service_bus_namespace_name = input(:service_bus_namespace_name, value: '') -control 'test the properties of all Azure Service Bus Topics' do +resource_group = input(:resource_group, value: "") +service_bus_namespace_name = input(:service_bus_namespace_name, value: "") +control "test the properties of all Azure Service Bus Topics" do describe azure_service_bus_topics(resource_group: resource_group, namespace_name: service_bus_namespace_name) do it { should exist } - its('statuses') { should include 'Active' } - its('supportOrderings') { should include true } - its('enableBatchedOperations') { should include true } - its('maxSizeInMegabytes') { should include 1024 } + its("statuses") { should include "Active" } + its("supportOrderings") { should include true } + its("enableBatchedOperations") { should include true } + its("maxSizeInMegabytes") { should include 1024 } end end diff --git a/test/integration/verify/controls/azure_service_fabric_mesh_application.rb b/test/integration/verify/controls/azure_service_fabric_mesh_application.rb index 77ac4283a..d890dda3f 100644 --- a/test/integration/verify/controls/azure_service_fabric_mesh_application.rb +++ b/test/integration/verify/controls/azure_service_fabric_mesh_application.rb @@ -1,13 +1,13 @@ -resource_group = input(:resource_group, value: '') -location = input(:location, value: '') +resource_group = input(:resource_group, value: "") +location = input(:location, value: "") -skip_control 'test the properties of an Azure Service Fabric Mesh Application' do - describe azure_service_fabric_mesh_application(resource_group: resource_group, name: 'inspec-fb-mesh-app') do +skip_control "test the properties of an Azure Service Fabric Mesh Application" do + describe azure_service_fabric_mesh_application(resource_group: resource_group, name: "inspec-fb-mesh-app") do it { should exist } - its('name') { should eq 'inspec-fb-mesh-app' } - its('properties.status') { should eq 'Ready' } - its('location') { should eq location.downcase.gsub("\s", '') } - its('properties.healthState') { should eq 'healthState' } - its('properties.provisioningState') { should eq 'Succeeded' } + its("name") { should eq "inspec-fb-mesh-app" } + its("properties.status") { should eq "Ready" } + its("location") { should eq location.downcase.gsub("\s", "") } + its("properties.healthState") { should eq "healthState" } + its("properties.provisioningState") { should eq "Succeeded" } end end diff --git a/test/integration/verify/controls/azure_service_fabric_mesh_applications.rb b/test/integration/verify/controls/azure_service_fabric_mesh_applications.rb index d8752106a..1117b52b6 100644 --- a/test/integration/verify/controls/azure_service_fabric_mesh_applications.rb +++ b/test/integration/verify/controls/azure_service_fabric_mesh_applications.rb @@ -1,12 +1,12 @@ -location = input(:location, value: '') +location = input(:location, value: "") -skip_control 'test the properties of all Azure Service Fabric Mesh Applications' do +skip_control "test the properties of all Azure Service Fabric Mesh Applications" do describe azure_service_fabric_mesh_applications do it { should exist } - its('names') { should include 'inspec-fb-mesh-app' } - its('statuses') { should include 'Ready' } - its('locations') { should include location.downcase.gsub("\s", '') } - its('healthStates') { should include 'healthState' } - its('provisioningStates') { should include 'Succeeded' } + its("names") { should include "inspec-fb-mesh-app" } + its("statuses") { should include "Ready" } + its("locations") { should include location.downcase.gsub("\s", "") } + its("healthStates") { should include "healthState" } + its("provisioningStates") { should include "Succeeded" } end end diff --git a/test/integration/verify/controls/azure_service_fabric_mesh_network.rb b/test/integration/verify/controls/azure_service_fabric_mesh_network.rb index 5527a92cb..5c8b1606c 100644 --- a/test/integration/verify/controls/azure_service_fabric_mesh_network.rb +++ b/test/integration/verify/controls/azure_service_fabric_mesh_network.rb @@ -1,11 +1,11 @@ -location = input(:location, value: '') -rg = input(:resource_group, value: '') +location = input(:location, value: "") +rg = input(:resource_group, value: "") -skip_control 'Test the properties of a Azure Service Fabric Mesh Network' do - describe azure_service_fabric_mesh_networks(resource_group: rg, name: 'mesh-fabric-name') do +skip_control "Test the properties of a Azure Service Fabric Mesh Network" do + describe azure_service_fabric_mesh_networks(resource_group: rg, name: "mesh-fabric-name") do it { should exist } - its('location') { should eq location.downcase.gsub("\s", '') } - its('addressPrefix') { should eq '10.0.0.4/22' } - its('provisioningState') { should eq 'Succeeded' } + its("location") { should eq location.downcase.gsub("\s", "") } + its("addressPrefix") { should eq "10.0.0.4/22" } + its("provisioningState") { should eq "Succeeded" } end end diff --git a/test/integration/verify/controls/azure_service_fabric_mesh_networks.rb b/test/integration/verify/controls/azure_service_fabric_mesh_networks.rb index 16e2a938b..2658ec765 100644 --- a/test/integration/verify/controls/azure_service_fabric_mesh_networks.rb +++ b/test/integration/verify/controls/azure_service_fabric_mesh_networks.rb @@ -1,11 +1,11 @@ -location = input(:location, value: '') +location = input(:location, value: "") -skip_control 'Testthe properties of all Azure Service Fabric Mesh Networks' do +skip_control "Testthe properties of all Azure Service Fabric Mesh Networks" do describe azure_service_fabric_mesh_networks do it { should exist } - its('names') { should include 'inspec-fb-mesh-vol' } - its('locations') { should include location.downcase.gsub("\s", '') } - its('addressPrefixes') { should include '10.0.0.4/22' } - its('provisioningStates') { should include 'Succeeded' } + its("names") { should include "inspec-fb-mesh-vol" } + its("locations") { should include location.downcase.gsub("\s", "") } + its("addressPrefixes") { should include "10.0.0.4/22" } + its("provisioningStates") { should include "Succeeded" } end end diff --git a/test/integration/verify/controls/azure_service_fabric_mesh_replica.rb b/test/integration/verify/controls/azure_service_fabric_mesh_replica.rb index 03d493a9c..3878f8600 100644 --- a/test/integration/verify/controls/azure_service_fabric_mesh_replica.rb +++ b/test/integration/verify/controls/azure_service_fabric_mesh_replica.rb @@ -1,8 +1,8 @@ -skip_control 'test the properties of all Azure Service Fabric Mesh Service Replica' do - describe azure_service_fabric_mesh_replicas(resource_group: 'inspec-def-rg', application_name: 'inspec-fabric-app-name', service_name: 'inspec-fabric-svc', name: 'inspec-fabric-replica') do +skip_control "test the properties of all Azure Service Fabric Mesh Service Replica" do + describe azure_service_fabric_mesh_replicas(resource_group: "inspec-def-rg", application_name: "inspec-fabric-app-name", service_name: "inspec-fabric-svc", name: "inspec-fabric-replica") do it { should exist } - its('osType') { should eq 'Linux' } - its('networkRefs') { should_not be_empty } - its('replicaName') { should eq 1 } + its("osType") { should eq "Linux" } + its("networkRefs") { should_not be_empty } + its("replicaName") { should eq 1 } end end diff --git a/test/integration/verify/controls/azure_service_fabric_mesh_replicas.rb b/test/integration/verify/controls/azure_service_fabric_mesh_replicas.rb index f327ca61b..6b63753bb 100644 --- a/test/integration/verify/controls/azure_service_fabric_mesh_replicas.rb +++ b/test/integration/verify/controls/azure_service_fabric_mesh_replicas.rb @@ -1,8 +1,8 @@ -skip_control 'test the properties of all Azure Service Fabric Mesh Service Replicas' do - describe azure_service_fabric_mesh_replicas(resource_group: 'inspec-def-rg', application_name: 'inspec-fabric-app-name', service_name: 'inspec-fabric-svc') do +skip_control "test the properties of all Azure Service Fabric Mesh Service Replicas" do + describe azure_service_fabric_mesh_replicas(resource_group: "inspec-def-rg", application_name: "inspec-fabric-app-name", service_name: "inspec-fabric-svc") do it { should exist } - its('osTypes') { should include 'Linux' } - its('networkRefs') { should_not be_empty } - its('replicaNames') { should include 1 } + its("osTypes") { should include "Linux" } + its("networkRefs") { should_not be_empty } + its("replicaNames") { should include 1 } end end diff --git a/test/integration/verify/controls/azure_service_fabric_mesh_service.rb b/test/integration/verify/controls/azure_service_fabric_mesh_service.rb index 43a01d1b4..8ffbec08b 100644 --- a/test/integration/verify/controls/azure_service_fabric_mesh_service.rb +++ b/test/integration/verify/controls/azure_service_fabric_mesh_service.rb @@ -1,11 +1,11 @@ -resource_group = input(:resource_group, value: '') +resource_group = input(:resource_group, value: "") -control 'test the properties of an Azure Service Fabric Mesh Service' do - describe azure_service_fabric_mesh_service(resource_group: resource_group, name: 'fabric-svc') do +control "test the properties of an Azure Service Fabric Mesh Service" do + describe azure_service_fabric_mesh_service(resource_group: resource_group, name: "fabric-svc") do it { should exist } - its('name') { should eq 'fabric-svc' } - its('replicaCount') { should eq '2' } - its('type') { should eq 'Microsoft.ServiceFabricMesh/services' } - its('healthState') { should eq 'Ok' } + its("name") { should eq "fabric-svc" } + its("replicaCount") { should eq "2" } + its("type") { should eq "Microsoft.ServiceFabricMesh/services" } + its("healthState") { should eq "Ok" } end end diff --git a/test/integration/verify/controls/azure_service_fabric_mesh_services.rb b/test/integration/verify/controls/azure_service_fabric_mesh_services.rb index a20a31e8a..20465db3b 100644 --- a/test/integration/verify/controls/azure_service_fabric_mesh_services.rb +++ b/test/integration/verify/controls/azure_service_fabric_mesh_services.rb @@ -1,11 +1,11 @@ -resource_group = input(:resource_group, value: '') +resource_group = input(:resource_group, value: "") -control 'test the properties of all Azure Service Fabric Mesh Services' do +control "test the properties of all Azure Service Fabric Mesh Services" do describe azure_service_fabric_mesh_services(resource_group: resource_group) do it { should exist } - its('names') { should include 'fabric-svc' } - its('replicaCounts') { should include '2' } - its('types') { should include 'Microsoft.ServiceFabricMesh/services' } - its('healthStates') { should include 'Ok' } + its("names") { should include "fabric-svc" } + its("replicaCounts") { should include "2" } + its("types") { should include "Microsoft.ServiceFabricMesh/services" } + its("healthStates") { should include "Ok" } end end diff --git a/test/integration/verify/controls/azure_service_fabric_mesh_volume.rb b/test/integration/verify/controls/azure_service_fabric_mesh_volume.rb index a1aa532d2..1614d5210 100644 --- a/test/integration/verify/controls/azure_service_fabric_mesh_volume.rb +++ b/test/integration/verify/controls/azure_service_fabric_mesh_volume.rb @@ -1,12 +1,12 @@ -rg = input(:resource_group, value: '') -location = input(:location, value: '') +rg = input(:resource_group, value: "") +location = input(:location, value: "") -skip_control 'Test the properties of the Azure Service Fabric Mesh Volume' do - describe azure_service_fabric_mesh_volume(resource_group: rg, name: 'mesh-volume-name') do +skip_control "Test the properties of the Azure Service Fabric Mesh Volume" do + describe azure_service_fabric_mesh_volume(resource_group: rg, name: "mesh-volume-name") do it { should exist } - its('properties.provider') { should eq 'SFAzureFile' } - its('location') { should include location.downcase.gsub("\s", '') } - its('properties.azureFileParameters.shareName') { should include 'sharel' } - its('properties.provisioningState') { should include 'Succeeded' } + its("properties.provider") { should eq "SFAzureFile" } + its("location") { should include location.downcase.gsub("\s", "") } + its("properties.azureFileParameters.shareName") { should include "sharel" } + its("properties.provisioningState") { should include "Succeeded" } end end diff --git a/test/integration/verify/controls/azure_service_fabric_mesh_volumes.rb b/test/integration/verify/controls/azure_service_fabric_mesh_volumes.rb index 41ed82407..057a48b7d 100644 --- a/test/integration/verify/controls/azure_service_fabric_mesh_volumes.rb +++ b/test/integration/verify/controls/azure_service_fabric_mesh_volumes.rb @@ -1,12 +1,12 @@ -location = input(:location, value: '') +location = input(:location, value: "") -skip_control 'test the properties of all Azure Service Fabric Mesh Volumes' do +skip_control "test the properties of all Azure Service Fabric Mesh Volumes" do describe azure_service_fabric_mesh_volumes do it { should exist } - its('names') { should include 'inspec-fb-mesh-vol' } - its('providers') { should include 'SFAzureFile' } - its('locations') { should include location.downcase.gsub("\s", '') } - its('shareNames') { should include 'sharel' } - its('provisioningStates') { should include 'Succeeded' } + its("names") { should include "inspec-fb-mesh-vol" } + its("providers") { should include "SFAzureFile" } + its("locations") { should include location.downcase.gsub("\s", "") } + its("shareNames") { should include "sharel" } + its("provisioningStates") { should include "Succeeded" } end end diff --git a/test/integration/verify/controls/azure_snapshot.rb b/test/integration/verify/controls/azure_snapshot.rb index 5565f174a..810b49b8f 100644 --- a/test/integration/verify/controls/azure_snapshot.rb +++ b/test/integration/verify/controls/azure_snapshot.rb @@ -1,32 +1,32 @@ -snapshot_id = input('snapshot_id', value: '', desc: '') -snapshot_name = input('snapshot_name', value: '', desc: '') -snapshot_location = input('snapshot_location', value: '', desc: '') -snapshot_source_resource_id = input('snapshot_source_resource_id', value: '', desc: '') -snapshot_disk_size_gb = input('snapshot_disk_size_gb', value: '', desc: '') +snapshot_id = input("snapshot_id", value: "", desc: "") +snapshot_name = input("snapshot_name", value: "", desc: "") +snapshot_location = input("snapshot_location", value: "", desc: "") +snapshot_source_resource_id = input("snapshot_source_resource_id", value: "", desc: "") +snapshot_disk_size_gb = input("snapshot_disk_size_gb", value: "", desc: "") -control 'azure_snapshot' do - title 'Testing the singular resource of azure_snapshot.' - desc 'Testing the singular resource of azure_snapshot.' +control "azure_snapshot" do + title "Testing the singular resource of azure_snapshot." + desc "Testing the singular resource of azure_snapshot." - describe azure_snapshot(resource_group: 'jfm-Dhaka-Bangladesh-RG', name: 'jfm-vm-8-snapshot') do + describe azure_snapshot(resource_group: "jfm-Dhaka-Bangladesh-RG", name: "jfm-vm-8-snapshot") do it { should exist } end - describe azure_snapshot(resource_group: 'jfm-Dhaka-Bangladesh-RG', name: 'jfm-vm-8-snapshot') do - its('id') { should eq snapshot_id } - its('name') { should eq snapshot_name } - its('type') { should eq 'Microsoft.Compute/snapshots' } - its('location') { should eq snapshot_location } + describe azure_snapshot(resource_group: "jfm-Dhaka-Bangladesh-RG", name: "jfm-vm-8-snapshot") do + its("id") { should eq snapshot_id } + its("name") { should eq snapshot_name } + its("type") { should eq "Microsoft.Compute/snapshots" } + its("location") { should eq snapshot_location } - its('sku.name') { should eq 'Standard_LRS' } - its('sku.tier') { should eq 'Standard' } + its("sku.name") { should eq "Standard_LRS" } + its("sku.tier") { should eq "Standard" } - its('properties.osType') { should eq 'Windows' } - its('properties.creationData.createOption') { should eq 'Copy' } - its('properties.creationData.sourceResourceId') { should eq snapshot_source_resource_id } - its('properties.diskSizeGB') { should eq snapshot_disk_size_gb } - its('properties.timeCreated') { should_not be_empty } - its('properties.provisioningState') { should eq 'Succeeded' } - its('properties.diskState') { should eq 'Unattached' } + its("properties.osType") { should eq "Windows" } + its("properties.creationData.createOption") { should eq "Copy" } + its("properties.creationData.sourceResourceId") { should eq snapshot_source_resource_id } + its("properties.diskSizeGB") { should eq snapshot_disk_size_gb } + its("properties.timeCreated") { should_not be_empty } + its("properties.provisioningState") { should eq "Succeeded" } + its("properties.diskState") { should eq "Unattached" } end end diff --git a/test/integration/verify/controls/azure_snapshots.rb b/test/integration/verify/controls/azure_snapshots.rb index ef25ff4ec..cd25af4cf 100644 --- a/test/integration/verify/controls/azure_snapshots.rb +++ b/test/integration/verify/controls/azure_snapshots.rb @@ -1,22 +1,22 @@ -snapshot_id = input('snapshot_id', value: '', desc: '') -snapshot_name = input('snapshot_name', value: '', desc: '') -snapshot_location = input('snapshot_location', value: '', desc: '') +snapshot_id = input("snapshot_id", value: "", desc: "") +snapshot_name = input("snapshot_name", value: "", desc: "") +snapshot_location = input("snapshot_location", value: "", desc: "") -control 'azure_snapshots' do - title 'Testing the plural resource of azure_snapshots.' - desc 'Testing the plural resource of azure_snapshots.' +control "azure_snapshots" do + title "Testing the plural resource of azure_snapshots." + desc "Testing the plural resource of azure_snapshots." describe azure_snapshots do it { should exist } end describe azure_snapshots do - its('ids') { should include snapshot_id } - its('names') { should include snapshot_name } - its('types') { should include 'Microsoft.Compute/snapshots' } - its('locations') { should include snapshot_location } - its('tags') { should_not be_empty } - its('skus') { should_not be_empty } - its('properties') { should_not be_empty } + its("ids") { should include snapshot_id } + its("names") { should include snapshot_name } + its("types") { should include "Microsoft.Compute/snapshots" } + its("locations") { should include snapshot_location } + its("tags") { should_not be_empty } + its("skus") { should_not be_empty } + its("properties") { should_not be_empty } end end diff --git a/test/integration/verify/controls/azure_sql_database_server_vulnerability_assessment.rb b/test/integration/verify/controls/azure_sql_database_server_vulnerability_assessment.rb index cd56eae52..cc0cb76d3 100644 --- a/test/integration/verify/controls/azure_sql_database_server_vulnerability_assessment.rb +++ b/test/integration/verify/controls/azure_sql_database_server_vulnerability_assessment.rb @@ -1,22 +1,22 @@ -resource_group = input('resource_group', value: '', description: 'The resource group of the SQL Server.') -sql_server_id = input(:sql_server_id, value: '', description: 'The ID of the SQL Server.') -sql_server_name = input(:sql_server_name, value: '', description: 'The name of the SQL Server.') +resource_group = input("resource_group", value: "", description: "The resource group of the SQL Server.") +sql_server_id = input(:sql_server_id, value: "", description: "The ID of the SQL Server.") +sql_server_name = input(:sql_server_name, value: "", description: "The name of the SQL Server.") -control 'azure_sql_database_server_vulnerability_assessment' do - title 'Testing the singular resource of azure_sql_database_server_vulnerability_assessment.' - desc 'Testing the singular resource of azure_sql_database_server_vulnerability_assessment.' +control "azure_sql_database_server_vulnerability_assessment" do + title "Testing the singular resource of azure_sql_database_server_vulnerability_assessment." + desc "Testing the singular resource of azure_sql_database_server_vulnerability_assessment." describe azure_sql_database_server_vulnerability_assessment(resource_group: resource_group, server_name: sql_server_name) do it { should exist } end describe azure_sql_database_server_vulnerability_assessment(resource_group: resource_group, server_name: sql_server_name) do - its('id') { should eq sql_server_id } - its('name') { should eq 'Default' } - its('type') { should eq 'Microsoft.Sql/servers/vulnerabilityAssessments' } + its("id") { should eq sql_server_id } + its("name") { should eq "Default" } + its("type") { should eq "Microsoft.Sql/servers/vulnerabilityAssessments" } - its('properties.recurringScans.isEnabled') { should eq false } - its('properties.recurringScans.emailSubscriptionAdmins') { should eq true } - its('properties.recurringScans.emails') { should be_empty } + its("properties.recurringScans.isEnabled") { should eq false } + its("properties.recurringScans.emailSubscriptionAdmins") { should eq true } + its("properties.recurringScans.emails") { should be_empty } end end diff --git a/test/integration/verify/controls/azure_sql_database_server_vulnerability_assessments.rb b/test/integration/verify/controls/azure_sql_database_server_vulnerability_assessments.rb index 03bd1377f..2c178fa08 100644 --- a/test/integration/verify/controls/azure_sql_database_server_vulnerability_assessments.rb +++ b/test/integration/verify/controls/azure_sql_database_server_vulnerability_assessments.rb @@ -1,22 +1,22 @@ -resource_group = input('resource_group', value: '', description: 'The resource group of the SQL Server.') -sql_server_id = input(:sql_server_id, value: '', description: 'The ID of the SQL Server.') -sql_server_name = input(:sql_server_name, value: '', description: 'The name of the SQL Server.') +resource_group = input("resource_group", value: "", description: "The resource group of the SQL Server.") +sql_server_id = input(:sql_server_id, value: "", description: "The ID of the SQL Server.") +sql_server_name = input(:sql_server_name, value: "", description: "The name of the SQL Server.") -control 'azure_sql_database_server_vulnerability_assessments' do - title 'Testing the plural resource of azure_sql_database_server_vulnerability_assessments.' - desc 'Testing the plural resource of azure_sql_database_server_vulnerability_assessments.' +control "azure_sql_database_server_vulnerability_assessments" do + title "Testing the plural resource of azure_sql_database_server_vulnerability_assessments." + desc "Testing the plural resource of azure_sql_database_server_vulnerability_assessments." describe azure_sql_database_server_vulnerability_assessments(resource_group: resource_group, server_name: sql_server_name) do it { should exist } end describe azure_sql_database_server_vulnerability_assessments(resource_group: resource_group, server_name: sql_server_name) do - its('ids') { should include "#{sql_server_id}/vulnerabilityAssessments/Default" } - its('names') { should include 'Default' } - its('types') { should include 'Microsoft.Sql/servers/vulnerabilityAssessments' } + its("ids") { should include "#{sql_server_id}/vulnerabilityAssessments/Default" } + its("names") { should include "Default" } + its("types") { should include "Microsoft.Sql/servers/vulnerabilityAssessments" } - its('isEnabled') { should include false } - its('emailSubscriptionAdmins') { should include true } - its('emails') { should_not be_empty } + its("isEnabled") { should include false } + its("emailSubscriptionAdmins") { should include true } + its("emails") { should_not be_empty } end end diff --git a/test/integration/verify/controls/azure_sql_managed_instance.rb b/test/integration/verify/controls/azure_sql_managed_instance.rb index 6df67fc15..500bdebc5 100644 --- a/test/integration/verify/controls/azure_sql_managed_instance.rb +++ b/test/integration/verify/controls/azure_sql_managed_instance.rb @@ -1,17 +1,17 @@ -resource_group = input(:resource_group, value: '') -sql_managed_instance_name = input(:inspec_sql_managed_instance_name, value: '') -location = input(:location, value: '') +resource_group = input(:resource_group, value: "") +sql_managed_instance_name = input(:inspec_sql_managed_instance_name, value: "") +location = input(:location, value: "") -control 'test the properties of all Azure SQL Managed Instance in the resource group' do +control "test the properties of all Azure SQL Managed Instance in the resource group" do - title 'Testing the singular resource of azure_sql_managed_instance.' - desc 'Testing the singular resource of azure_sql_managed_instance.' + title "Testing the singular resource of azure_sql_managed_instance." + desc "Testing the singular resource of azure_sql_managed_instance." describe azure_sql_managed_instance(resource_group: resource_group, name: sql_managed_instance_name) do it { should exist } - its('sku.name') { should eq 'GP_Gen5' } - its('location') { should eq location.downcase.gsub(' ', '') } - its('type') { should eq 'Microsoft.Sql/managedInstances' } - its('properties.provisioningState') { should eq 'Succeeded' } + its("sku.name") { should eq "GP_Gen5" } + its("location") { should eq location.downcase.gsub(" ", "") } + its("type") { should eq "Microsoft.Sql/managedInstances" } + its("properties.provisioningState") { should eq "Succeeded" } end end diff --git a/test/integration/verify/controls/azure_sql_managed_instances.rb b/test/integration/verify/controls/azure_sql_managed_instances.rb index 2336567a1..9b5c4dc6c 100644 --- a/test/integration/verify/controls/azure_sql_managed_instances.rb +++ b/test/integration/verify/controls/azure_sql_managed_instances.rb @@ -1,18 +1,18 @@ -resource_group = input(:resource_group, value: '') -sql_managed_instance_name = input(:inspec_sql_managed_instance_name, value: '') -location = input(:location, value: '') +resource_group = input(:resource_group, value: "") +sql_managed_instance_name = input(:inspec_sql_managed_instance_name, value: "") +location = input(:location, value: "") -control 'test the properties of all Azure SQL Managed Instances in the resource group' do +control "test the properties of all Azure SQL Managed Instances in the resource group" do - title 'Testing the plural resource of azure_sql_managed_instances.' - desc 'Testing the plural resource of azure_sql_managed_instances.' + title "Testing the plural resource of azure_sql_managed_instances." + desc "Testing the plural resource of azure_sql_managed_instances." describe azure_sql_managed_instances(resource_group: resource_group) do it { should exist } - its('names') { should include sql_managed_instance_name } - its('sku_names') { should include 'GP_Gen5' } - its('locations') { should include location.downcase.gsub(' ', '') } - its('types') { should include 'Microsoft.Sql/managedInstances' } - its('provisioningStates') { should include 'Succeeded' } + its("names") { should include sql_managed_instance_name } + its("sku_names") { should include "GP_Gen5" } + its("locations") { should include location.downcase.gsub(" ", "") } + its("types") { should include "Microsoft.Sql/managedInstances" } + its("provisioningStates") { should include "Succeeded" } end end diff --git a/test/integration/verify/controls/azure_sql_virtual_machine.rb b/test/integration/verify/controls/azure_sql_virtual_machine.rb index ffc35d5a2..121e66275 100644 --- a/test/integration/verify/controls/azure_sql_virtual_machine.rb +++ b/test/integration/verify/controls/azure_sql_virtual_machine.rb @@ -1,17 +1,17 @@ -rg = input(:resource_group, value: '') -sql_vm = input(:inspec_sql_virtual_machine, value: '') -location = input(:location, value: '') +rg = input(:resource_group, value: "") +sql_vm = input(:inspec_sql_virtual_machine, value: "") +location = input(:location, value: "") -control 'Verify settings of an Azure SQL Virtual Machine' do +control "Verify settings of an Azure SQL Virtual Machine" do - title 'Testing the singular resource of azure_sql_virtual_machine.' - desc 'Testing the singular resource of azure_sql_virtual_machine.' + title "Testing the singular resource of azure_sql_virtual_machine." + desc "Testing the singular resource of azure_sql_virtual_machine." describe azure_sql_virtual_machine(resource_group: rg, name: sql_vm) do it { should exist } - its('location') { should eq location.downcase.gsub("\s", '') } - its('properties.provisioningState') { should eq 'Succeeded' } - its('properties.sqlImageSku') { should eq 'Enterprise' } - its('properties.sqlServerLicenseType') { should eq 'PAYG' } + its("location") { should eq location.downcase.gsub("\s", "") } + its("properties.provisioningState") { should eq "Succeeded" } + its("properties.sqlImageSku") { should eq "Enterprise" } + its("properties.sqlServerLicenseType") { should eq "PAYG" } end end diff --git a/test/integration/verify/controls/azure_sql_virtual_machine_group.rb b/test/integration/verify/controls/azure_sql_virtual_machine_group.rb index dd3a91f5b..65116f258 100644 --- a/test/integration/verify/controls/azure_sql_virtual_machine_group.rb +++ b/test/integration/verify/controls/azure_sql_virtual_machine_group.rb @@ -1,17 +1,17 @@ -location = input(:location, value: '') -rg = input(:resource_group, value: '') +location = input(:location, value: "") +rg = input(:resource_group, value: "") -control 'test the properties of an Azure SQL Virtual Machine Group' do +control "test the properties of an Azure SQL Virtual Machine Group" do - title 'Testing the singular resource of azure_sql_virtual_machine_group.' - desc 'Testing the singular resource of azure_sql_virtual_machine_group.' + title "Testing the singular resource of azure_sql_virtual_machine_group." + desc "Testing the singular resource of azure_sql_virtual_machine_group." - describe azure_sql_virtual_machine_group(resource_group: rg, name: 'inspec-sql-vm-group') do + describe azure_sql_virtual_machine_group(resource_group: rg, name: "inspec-sql-vm-group") do it { should exist } - its('name') { should eq 'inspec-sql-vm-group' } - its('properties.sqlImageSku') { should eq 'Enterprise' } - its('location') { should eq location.downcase.gsub("\s", '') } - its('properties.wsfcDomainProfile.domainFqdn') { should eq 'testdomain.com' } - its('properties.provisioningState') { should eq 'Succeeded' } + its("name") { should eq "inspec-sql-vm-group" } + its("properties.sqlImageSku") { should eq "Enterprise" } + its("location") { should eq location.downcase.gsub("\s", "") } + its("properties.wsfcDomainProfile.domainFqdn") { should eq "testdomain.com" } + its("properties.provisioningState") { should eq "Succeeded" } end end diff --git a/test/integration/verify/controls/azure_sql_virtual_machine_group_availability_listener.rb b/test/integration/verify/controls/azure_sql_virtual_machine_group_availability_listener.rb index 3dafa501b..4debfa01f 100644 --- a/test/integration/verify/controls/azure_sql_virtual_machine_group_availability_listener.rb +++ b/test/integration/verify/controls/azure_sql_virtual_machine_group_availability_listener.rb @@ -1,13 +1,13 @@ -rg = input(:resource_group, value: '') +rg = input(:resource_group, value: "") -control 'Verify the settings of an SQL VM Availability listener' do +control "Verify the settings of an SQL VM Availability listener" do - title 'Testing the singular resource of azure_sql_virtual_machine_group_availability_listener.' - desc 'Testing the singular resource of azure_sql_virtual_machine_group_availability_listener.' + title "Testing the singular resource of azure_sql_virtual_machine_group_availability_listener." + desc "Testing the singular resource of azure_sql_virtual_machine_group_availability_listener." - describe azure_sql_virtual_machine_group_availability_listener(resource_group: rg, sql_virtual_machine_group_name: 'inspec-sql-vm-group', name: 'inspec-avl') do + describe azure_sql_virtual_machine_group_availability_listener(resource_group: rg, sql_virtual_machine_group_name: "inspec-sql-vm-group", name: "inspec-avl") do it { should exist } - its('type') { should eq 'Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/availabilityGroupListeners' } - its('properties.provisioningState') { should eq ' Succeeded' } + its("type") { should eq "Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/availabilityGroupListeners" } + its("properties.provisioningState") { should eq " Succeeded" } end end diff --git a/test/integration/verify/controls/azure_sql_virtual_machine_group_availability_listeners.rb b/test/integration/verify/controls/azure_sql_virtual_machine_group_availability_listeners.rb index 2905390ca..af5ddb878 100644 --- a/test/integration/verify/controls/azure_sql_virtual_machine_group_availability_listeners.rb +++ b/test/integration/verify/controls/azure_sql_virtual_machine_group_availability_listeners.rb @@ -1,13 +1,13 @@ -rg = input(:resource_group, value: '') +rg = input(:resource_group, value: "") -control 'Verify the settings of a collection of all SQL VM Availability listeners' do +control "Verify the settings of a collection of all SQL VM Availability listeners" do - title 'Testing the plural resource of azure_sql_virtual_machine_group_availability_listeners.' - desc 'Testing the plural resource of azure_sql_virtual_machine_group_availability_listeners.' + title "Testing the plural resource of azure_sql_virtual_machine_group_availability_listeners." + desc "Testing the plural resource of azure_sql_virtual_machine_group_availability_listeners." - describe azure_sql_virtual_machine_group_availability_listeners(resource_group: rg, sql_virtual_machine_group_name: 'inspec-sql-vm-group') do + describe azure_sql_virtual_machine_group_availability_listeners(resource_group: rg, sql_virtual_machine_group_name: "inspec-sql-vm-group") do it { should exist } - its('types') { should include 'Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/availabilityGroupListeners' } - its('provisioningStates') { should include ' Succeeded' } + its("types") { should include "Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/availabilityGroupListeners" } + its("provisioningStates") { should include " Succeeded" } end end diff --git a/test/integration/verify/controls/azure_sql_virtual_machine_groups.rb b/test/integration/verify/controls/azure_sql_virtual_machine_groups.rb index 16e950677..3ffa1472b 100644 --- a/test/integration/verify/controls/azure_sql_virtual_machine_groups.rb +++ b/test/integration/verify/controls/azure_sql_virtual_machine_groups.rb @@ -1,16 +1,16 @@ -location = input(:location, value: '') +location = input(:location, value: "") -control 'test the properties of all Azure SQL Virtual Machine Groups' do +control "test the properties of all Azure SQL Virtual Machine Groups" do - title 'Testing the plural resource of azure_sql_virtual_machine_groups.' - desc 'Testing the plural resource of azure_sql_virtual_machine_groups.' + title "Testing the plural resource of azure_sql_virtual_machine_groups." + desc "Testing the plural resource of azure_sql_virtual_machine_groups." describe azure_sql_virtual_machine_groups do it { should exist } - its('names') { should include 'inspec-sql-vm-group' } - its('sqlImageSkus') { should include 'Enterprise' } - its('locations') { should include location.downcase.gsub("\s", '') } - its('domainFqdns') { should include 'testdomain.com' } - its('provisioningStates') { should include 'Succeeded' } + its("names") { should include "inspec-sql-vm-group" } + its("sqlImageSkus") { should include "Enterprise" } + its("locations") { should include location.downcase.gsub("\s", "") } + its("domainFqdns") { should include "testdomain.com" } + its("provisioningStates") { should include "Succeeded" } end end diff --git a/test/integration/verify/controls/azure_sql_virtual_machines.rb b/test/integration/verify/controls/azure_sql_virtual_machines.rb index 118912cdf..8ed766b88 100644 --- a/test/integration/verify/controls/azure_sql_virtual_machines.rb +++ b/test/integration/verify/controls/azure_sql_virtual_machines.rb @@ -1,17 +1,17 @@ -sql_vm = input(:inspec_sql_virtual_machine, value: '') -location = input(:location, value: '') +sql_vm = input(:inspec_sql_virtual_machine, value: "") +location = input(:location, value: "") -control 'Verify settings of all Azure SQL Virtual Machines' do +control "Verify settings of all Azure SQL Virtual Machines" do - title 'Testing the plural resource of azure_sql_virtual_machines.' - desc 'Testing the plural resource of azure_sql_virtual_machines.' + title "Testing the plural resource of azure_sql_virtual_machines." + desc "Testing the plural resource of azure_sql_virtual_machines." describe azure_sql_virtual_machines do it { should exist } - its('names') { should include sql_vm } - its('location') { should include location.downcase.gsub("\s", '') } - its('provisioningStates') { should include 'Succeeded' } - its('sqlImageSkus') { should include 'Enterprise' } - its('sqlServerLicenseTypes') { should include 'PAYG' } + its("names") { should include sql_vm } + its("location") { should include location.downcase.gsub("\s", "") } + its("provisioningStates") { should include "Succeeded" } + its("sqlImageSkus") { should include "Enterprise" } + its("sqlServerLicenseTypes") { should include "PAYG" } end end diff --git a/test/integration/verify/controls/azure_storage_account.rb b/test/integration/verify/controls/azure_storage_account.rb index 85bbe1709..781f66941 100644 --- a/test/integration/verify/controls/azure_storage_account.rb +++ b/test/integration/verify/controls/azure_storage_account.rb @@ -1,16 +1,16 @@ -resource_group = input('resource_group', value: nil) -storage_account = input('storage_account', value: nil) +resource_group = input("resource_group", value: nil) +storage_account = input("storage_account", value: nil) -control 'azure_storage_account' do +control "azure_storage_account" do - title 'Testing the singular resource of azure_storage_account.' - desc 'Testing the singular resource of azure_storage_account.' + title "Testing the singular resource of azure_storage_account." + desc "Testing the singular resource of azure_storage_account." describe azure_storage_account(resource_group: resource_group, name: storage_account) do it { should exist } it { should have_encryption_enabled } it { should_not have_recently_generated_access_key } - its('properties') { should have_attributes(supportsHttpsTrafficOnly: true) } - its('queues.enumeration_results.service_endpoint') { should include(storage_account) } + its("properties") { should have_attributes(supportsHttpsTrafficOnly: true) } + its("queues.enumeration_results.service_endpoint") { should include(storage_account) } end end diff --git a/test/integration/verify/controls/azure_storage_accounts.rb b/test/integration/verify/controls/azure_storage_accounts.rb index 8ea2673d1..a6df3537b 100644 --- a/test/integration/verify/controls/azure_storage_accounts.rb +++ b/test/integration/verify/controls/azure_storage_accounts.rb @@ -1,19 +1,19 @@ -resource_group = input('resource_group', value: nil) -storage_account = input('storage_account', value: nil) -location = input('vnet_location', value: nil) +resource_group = input("resource_group", value: nil) +storage_account = input("storage_account", value: nil) +location = input("vnet_location", value: nil) -control 'azure_storage_accounts' do +control "azure_storage_accounts" do - title 'Testing the plural resource of azure_storage_accounts.' - desc 'Testing the plural resource of azure_storage_accounts.' + title "Testing the plural resource of azure_storage_accounts." + desc "Testing the plural resource of azure_storage_accounts." describe azure_storage_accounts do - its('names') { should include(storage_account) } - its('location') { should include(location) } + its("names") { should include(storage_account) } + its("location") { should include(location) } end describe azure_storage_accounts(resource_group: resource_group) do - its('names') { should include(storage_account) } - its('location') { should include(location) } + its("names") { should include(storage_account) } + its("location") { should include(location) } end end diff --git a/test/integration/verify/controls/azure_streaming_analytics_function_test.rb b/test/integration/verify/controls/azure_streaming_analytics_function_test.rb index f036b5a16..fd321006c 100644 --- a/test/integration/verify/controls/azure_streaming_analytics_function_test.rb +++ b/test/integration/verify/controls/azure_streaming_analytics_function_test.rb @@ -1,17 +1,17 @@ -resource_group = input('resource_group', value: nil) -azure_streaming_job_name = input('azure_streaming_job_name', value: nil) -azure_streaming_job_function_name = input('azure_streaming_job_function_name', value: nil) +resource_group = input("resource_group", value: nil) +azure_streaming_job_name = input("azure_streaming_job_name", value: nil) +azure_streaming_job_function_name = input("azure_streaming_job_function_name", value: nil) -control 'azure_streaming_analytics_function' do +control "azure_streaming_analytics_function" do - title 'Testing the singular resource of azure_streaming_analytics_function.' - desc 'Testing the singular resource of azure_streaming_analytics_function.' + title "Testing the singular resource of azure_streaming_analytics_function." + desc "Testing the singular resource of azure_streaming_analytics_function." describe azure_streaming_analytics_function(resource_group: resource_group, job_name: azure_streaming_job_name, function_name: azure_streaming_job_function_name) do it { should exist } # The test itself. - its('name') { should cmp azure_streaming_job_function_name } - its('type') { should cmp 'Microsoft.StreamAnalytics/streamingjobs/functions' } - its('properties.type') { should cmp 'Scalar' } - its('properties.properties.output.dataType') { should cmp 'bigint' } + its("name") { should cmp azure_streaming_job_function_name } + its("type") { should cmp "Microsoft.StreamAnalytics/streamingjobs/functions" } + its("properties.type") { should cmp "Scalar" } + its("properties.properties.output.dataType") { should cmp "bigint" } end end diff --git a/test/integration/verify/controls/azure_streaming_analytics_functions_test.rb b/test/integration/verify/controls/azure_streaming_analytics_functions_test.rb index 89622d285..5358b76f1 100644 --- a/test/integration/verify/controls/azure_streaming_analytics_functions_test.rb +++ b/test/integration/verify/controls/azure_streaming_analytics_functions_test.rb @@ -1,13 +1,13 @@ -resource_group = input('resource_group', value: nil) -azure_streaming_job_name = input('azure_streaming_job_name', value: nil) +resource_group = input("resource_group", value: nil) +azure_streaming_job_name = input("azure_streaming_job_name", value: nil) -control 'azure_streaming_analytics_functions' do +control "azure_streaming_analytics_functions" do - title 'Testing the plural resource of azure_streaming_analytics_functions.' - desc 'Testing the plural resource of azure_streaming_analytics_functions.' + title "Testing the plural resource of azure_streaming_analytics_functions." + desc "Testing the plural resource of azure_streaming_analytics_functions." describe azure_streaming_analytics_functions(resource_group: resource_group, job_name: azure_streaming_job_name) do it { should exist } # The test itself. - its('names') { should be_an(Array) } + its("names") { should be_an(Array) } end end diff --git a/test/integration/verify/controls/azure_subscriptions.rb b/test/integration/verify/controls/azure_subscriptions.rb index f849541f2..1d04bbc9e 100644 --- a/test/integration/verify/controls/azure_subscriptions.rb +++ b/test/integration/verify/controls/azure_subscriptions.rb @@ -1,12 +1,12 @@ -control 'azure_subscriptions' do +control "azure_subscriptions" do - title 'Testing the plural resource of azure_subscriptions.' - desc 'Testing the plural resource of azure_subscriptions.' + title "Testing the plural resource of azure_subscriptions." + desc "Testing the plural resource of azure_subscriptions." subscription_name = azure_subscription.name describe azure_subscriptions do - its('names') { should include(subscription_name) } + its("names") { should include(subscription_name) } end azure_subscriptions.ids.each do |id| diff --git a/test/integration/verify/controls/azure_synapse_notebook.rb b/test/integration/verify/controls/azure_synapse_notebook.rb index 50d081698..0bde72c66 100644 --- a/test/integration/verify/controls/azure_synapse_notebook.rb +++ b/test/integration/verify/controls/azure_synapse_notebook.rb @@ -1,16 +1,16 @@ -endpoint = 'https://inspec-workspace.dev.azuresynapse.net' -notebook = 'inspec-notebook' +endpoint = "https://inspec-workspace.dev.azuresynapse.net" +notebook = "inspec-notebook" -control 'verifies settings of the azure synapse notebooks' do +control "verifies settings of the azure synapse notebooks" do - title 'Testing the singular resource of azure_streaming_analytics_function.' - desc 'Testing the singular resource of azure_streaming_analytics_function.' + title "Testing the singular resource of azure_streaming_analytics_function." + desc "Testing the singular resource of azure_streaming_analytics_function." describe azure_synapse_notebook(endpoint: endpoint, name: notebook) do it { should exist } - its('name') { should eq notebook } - its('type') { should eq 'Microsoft.Synapse/workspaces/notebooks' } - its('properties.sessionProperties.executorCores') { should eq 4 } - its('properties.metadata.a365ComputeOptions.sparkVersion') { should eq '2.4' } + its("name") { should eq notebook } + its("type") { should eq "Microsoft.Synapse/workspaces/notebooks" } + its("properties.sessionProperties.executorCores") { should eq 4 } + its("properties.metadata.a365ComputeOptions.sparkVersion") { should eq "2.4" } end end diff --git a/test/integration/verify/controls/azure_synapse_notebooks.rb b/test/integration/verify/controls/azure_synapse_notebooks.rb index 0bd423512..8e382d72e 100644 --- a/test/integration/verify/controls/azure_synapse_notebooks.rb +++ b/test/integration/verify/controls/azure_synapse_notebooks.rb @@ -1,15 +1,15 @@ -endpoint = 'https://inspec-workspace.dev.azuresynapse.net' -notebook = 'inspec-notebook' +endpoint = "https://inspec-workspace.dev.azuresynapse.net" +notebook = "inspec-notebook" -control 'verifies settings of all azure synapse notebooks' do +control "verifies settings of all azure synapse notebooks" do - title 'Testing the plural resource of azure_synapse_notebooks.' - desc 'Testing the plural resource of azure_synapse_notebooks.' + title "Testing the plural resource of azure_synapse_notebooks." + desc "Testing the plural resource of azure_synapse_notebooks." describe azure_synapse_notebooks(endpoint: endpoint) do it { should exist } - its('names') { should include notebook } - its('types') { should include 'Microsoft.Synapse/workspaces/notebooks' } - its('properties') { should_not be_empty } + its("names") { should include notebook } + its("types") { should include "Microsoft.Synapse/workspaces/notebooks" } + its("properties") { should_not be_empty } end end diff --git a/test/integration/verify/controls/azure_synapse_workspace.rb b/test/integration/verify/controls/azure_synapse_workspace.rb index 95a34430f..eb9ebdad5 100644 --- a/test/integration/verify/controls/azure_synapse_workspace.rb +++ b/test/integration/verify/controls/azure_synapse_workspace.rb @@ -1,14 +1,14 @@ -resource_group = input(:resource_group, value: '') -location = input(:location, value: '') -synapse_ws_name = input(:synapse_inspec_ws_name, value: '') +resource_group = input(:resource_group, value: "") +location = input(:location, value: "") +synapse_ws_name = input(:synapse_inspec_ws_name, value: "") -control 'Verify settings of all Azure Synapse Workspaces' do +control "Verify settings of all Azure Synapse Workspaces" do describe azure_synapse_workspace(resource_group: resource_group, name: synapse_ws_name) do it { should exist } - its('name') { should eq synapse_ws_name } - its('location') { should eq location.downcase.gsub("\s", '') } - its('properties.provisioningState') { should eq 'Succeeded' } - its('properties.managedResourceGroupName') { should eq resource_group } - its('properties.sqlAdministratorLogin') { should eq 'login' } + its("name") { should eq synapse_ws_name } + its("location") { should eq location.downcase.gsub("\s", "") } + its("properties.provisioningState") { should eq "Succeeded" } + its("properties.managedResourceGroupName") { should eq resource_group } + its("properties.sqlAdministratorLogin") { should eq "login" } end end diff --git a/test/integration/verify/controls/azure_synapse_workspaces.rb b/test/integration/verify/controls/azure_synapse_workspaces.rb index 0524a3f40..cc621c12d 100644 --- a/test/integration/verify/controls/azure_synapse_workspaces.rb +++ b/test/integration/verify/controls/azure_synapse_workspaces.rb @@ -1,14 +1,14 @@ -resource_group = input(:resource_group, value: '') -location = input(:location, value: '') -synapse_ws_name = input(:synapse_inspec_ws_name, value: '') +resource_group = input(:resource_group, value: "") +location = input(:location, value: "") +synapse_ws_name = input(:synapse_inspec_ws_name, value: "") -control 'Verify settings of all Azure Synapse Workspaces' do +control "Verify settings of all Azure Synapse Workspaces" do describe azure_synapse_workspaces do it { should exist } - its('names') { should include synapse_ws_name } - its('locations') { should include location.downcase.gsub("\s", '') } - its('provisioningStates') { should include 'Succeeded' } - its('managedResourceGroupNames') { should include resource_group } - its('sqlAdministratorLogins') { should include 'login' } + its("names") { should include synapse_ws_name } + its("locations") { should include location.downcase.gsub("\s", "") } + its("provisioningStates") { should include "Succeeded" } + its("managedResourceGroupNames") { should include resource_group } + its("sqlAdministratorLogins") { should include "login" } end end diff --git a/test/integration/verify/controls/azure_virtual_network_gateway.rb b/test/integration/verify/controls/azure_virtual_network_gateway.rb index a4f1c1611..f0ab58396 100644 --- a/test/integration/verify/controls/azure_virtual_network_gateway.rb +++ b/test/integration/verify/controls/azure_virtual_network_gateway.rb @@ -1,17 +1,17 @@ -rg = input(:resource_group, value: '') -name = input(:inspec_vnw_gateway_name, value: '') +rg = input(:resource_group, value: "") +name = input(:inspec_vnw_gateway_name, value: "") -control 'Verify settings of an Azure Virtual Network Gateway' do +control "Verify settings of an Azure Virtual Network Gateway" do - title 'Testing the singular resource of azure_streaming_analytics_function.' - desc 'Testing the singular resource of azure_streaming_analytics_function.' + title "Testing the singular resource of azure_streaming_analytics_function." + desc "Testing the singular resource of azure_streaming_analytics_function." describe azure_virtual_network_gateway(resource_group: rg, name: name) do it { should exist } - its('vpnClientConfiguration.vpnClientProtocols') { should include 'SSTP' } - its('location') { should eq 'eastus' } - its('provisioningState') { should eq 'Succeeded' } - its('type') { should eq 'Microsoft.Network/virtualNetworkGateways' } - its('gatewayType') { should eq 'Vpn' } + its("vpnClientConfiguration.vpnClientProtocols") { should include "SSTP" } + its("location") { should eq "eastus" } + its("provisioningState") { should eq "Succeeded" } + its("type") { should eq "Microsoft.Network/virtualNetworkGateways" } + its("gatewayType") { should eq "Vpn" } end end diff --git a/test/integration/verify/controls/azure_virtual_network_gateway_connection.rb b/test/integration/verify/controls/azure_virtual_network_gateway_connection.rb index 49835b5fc..9b23d9c12 100644 --- a/test/integration/verify/controls/azure_virtual_network_gateway_connection.rb +++ b/test/integration/verify/controls/azure_virtual_network_gateway_connection.rb @@ -1,19 +1,19 @@ -rg = input(:resource_group, value: '') -location = input(:location, value: '') -name = input(:vnw_gateway_connection, value: '') +rg = input(:resource_group, value: "") +location = input(:location, value: "") +name = input(:vnw_gateway_connection, value: "") -control 'Verify settings of an Azure Virtual Network Gateway Connection' do +control "Verify settings of an Azure Virtual Network Gateway Connection" do - title 'Testing the singular resource of azure_streaming_analytics_function.' - desc 'Testing the singular resource of azure_streaming_analytics_function.' + title "Testing the singular resource of azure_streaming_analytics_function." + desc "Testing the singular resource of azure_streaming_analytics_function." describe azure_virtual_network_gateway_connection(resource_group: rg, name: name) do it { should exist } - its('name') { should eq 'test' } - its('location') { should eq location } - its('provisioningState') { should eq 'Succeeded' } - its('connectionType') { should eq 'Vnet2Vnet' } - its('connectionProtocol') { should eq 'IKEv2' } - its('ipsecPolicies.first.ikeEncryption') { should eq 'AES128' } + its("name") { should eq "test" } + its("location") { should eq location } + its("provisioningState") { should eq "Succeeded" } + its("connectionType") { should eq "Vnet2Vnet" } + its("connectionProtocol") { should eq "IKEv2" } + its("ipsecPolicies.first.ikeEncryption") { should eq "AES128" } end end diff --git a/test/integration/verify/controls/azure_virtual_network_gateway_connections.rb b/test/integration/verify/controls/azure_virtual_network_gateway_connections.rb index 42e6f997f..39bd88d3f 100644 --- a/test/integration/verify/controls/azure_virtual_network_gateway_connections.rb +++ b/test/integration/verify/controls/azure_virtual_network_gateway_connections.rb @@ -1,18 +1,18 @@ -rg = input(:resource_group, value: '') -location = input(:location, value: '') +rg = input(:resource_group, value: "") +location = input(:location, value: "") -control 'Verify settings of all Azure Virtual Network Gateway Connections' do +control "Verify settings of all Azure Virtual Network Gateway Connections" do - title 'Testing the plural resource of azure_virtual_network_gateway_connections.' - desc 'Testing the plural resource of azure_virtual_network_gateway_connections.' + title "Testing the plural resource of azure_virtual_network_gateway_connections." + desc "Testing the plural resource of azure_virtual_network_gateway_connections." describe azure_virtual_network_gateway_connections(resource_group: rg) do it { should exist } - its('names') { should include 'test' } - its('locations') { should include location } - its('provisioningStates') { should include 'Succeeded' } - its('connectionTypes') { should include 'Vnet2Vnet' } - its('connectionProtocols') { should include 'IKEv2' } - its('ipsecPolicies') { should_not be_empty } + its("names") { should include "test" } + its("locations") { should include location } + its("provisioningStates") { should include "Succeeded" } + its("connectionTypes") { should include "Vnet2Vnet" } + its("connectionProtocols") { should include "IKEv2" } + its("ipsecPolicies") { should_not be_empty } end end diff --git a/test/integration/verify/controls/azure_virtual_wan.rb b/test/integration/verify/controls/azure_virtual_wan.rb index af283d911..1754930b0 100644 --- a/test/integration/verify/controls/azure_virtual_wan.rb +++ b/test/integration/verify/controls/azure_virtual_wan.rb @@ -1,18 +1,18 @@ -resource_group = input(:resource_group, value: '') -wan_name = input(:inspec_virtual_wan, value: '') -location = input(:location, value: '')&.downcase&.gsub(' ', '') +resource_group = input(:resource_group, value: "") +wan_name = input(:inspec_virtual_wan, value: "") +location = input(:location, value: "")&.downcase&.gsub(" ", "") -control 'verifies settings of an individual azure virtual WAN' do +control "verifies settings of an individual azure virtual WAN" do - title 'Testing the singular resource of azure_streaming_analytics_function.' - desc 'Testing the singular resource of azure_streaming_analytics_function.' + title "Testing the singular resource of azure_streaming_analytics_function." + desc "Testing the singular resource of azure_streaming_analytics_function." describe azure_virtual_wan(resource_group: resource_group, name: wan_name) do it { should exist } - its('name') { should include wan_name } - its('type') { should eq 'Microsoft.Network/virtualWans' } - its('location') { should eq location } - its('properties.type') { should eq 'Standard' } - its('properties.provisioningState') { should eq 'Succeeded' } + its("name") { should include wan_name } + its("type") { should eq "Microsoft.Network/virtualWans" } + its("location") { should eq location } + its("properties.type") { should eq "Standard" } + its("properties.provisioningState") { should eq "Succeeded" } end end diff --git a/test/integration/verify/controls/azure_virtual_wans.rb b/test/integration/verify/controls/azure_virtual_wans.rb index 9484dfb1d..37e18ff20 100644 --- a/test/integration/verify/controls/azure_virtual_wans.rb +++ b/test/integration/verify/controls/azure_virtual_wans.rb @@ -1,15 +1,15 @@ -wan_name = input(:inspec_virtual_wan, value: '') -location = input(:location, value: '')&.downcase&.gsub(' ', '') +wan_name = input(:inspec_virtual_wan, value: "") +location = input(:location, value: "")&.downcase&.gsub(" ", "") -control 'verifies settings of azure virtual WANs' do +control "verifies settings of azure virtual WANs" do - title 'Testing the plural resource of azure_virtual_wans.' - desc 'Testing the plural resource of azure_virtual_wans.' + title "Testing the plural resource of azure_virtual_wans." + desc "Testing the plural resource of azure_virtual_wans." describe azure_virtual_wans do it { should exist } - its('names') { should include wan_name } - its('types') { should include 'Microsoft.Network/virtualWans' } - its('locations') { should include location } + its("names") { should include wan_name } + its("types") { should include "Microsoft.Network/virtualWans" } + its("locations") { should include location } end end diff --git a/test/integration/verify/controls/azure_web_app_function.rb b/test/integration/verify/controls/azure_web_app_function.rb index 88c234e29..dd1f23fda 100644 --- a/test/integration/verify/controls/azure_web_app_function.rb +++ b/test/integration/verify/controls/azure_web_app_function.rb @@ -1,17 +1,17 @@ -resource_group = input('resource_group', value: nil) -site_name = input('web_app_function_app_name', value: nil) -function_name = input('web_app_function_name', value: nil) +resource_group = input("resource_group", value: nil) +site_name = input("web_app_function_app_name", value: nil) +function_name = input("web_app_function_name", value: nil) -control 'azure_web_app_function' do +control "azure_web_app_function" do - title 'Testing the singular resource of azure_streaming_analytics_function.' - desc 'Testing the singular resource of azure_streaming_analytics_function.' + title "Testing the singular resource of azure_streaming_analytics_function." + desc "Testing the singular resource of azure_streaming_analytics_function." describe azure_web_app_function(resource_group: resource_group, site_name: site_name, function_name: function_name) do it { should exist } # The test itself. - its('name') { should cmp "#{site_name}/#{function_name}" } - its('type') { should cmp 'Microsoft.Web/sites/functions' } - its('properties.name') { should cmp function_name } - its('properties.language') { should cmp 'Javascript' } + its("name") { should cmp "#{site_name}/#{function_name}" } + its("type") { should cmp "Microsoft.Web/sites/functions" } + its("properties.name") { should cmp function_name } + its("properties.language") { should cmp "Javascript" } end end diff --git a/test/integration/verify/controls/azure_web_app_functions.rb b/test/integration/verify/controls/azure_web_app_functions.rb index 7a971e6e9..c65f93baf 100644 --- a/test/integration/verify/controls/azure_web_app_functions.rb +++ b/test/integration/verify/controls/azure_web_app_functions.rb @@ -1,15 +1,15 @@ -resource_group = input('resource_group', value: nil) -site_name = input('web_app_function_app_name', value: nil) -function_name = input('web_app_function_name', value: nil) +resource_group = input("resource_group", value: nil) +site_name = input("web_app_function_app_name", value: nil) +function_name = input("web_app_function_name", value: nil) -control 'azure_web_app_functions' do +control "azure_web_app_functions" do - title 'Testing the plural resource of azure_web_app_functions.' - desc 'Testing the plural resource of azure_web_app_functions.' + title "Testing the plural resource of azure_web_app_functions." + desc "Testing the plural resource of azure_web_app_functions." describe azure_web_app_functions(resource_group: resource_group, site_name: site_name) do it { should exist } - its('names') { should be_an(Array) } - its('names') { should include("#{site_name}/#{function_name}") } + its("names") { should be_an(Array) } + its("names") { should include("#{site_name}/#{function_name}") } end end diff --git a/test/integration/verify/controls/azurerm_ad_user.rb b/test/integration/verify/controls/azurerm_ad_user.rb index 4eefaf44b..06aff9e14 100644 --- a/test/integration/verify/controls/azurerm_ad_user.rb +++ b/test/integration/verify/controls/azurerm_ad_user.rb @@ -1,14 +1,14 @@ -control 'azurerm_ad_user' do +control "azurerm_ad_user" do - title 'Testing the singular resource of azurerm_ad_user.' - desc 'Testing the singular resource of azurerm_ad_user.' + title "Testing the singular resource of azurerm_ad_user." + desc "Testing the singular resource of azurerm_ad_user." user_id = azurerm_ad_users.object_ids.first describe azurerm_ad_user(user_id: user_id) do it { should exist } - its('objectId') { should eq user_id } - its('displayName') { should_not be_nil } - its('userType') { should_not be_nil } - its('accountEnabled') { should_not be_nil } + its("objectId") { should eq user_id } + its("displayName") { should_not be_nil } + its("userType") { should_not be_nil } + its("accountEnabled") { should_not be_nil } end end diff --git a/test/integration/verify/controls/azurerm_ad_users.rb b/test/integration/verify/controls/azurerm_ad_users.rb index 593b159d0..37d6cbce0 100644 --- a/test/integration/verify/controls/azurerm_ad_users.rb +++ b/test/integration/verify/controls/azurerm_ad_users.rb @@ -1,11 +1,11 @@ -control 'azurerm_ad_users' do +control "azurerm_ad_users" do - title 'Testing the plural resource of azurerm_ad_users.' - desc 'Testing the plural resource of azurerm_ad_users.' + title "Testing the plural resource of azurerm_ad_users." + desc "Testing the plural resource of azurerm_ad_users." describe azurerm_ad_users do - its('display_names') { should_not be_empty } - its('user_types') { should_not be_empty } - its('mails') { should_not be_empty } + its("display_names") { should_not be_empty } + its("user_types") { should_not be_empty } + its("mails") { should_not be_empty } end end diff --git a/test/integration/verify/controls/azurerm_aks_cluster.rb b/test/integration/verify/controls/azurerm_aks_cluster.rb index b96371465..a22a7e1e3 100644 --- a/test/integration/verify/controls/azurerm_aks_cluster.rb +++ b/test/integration/verify/controls/azurerm_aks_cluster.rb @@ -1,32 +1,32 @@ -resource_group = input('resource_group', value: nil) -cluster_fqdn = input('cluster_fqdn', value: nil) +resource_group = input("resource_group", value: nil) +cluster_fqdn = input("cluster_fqdn", value: nil) -control 'azurerm_aks_cluster' do +control "azurerm_aks_cluster" do - title 'Testing the singular resource of azurerm_aks_cluster.' - desc 'Testing the singular resource of azurerm_aks_cluster.' + title "Testing the singular resource of azurerm_aks_cluster." + desc "Testing the singular resource of azurerm_aks_cluster." - describe azurerm_aks_cluster(resource_group: resource_group, name: 'inspecakstest', api_version: '2018-03-31') do + describe azurerm_aks_cluster(resource_group: resource_group, name: "inspecakstest", api_version: "2018-03-31") do it { should exist } - its('name') { should cmp 'inspecakstest' } - its('type') { should cmp 'Microsoft.ContainerService/managedClusters' } - its('properties.provisioningState') { should cmp 'Succeeded' } - its('properties.dnsPrefix') { should cmp 'inspecaksagent1' } - its('properties.fqdn') { should cmp cluster_fqdn } - its('properties.agentPoolProfiles.first.name') { should cmp 'inspecaks' } - its('properties.agentPoolProfiles.first.count') { should cmp '2' } - its('properties.agentPoolProfiles.first.vmSize') { should cmp 'Standard_DS1_v2' } - its('properties.agentPoolProfiles.first.storageProfile') { should cmp 'ManagedDisks' } - its('properties.agentPoolProfiles.first.maxPods') { should cmp '110' } - its('properties.agentPoolProfiles.first.osType') { should cmp 'Linux' } - its('properties.kubernetesVersion') { should_not be nil } + its("name") { should cmp "inspecakstest" } + its("type") { should cmp "Microsoft.ContainerService/managedClusters" } + its("properties.provisioningState") { should cmp "Succeeded" } + its("properties.dnsPrefix") { should cmp "inspecaksagent1" } + its("properties.fqdn") { should cmp cluster_fqdn } + its("properties.agentPoolProfiles.first.name") { should cmp "inspecaks" } + its("properties.agentPoolProfiles.first.count") { should cmp "2" } + its("properties.agentPoolProfiles.first.vmSize") { should cmp "Standard_DS1_v2" } + its("properties.agentPoolProfiles.first.storageProfile") { should cmp "ManagedDisks" } + its("properties.agentPoolProfiles.first.maxPods") { should cmp "110" } + its("properties.agentPoolProfiles.first.osType") { should cmp "Linux" } + its("properties.kubernetesVersion") { should_not be nil } end - describe azurerm_aks_cluster(resource_group: resource_group, name: 'fake') do + describe azurerm_aks_cluster(resource_group: resource_group, name: "fake") do it { should_not exist } end - describe azurerm_aks_cluster(resource_group: 'does-not-exist', name: 'fake') do + describe azurerm_aks_cluster(resource_group: "does-not-exist", name: "fake") do it { should_not exist } end end diff --git a/test/integration/verify/controls/azurerm_aks_clusters.rb b/test/integration/verify/controls/azurerm_aks_clusters.rb index b55483c8d..a5f995a1e 100644 --- a/test/integration/verify/controls/azurerm_aks_clusters.rb +++ b/test/integration/verify/controls/azurerm_aks_clusters.rb @@ -1,12 +1,12 @@ -resource_group = input('resource_group', value: nil) +resource_group = input("resource_group", value: nil) -control 'azurerm_aks_clusters' do +control "azurerm_aks_clusters" do - title 'Testing the plural resource of azurerm_aks_clusters.' - desc 'Testing the plural resource of azurerm_aks_clusters.' + title "Testing the plural resource of azurerm_aks_clusters." + desc "Testing the plural resource of azurerm_aks_clusters." - describe azurerm_aks_clusters(resource_group: resource_group, api_version: '2018-03-31') do + describe azurerm_aks_clusters(resource_group: resource_group, api_version: "2018-03-31") do it { should exist } - its('names') { should be_an(Array) } + its("names") { should be_an(Array) } end end diff --git a/test/integration/verify/controls/azurerm_api_management.rb b/test/integration/verify/controls/azurerm_api_management.rb index 4042cd5aa..4c59e5dd0 100644 --- a/test/integration/verify/controls/azurerm_api_management.rb +++ b/test/integration/verify/controls/azurerm_api_management.rb @@ -1,18 +1,18 @@ -resource_group = attribute('resource_group', value: nil) -api_management_name = attribute('api_management_name', value: '') +resource_group = attribute("resource_group", value: nil) +api_management_name = attribute("api_management_name", value: "") -control 'azurerm_api_management' do +control "azurerm_api_management" do - title 'Testing the singular resource of azurerm_api_management.' - desc 'Testing the singular resource of azurerm_api_management.' + title "Testing the singular resource of azurerm_api_management." + desc "Testing the singular resource of azurerm_api_management." only_if { !api_management_name.empty? } describe azurerm_api_management(resource_group: resource_group, api_management_name: api_management_name) do it { should exist } - its('id') { should_not be_nil } - its('name') { should eq api_management_name } - its('location') { should_not be_nil } - its('type') { should eq 'Microsoft.ApiManagement/service' } - its('properties.publisherEmail') { should eq 'company@inspec.io' } + its("id") { should_not be_nil } + its("name") { should eq api_management_name } + its("location") { should_not be_nil } + its("type") { should eq "Microsoft.ApiManagement/service" } + its("properties.publisherEmail") { should eq "company@inspec.io" } end end diff --git a/test/integration/verify/controls/azurerm_api_managements.rb b/test/integration/verify/controls/azurerm_api_managements.rb index 2d6217229..5e99dd877 100644 --- a/test/integration/verify/controls/azurerm_api_managements.rb +++ b/test/integration/verify/controls/azurerm_api_managements.rb @@ -1,19 +1,19 @@ -resource_group = attribute('resource_group', value: nil) -api_management_name = attribute('api_management_name', value: '') +resource_group = attribute("resource_group", value: nil) +api_management_name = attribute("api_management_name", value: "") -control 'azurerm_api_managements' do +control "azurerm_api_managements" do - title 'Testing the plural resource of azurerm_api_managements.' - desc 'Testing the plural resource of azurerm_api_managements.' + title "Testing the plural resource of azurerm_api_managements." + desc "Testing the plural resource of azurerm_api_managements." only_if { !api_management_name.empty? } describe azurerm_api_managements(resource_group: resource_group) do it { should exist } - its('names') { should include api_management_name } + its("names") { should include api_management_name } end describe azurerm_api_managements do it { should exist } - its('names') { should include api_management_name } + its("names") { should include api_management_name } end end diff --git a/test/integration/verify/controls/azurerm_application_gateway.rb b/test/integration/verify/controls/azurerm_application_gateway.rb index 012fceeec..bff68b0aa 100644 --- a/test/integration/verify/controls/azurerm_application_gateway.rb +++ b/test/integration/verify/controls/azurerm_application_gateway.rb @@ -1,17 +1,17 @@ -resource_group = attribute('resource_group', value: nil) -application_gateway_name = attribute('application_gateway_name', value: nil) +resource_group = attribute("resource_group", value: nil) +application_gateway_name = attribute("application_gateway_name", value: nil) -control 'azurerm_application_gateway' do +control "azurerm_application_gateway" do - title 'Testing the singular resource of azure_streaming_analytics_function.' - desc 'Testing the singular resource of azure_streaming_analytics_function.' + title "Testing the singular resource of azure_streaming_analytics_function." + desc "Testing the singular resource of azure_streaming_analytics_function." describe azurerm_application_gateway(resource_group: resource_group, application_gateway_name: application_gateway_name) do it { should exist } - its('id') { should_not be_nil } - its('name') { should eq application_gateway_name } - its('location') { should_not be_nil } - its('type') { should eq 'Microsoft.Network/applicationGateways' } - its('properties.sslPolicy.policyName') { should eq 'AppGwSslPolicy20170401S' } + its("id") { should_not be_nil } + its("name") { should eq application_gateway_name } + its("location") { should_not be_nil } + its("type") { should eq "Microsoft.Network/applicationGateways" } + its("properties.sslPolicy.policyName") { should eq "AppGwSslPolicy20170401S" } end end diff --git a/test/integration/verify/controls/azurerm_application_gateways.rb b/test/integration/verify/controls/azurerm_application_gateways.rb index 09c569ede..b334626f4 100644 --- a/test/integration/verify/controls/azurerm_application_gateways.rb +++ b/test/integration/verify/controls/azurerm_application_gateways.rb @@ -1,18 +1,18 @@ -resource_group = attribute('resource_group', value: nil) -application_gateway_name = attribute('application_gateway_name', value: nil) +resource_group = attribute("resource_group", value: nil) +application_gateway_name = attribute("application_gateway_name", value: nil) -control 'azurerm_application_gateways' do +control "azurerm_application_gateways" do - title 'Testing the plural resource of azurerm_application_gateways.' - desc 'Testing the plural resource of azurerm_application_gateways.' + title "Testing the plural resource of azurerm_application_gateways." + desc "Testing the plural resource of azurerm_application_gateways." describe azurerm_application_gateways(resource_group: resource_group) do it { should exist } - its('names') { should include application_gateway_name } + its("names") { should include application_gateway_name } end describe azurerm_application_gateways do it { should exist } - its('names') { should include application_gateway_name } + its("names") { should include application_gateway_name } end end diff --git a/test/integration/verify/controls/azurerm_cosmosdb_database_account.rb b/test/integration/verify/controls/azurerm_cosmosdb_database_account.rb index 32d683382..a4530118d 100644 --- a/test/integration/verify/controls/azurerm_cosmosdb_database_account.rb +++ b/test/integration/verify/controls/azurerm_cosmosdb_database_account.rb @@ -1,19 +1,19 @@ -resource_group = attribute('resource_group', value: nil) -cosmosdb_database_account = attribute('cosmosdb_database_account', value: nil) +resource_group = attribute("resource_group", value: nil) +cosmosdb_database_account = attribute("cosmosdb_database_account", value: nil) -control 'azurerm_cosmosdb_database_account' do +control "azurerm_cosmosdb_database_account" do - title 'Testing the singular resource of azurerm_cosmosdb_database_account.' - desc 'Testing the singular resource of azurerm_cosmosdb_database_account.' + title "Testing the singular resource of azurerm_cosmosdb_database_account." + desc "Testing the singular resource of azurerm_cosmosdb_database_account." only_if { !cosmosdb_database_account.nil? } describe azurerm_cosmosdb_database_account(resource_group: resource_group, cosmosdb_database_account: cosmosdb_database_account) do - its('name') { should eq cosmosdb_database_account } - its('type') { should eq 'Microsoft.DocumentDB/databaseAccounts' } + its("name") { should eq cosmosdb_database_account } + its("type") { should eq "Microsoft.DocumentDB/databaseAccounts" } end - describe azurerm_cosmosdb_database_account(resource_group: resource_group, cosmosdb_database_account: 'fake') do + describe azurerm_cosmosdb_database_account(resource_group: resource_group, cosmosdb_database_account: "fake") do it { should_not exist } end end diff --git a/test/integration/verify/controls/azurerm_event_hub_authorization_rule.rb b/test/integration/verify/controls/azurerm_event_hub_authorization_rule.rb index 489432a68..e2c0650a5 100644 --- a/test/integration/verify/controls/azurerm_event_hub_authorization_rule.rb +++ b/test/integration/verify/controls/azurerm_event_hub_authorization_rule.rb @@ -1,20 +1,20 @@ -resource_group = attribute('resource_group', value: nil) -event_hub_namespace_name = attribute('event_hub_namespace_name', value: nil) -event_hub_endpoint = attribute('event_hub_endpoint', value: nil) -event_hub_authorization_rule = attribute('event_hub_authorization_rule', value: nil) +resource_group = attribute("resource_group", value: nil) +event_hub_namespace_name = attribute("event_hub_namespace_name", value: nil) +event_hub_endpoint = attribute("event_hub_endpoint", value: nil) +event_hub_authorization_rule = attribute("event_hub_authorization_rule", value: nil) -control 'azurerm_event_hub_authorization_rule' do +control "azurerm_event_hub_authorization_rule" do - title 'Testing the singular resource of azurerm_event_hub_authorization_rule.' - desc 'Testing the singular resource of azurerm_event_hub_authorization_rule.' + title "Testing the singular resource of azurerm_event_hub_authorization_rule." + desc "Testing the singular resource of azurerm_event_hub_authorization_rule." describe azurerm_event_hub_authorization_rule(resource_group: resource_group, namespace_name: event_hub_namespace_name, event_hub_endpoint: event_hub_endpoint, authorization_rule: event_hub_authorization_rule) do it { should exist } - its('name') { should eq event_hub_authorization_rule } - its('type') { should eq 'Microsoft.EventHub/Namespaces/EventHubs/AuthorizationRules' } + its("name") { should eq event_hub_authorization_rule } + its("type") { should eq "Microsoft.EventHub/Namespaces/EventHubs/AuthorizationRules" } end - describe azurerm_event_hub_authorization_rule(resource_group: resource_group, namespace_name: event_hub_namespace_name, event_hub_endpoint: event_hub_endpoint, authorization_rule: 'fake') do + describe azurerm_event_hub_authorization_rule(resource_group: resource_group, namespace_name: event_hub_namespace_name, event_hub_endpoint: event_hub_endpoint, authorization_rule: "fake") do it { should_not exist } end end diff --git a/test/integration/verify/controls/azurerm_event_hub_event_hub.rb b/test/integration/verify/controls/azurerm_event_hub_event_hub.rb index 161aa2240..1f3a71dd2 100644 --- a/test/integration/verify/controls/azurerm_event_hub_event_hub.rb +++ b/test/integration/verify/controls/azurerm_event_hub_event_hub.rb @@ -1,19 +1,19 @@ -resource_group = attribute('resource_group', value: nil) -event_hub_namespace_name = attribute('event_hub_namespace_name', value: nil) -event_hub_name = attribute('event_hub_name', value: nil) +resource_group = attribute("resource_group", value: nil) +event_hub_namespace_name = attribute("event_hub_namespace_name", value: nil) +event_hub_name = attribute("event_hub_name", value: nil) -control 'azurerm_event_hub_event_hub' do +control "azurerm_event_hub_event_hub" do - title 'Testing the singular resource of azurerm_event_hub_event_hub.' - desc 'Testing the singular resource of azurerm_event_hub_event_hub.' + title "Testing the singular resource of azurerm_event_hub_event_hub." + desc "Testing the singular resource of azurerm_event_hub_event_hub." describe azurerm_event_hub_event_hub(resource_group: resource_group, namespace_name: event_hub_namespace_name, event_hub_name: event_hub_name) do it { should exist } - its('name') { should eq event_hub_name } - its('type') { should eq 'Microsoft.EventHub/Namespaces/EventHubs' } + its("name") { should eq event_hub_name } + its("type") { should eq "Microsoft.EventHub/Namespaces/EventHubs" } end - describe azurerm_event_hub_event_hub(resource_group: resource_group, namespace_name: event_hub_namespace_name, event_hub_name: 'fake-event-hub') do + describe azurerm_event_hub_event_hub(resource_group: resource_group, namespace_name: event_hub_namespace_name, event_hub_name: "fake-event-hub") do it { should_not exist } end end diff --git a/test/integration/verify/controls/azurerm_event_hub_namespace.rb b/test/integration/verify/controls/azurerm_event_hub_namespace.rb index 00fb19844..92311f57d 100644 --- a/test/integration/verify/controls/azurerm_event_hub_namespace.rb +++ b/test/integration/verify/controls/azurerm_event_hub_namespace.rb @@ -1,18 +1,18 @@ -resource_group = attribute('resource_group', value: nil) -event_hub_namespace_name = attribute('event_hub_namespace_name', value: nil) +resource_group = attribute("resource_group", value: nil) +event_hub_namespace_name = attribute("event_hub_namespace_name", value: nil) -control 'azurerm_event_hub_namespace' do +control "azurerm_event_hub_namespace" do - title 'Testing the singular resource of azurerm_event_hub_namespace.' - desc 'Testing the singular resource of azurerm_event_hub_namespace.' + title "Testing the singular resource of azurerm_event_hub_namespace." + desc "Testing the singular resource of azurerm_event_hub_namespace." describe azurerm_event_hub_namespace(resource_group: resource_group, namespace_name: event_hub_namespace_name) do it { should exist } - its('name') { should eq event_hub_namespace_name } - its('type') { should eq 'Microsoft.EventHub/Namespaces' } + its("name") { should eq event_hub_namespace_name } + its("type") { should eq "Microsoft.EventHub/Namespaces" } end - describe azurerm_event_hub_namespace(resource_group: resource_group, namespace_name: 'fake') do + describe azurerm_event_hub_namespace(resource_group: resource_group, namespace_name: "fake") do it { should_not exist } end end diff --git a/test/integration/verify/controls/azurerm_hdinsight_cluster.rb b/test/integration/verify/controls/azurerm_hdinsight_cluster.rb index 067691550..2eacfcfb2 100644 --- a/test/integration/verify/controls/azurerm_hdinsight_cluster.rb +++ b/test/integration/verify/controls/azurerm_hdinsight_cluster.rb @@ -1,26 +1,26 @@ -resource_group = input('resource_group', value: nil) -cluster_name = input('hdinsight_cluster_name', value: '') +resource_group = input("resource_group", value: nil) +cluster_name = input("hdinsight_cluster_name", value: "") -control 'azurerm_hdinsight_cluster' do +control "azurerm_hdinsight_cluster" do - title 'Testing the singular resource of azurerm_hdinsight_cluster.' - desc 'Testing the singular resource of azurerm_hdinsight_cluster.' + title "Testing the singular resource of azurerm_hdinsight_cluster." + desc "Testing the singular resource of azurerm_hdinsight_cluster." only_if { !cluster_name.empty? } describe azurerm_hdinsight_cluster(resource_group: resource_group, name: cluster_name) do it { should exist } - its('name') { should cmp cluster_name } - its('type') { should cmp 'Microsoft.HDInsight/clusters' } - its('properties.provisioningState') { should cmp 'Succeeded' } - its('properties.clusterVersion') { should cmp >= '4.0' } - its('properties.clusterDefinition.kind') { should eq 'INTERACTIVEHIVE' } + its("name") { should cmp cluster_name } + its("type") { should cmp "Microsoft.HDInsight/clusters" } + its("properties.provisioningState") { should cmp "Succeeded" } + its("properties.clusterVersion") { should cmp >= "4.0" } + its("properties.clusterDefinition.kind") { should eq "INTERACTIVEHIVE" } end - describe azurerm_hdinsight_cluster(resource_group: resource_group, name: 'fake') do + describe azurerm_hdinsight_cluster(resource_group: resource_group, name: "fake") do it { should_not exist } end - describe azurerm_hdinsight_cluster(resource_group: 'does-not-exist', name: 'fake') do + describe azurerm_hdinsight_cluster(resource_group: "does-not-exist", name: "fake") do it { should_not exist } end end diff --git a/test/integration/verify/controls/azurerm_iothub.rb b/test/integration/verify/controls/azurerm_iothub.rb index 84483aa71..7446d7101 100644 --- a/test/integration/verify/controls/azurerm_iothub.rb +++ b/test/integration/verify/controls/azurerm_iothub.rb @@ -1,18 +1,18 @@ -resource_group = attribute('resource_group', value: nil) -iothub_resource_name = attribute('iothub_resource_name', value: nil) +resource_group = attribute("resource_group", value: nil) +iothub_resource_name = attribute("iothub_resource_name", value: nil) -control 'azurerm_iothub' do +control "azurerm_iothub" do - title 'Testing the singular resource of azurerm_iothub.' - desc 'Testing the singular resource of azurerm_iothub.' + title "Testing the singular resource of azurerm_iothub." + desc "Testing the singular resource of azurerm_iothub." describe azurerm_iothub(resource_group: resource_group, resource_name: iothub_resource_name) do it { should exist } - its('name') { should eq iothub_resource_name } - its('type') { should eq 'Microsoft.Devices/IotHubs' } + its("name") { should eq iothub_resource_name } + its("type") { should eq "Microsoft.Devices/IotHubs" } end - describe azurerm_iothub(resource_group: resource_group, resource_name: 'fake') do + describe azurerm_iothub(resource_group: resource_group, resource_name: "fake") do it { should_not exist } end end diff --git a/test/integration/verify/controls/azurerm_iothub_event_hub_consumer_group.rb b/test/integration/verify/controls/azurerm_iothub_event_hub_consumer_group.rb index 6b2601f5f..10fc6b751 100644 --- a/test/integration/verify/controls/azurerm_iothub_event_hub_consumer_group.rb +++ b/test/integration/verify/controls/azurerm_iothub_event_hub_consumer_group.rb @@ -1,20 +1,20 @@ -resource_group = attribute('resource_group', value: nil) -iothub_resource_name = attribute('iothub_resource_name', value: nil) -iothub_event_hub_endpoint = attribute('iothub_event_hub_endpoint', value: nil) -consumer_group = attribute('consumer_group', value: nil) +resource_group = attribute("resource_group", value: nil) +iothub_resource_name = attribute("iothub_resource_name", value: nil) +iothub_event_hub_endpoint = attribute("iothub_event_hub_endpoint", value: nil) +consumer_group = attribute("consumer_group", value: nil) -control 'azurerm_iothub_event_hub_consumer_group' do +control "azurerm_iothub_event_hub_consumer_group" do - title 'Testing the singular resource of azurerm_iothub_event_hub_consumer_group.' - desc 'Testing the singular resource of azurerm_iothub_event_hub_consumer_group.' + title "Testing the singular resource of azurerm_iothub_event_hub_consumer_group." + desc "Testing the singular resource of azurerm_iothub_event_hub_consumer_group." describe azurerm_iothub_event_hub_consumer_group(resource_group: resource_group, resource_name: iothub_resource_name, event_hub_endpoint: iothub_event_hub_endpoint, consumer_group: consumer_group) do it { should exist } - its('name') { should eq consumer_group } - its('type') { should eq 'Microsoft.Devices/IotHubs/EventHubEndpoints/ConsumerGroups' } + its("name") { should eq consumer_group } + its("type") { should eq "Microsoft.Devices/IotHubs/EventHubEndpoints/ConsumerGroups" } end - describe azurerm_iothub_event_hub_consumer_group(resource_group: resource_group, resource_name: iothub_resource_name, event_hub_endpoint: iothub_event_hub_endpoint, consumer_group: 'invalid-consumer-group') do + describe azurerm_iothub_event_hub_consumer_group(resource_group: resource_group, resource_name: iothub_resource_name, event_hub_endpoint: iothub_event_hub_endpoint, consumer_group: "invalid-consumer-group") do it { should_not exist } end end diff --git a/test/integration/verify/controls/azurerm_iothub_event_hub_consumer_groups.rb b/test/integration/verify/controls/azurerm_iothub_event_hub_consumer_groups.rb index 4dec9ec84..c69d434c9 100644 --- a/test/integration/verify/controls/azurerm_iothub_event_hub_consumer_groups.rb +++ b/test/integration/verify/controls/azurerm_iothub_event_hub_consumer_groups.rb @@ -1,27 +1,27 @@ -resource_group = attribute('resource_group', value: nil) -iothub_resource_name = attribute('iothub_resource_name', value: nil) -iothub_event_hub_endpoint = attribute('iothub_event_hub_endpoint', value: nil) -consumer_groups = attribute('consumer_groups', value: nil) +resource_group = attribute("resource_group", value: nil) +iothub_resource_name = attribute("iothub_resource_name", value: nil) +iothub_event_hub_endpoint = attribute("iothub_event_hub_endpoint", value: nil) +consumer_groups = attribute("consumer_groups", value: nil) -control 'azurerm_iothub_event_hub_consumer_groups' do +control "azurerm_iothub_event_hub_consumer_groups" do - title 'Testing the plural resource of azurerm_iothub_event_hub_consumer_groups.' - desc 'Testing the plural resource of azurerm_iothub_event_hub_consumer_groups.' + title "Testing the plural resource of azurerm_iothub_event_hub_consumer_groups." + desc "Testing the plural resource of azurerm_iothub_event_hub_consumer_groups." azurerm_iothub_event_hub_consumer_groups(resource_group: resource_group, resource_name: iothub_resource_name, event_hub_endpoint: iothub_event_hub_endpoint).entries.each do |consumer_group| - describe consumer_group do - its('name') { should be_in consumer_groups } - its('type') { should include 'Microsoft.Devices/IotHubs/EventHubEndpoints/ConsumerGroups' } - end - end + describe consumer_group do + its("name") { should be_in consumer_groups } + its("type") { should include "Microsoft.Devices/IotHubs/EventHubEndpoints/ConsumerGroups" } + end + end azurerm_iothub_event_hub_consumer_groups(resource_group: resource_group, resource_name: iothub_resource_name, event_hub_endpoint: iothub_event_hub_endpoint) do - its { should exist } - its('names') { should include consumer_groups.first } - its('type') { should include 'Microsoft.Devices/IotHubs/EventHubEndpoints/ConsumerGroups' } - end + its { should exist } + its("names") { should include consumer_groups.first } + its("type") { should include "Microsoft.Devices/IotHubs/EventHubEndpoints/ConsumerGroups" } + end end diff --git a/test/integration/verify/controls/azurerm_key_vault_key.rb b/test/integration/verify/controls/azurerm_key_vault_key.rb index 38b2fdb3e..ef46b875b 100644 --- a/test/integration/verify/controls/azurerm_key_vault_key.rb +++ b/test/integration/verify/controls/azurerm_key_vault_key.rb @@ -1,14 +1,14 @@ -vault_name = input('key_vault_name', value: nil) -key_name = input('key_vault_key_name', value: nil) +vault_name = input("key_vault_name", value: nil) +key_name = input("key_vault_key_name", value: nil) -control 'azure_key_vault_key' do +control "azure_key_vault_key" do - title 'Testing the singular resource of azurerm_key_vault_key.' - desc 'Testing the singular resource of azurerm_key_vault_key.' + title "Testing the singular resource of azurerm_key_vault_key." + desc "Testing the singular resource of azurerm_key_vault_key." describe azure_key_vault_key(vault_name, key_name) do - its('key.kid') { should_not be_nil } - its('attributes') { should have_attributes(enabled: true) } + its("key.kid") { should_not be_nil } + its("attributes") { should have_attributes(enabled: true) } it { should have_rotation_policy_enabled } end end diff --git a/test/integration/verify/controls/azurerm_key_vault_keys.rb b/test/integration/verify/controls/azurerm_key_vault_keys.rb index 4914a7164..95d842daa 100644 --- a/test/integration/verify/controls/azurerm_key_vault_keys.rb +++ b/test/integration/verify/controls/azurerm_key_vault_keys.rb @@ -1,14 +1,14 @@ -vault_name = input('key_vault_name', value: nil) +vault_name = input("key_vault_name", value: nil) -control 'azurerm_key_vault_keys' do +control "azurerm_key_vault_keys" do - title 'Testing the plural resource of azurerm_key_vault_keys.' - desc 'Testing the plural resource of azurerm_key_vault_keys.' + title "Testing the plural resource of azurerm_key_vault_keys." + desc "Testing the plural resource of azurerm_key_vault_keys." azurerm_key_vault_keys(vault_name).entries.each do |key| describe key do - its('kid') { should_not be nil } - its('attributes') { should have_attributes(enabled: true) } + its("kid") { should_not be nil } + its("attributes") { should have_attributes(enabled: true) } end end diff --git a/test/integration/verify/controls/azurerm_key_vault_secret.rb b/test/integration/verify/controls/azurerm_key_vault_secret.rb index c022c7586..8edbdf90f 100644 --- a/test/integration/verify/controls/azurerm_key_vault_secret.rb +++ b/test/integration/verify/controls/azurerm_key_vault_secret.rb @@ -1,13 +1,13 @@ -vault_name = input('key_vault_name', value: nil) -secret_name = input('key_vault_secret_name', value: nil) +vault_name = input("key_vault_name", value: nil) +secret_name = input("key_vault_secret_name", value: nil) -control 'azurerm_key_vault_secret' do +control "azurerm_key_vault_secret" do - title 'Testing the singular resource of azurerm_key_vault_secret.' - desc 'Testing the singular resource of azurerm_key_vault_secret.' + title "Testing the singular resource of azurerm_key_vault_secret." + desc "Testing the singular resource of azurerm_key_vault_secret." describe azurerm_key_vault_secret(vault_name, secret_name) do it { should exist } - its('value') { should_not be_nil } + its("value") { should_not be_nil } end end diff --git a/test/integration/verify/controls/azurerm_key_vault_secrets.rb b/test/integration/verify/controls/azurerm_key_vault_secrets.rb index c2691b296..d51e954ad 100644 --- a/test/integration/verify/controls/azurerm_key_vault_secrets.rb +++ b/test/integration/verify/controls/azurerm_key_vault_secrets.rb @@ -1,9 +1,9 @@ -vault_name = input('key_vault_name', value: nil) +vault_name = input("key_vault_name", value: nil) -control 'azurerm_key_vault_secrets' do +control "azurerm_key_vault_secrets" do - title 'Testing the plural resource of azurerm_key_vault_secrets.' - desc 'Testing the plural resource of azurerm_key_vault_secrets.' + title "Testing the plural resource of azurerm_key_vault_secrets." + desc "Testing the plural resource of azurerm_key_vault_secrets." describe azurerm_key_vault_secrets(vault_name) do it { should exist } diff --git a/test/integration/verify/controls/azurerm_key_vaults.rb b/test/integration/verify/controls/azurerm_key_vaults.rb index e9e113d82..7da02174c 100644 --- a/test/integration/verify/controls/azurerm_key_vaults.rb +++ b/test/integration/verify/controls/azurerm_key_vaults.rb @@ -1,25 +1,25 @@ -resource_group = input('resource_group', value: nil) -vault_name = input('key_vault_name', value: nil) +resource_group = input("resource_group", value: nil) +vault_name = input("key_vault_name", value: nil) -control 'azurerm_key_vaults' do +control "azurerm_key_vaults" do - title 'Testing the plural resource of azurerm_key_vaults.' - desc 'Testing the plural resource of azurerm_key_vaults.' + title "Testing the plural resource of azurerm_key_vaults." + desc "Testing the plural resource of azurerm_key_vaults." describe azurerm_key_vaults(resource_group: resource_group) do it { should exist } - its('names') { should include vault_name } + its("names") { should include vault_name } end end -control 'azure_key_vaults' do +control "azure_key_vaults" do - title 'Ensure that azure_key_vaults plural resource works without a parameter.' - desc 'Testing the plural resource of azurerm_key_vaults.' + title "Ensure that azure_key_vaults plural resource works without a parameter." + desc "Testing the plural resource of azurerm_key_vaults." azure_key_vaults.ids.each do |id| describe azure_key_vault(resource_id: id) do - its('type') { should eq 'Microsoft.KeyVault/vaults' } + its("type") { should eq "Microsoft.KeyVault/vaults" } end end diff --git a/test/integration/verify/controls/azurerm_load_balancer.rb b/test/integration/verify/controls/azurerm_load_balancer.rb index 0ef62ee26..2038eb02a 100644 --- a/test/integration/verify/controls/azurerm_load_balancer.rb +++ b/test/integration/verify/controls/azurerm_load_balancer.rb @@ -1,17 +1,17 @@ -resource_group = attribute('resource_group', value: nil) -loadbalancer_name = attribute('lb_name', value: nil) +resource_group = attribute("resource_group", value: nil) +loadbalancer_name = attribute("lb_name", value: nil) -control 'azurerm_load_balancer' do +control "azurerm_load_balancer" do - title 'Testing the singular resource of azurerm_load_balancer.' - desc 'Testing the singular resource of azurerm_load_balancer.' + title "Testing the singular resource of azurerm_load_balancer." + desc "Testing the singular resource of azurerm_load_balancer." describe azurerm_load_balancer(resource_group: resource_group, loadbalancer_name: loadbalancer_name) do it { should exist } - its('id') { should_not be_nil } - its('name') { should eq loadbalancer_name } - its('sku') { should_not be_nil } - its('location') { should_not be_nil } - its('type') { should eq 'Microsoft.Network/loadBalancers' } + its("id") { should_not be_nil } + its("name") { should eq loadbalancer_name } + its("sku") { should_not be_nil } + its("location") { should_not be_nil } + its("type") { should eq "Microsoft.Network/loadBalancers" } end end diff --git a/test/integration/verify/controls/azurerm_load_balancers.rb b/test/integration/verify/controls/azurerm_load_balancers.rb index 071ca7c28..ed3a5034e 100644 --- a/test/integration/verify/controls/azurerm_load_balancers.rb +++ b/test/integration/verify/controls/azurerm_load_balancers.rb @@ -1,18 +1,18 @@ -resource_group = attribute('resource_group', value: nil) -loadbalancer_name = attribute('lb_name', value: nil) +resource_group = attribute("resource_group", value: nil) +loadbalancer_name = attribute("lb_name", value: nil) -control 'azurerm_load_balancers' do +control "azurerm_load_balancers" do - title 'Testing the plural resource of azurerm_load_balancers.' - desc 'Testing the plural resource of azurerm_load_balancers.' + title "Testing the plural resource of azurerm_load_balancers." + desc "Testing the plural resource of azurerm_load_balancers." describe azurerm_load_balancers(resource_group: resource_group) do it { should exist } - its('names') { should include loadbalancer_name } + its("names") { should include loadbalancer_name } end describe azurerm_load_balancers do it { should exist } - its('names') { should include loadbalancer_name } + its("names") { should include loadbalancer_name } end end diff --git a/test/integration/verify/controls/azurerm_locks.rb b/test/integration/verify/controls/azurerm_locks.rb index 17c448d04..05713ccea 100644 --- a/test/integration/verify/controls/azurerm_locks.rb +++ b/test/integration/verify/controls/azurerm_locks.rb @@ -1,21 +1,21 @@ -resource_group = input('resource_group', value: nil) -resource_name = input('windows_vm_name', value: nil) -resource_type = 'Microsoft.Compute/virtualMachines' +resource_group = input("resource_group", value: nil) +resource_name = input("windows_vm_name", value: nil) +resource_type = "Microsoft.Compute/virtualMachines" -control 'azurerm_locks' do +control "azurerm_locks" do - title 'Testing the plural resource of azure_locks.' - desc 'Testing the plural resource of azure_locks.' + title "Testing the plural resource of azure_locks." + desc "Testing the plural resource of azure_locks." describe azurerm_locks(resource_group: resource_group, resource_name: resource_name, resource_type: resource_type) do it { should_not exist } end end -control 'azure_locks' do +control "azure_locks" do - title 'Testing the plural resource of azure_locks.' - desc 'Testing the plural resource of azure_locks.' + title "Testing the plural resource of azure_locks." + desc "Testing the plural resource of azure_locks." vm_id = azure_virtual_machine(resource_group: resource_group, name: resource_name).id describe azure_locks(resource_id: vm_id) do diff --git a/test/integration/verify/controls/azurerm_management_group.rb b/test/integration/verify/controls/azurerm_management_group.rb index e44ed750f..c2f1e596e 100644 --- a/test/integration/verify/controls/azurerm_management_group.rb +++ b/test/integration/verify/controls/azurerm_management_group.rb @@ -1,57 +1,57 @@ -tenant_id = input('tenant_id', value: nil) -parent_mg = input('parent_mg', value: nil) -child1_mg = input('child1_mg', value: nil) -child2_mg = input('child2_mg', value: nil) -parent_dn = input('parent_dn', value: nil) -mg_type = 'Microsoft.Management/managementGroups' +tenant_id = input("tenant_id", value: nil) +parent_mg = input("parent_mg", value: nil) +child1_mg = input("child1_mg", value: nil) +child2_mg = input("child2_mg", value: nil) +parent_dn = input("parent_dn", value: nil) +mg_type = "Microsoft.Management/managementGroups" -control 'azurerm_management_group' do +control "azurerm_management_group" do - title 'Testing the singular resource of azurerm_management_group.' - desc 'Testing the singular resource of azurerm_management_group.' + title "Testing the singular resource of azurerm_management_group." + desc "Testing the singular resource of azurerm_management_group." only_if { !parent_mg.nil? } - describe azurerm_management_group(group_id: parent_mg, expand: 'children', recurse: true) do + describe azurerm_management_group(group_id: parent_mg, expand: "children", recurse: true) do it { should exist } - its('id') { should eq "/providers/#{mg_type}/#{parent_mg}" } - its('name') { should eq parent_mg } - its('display_name') { should eq parent_dn } - its('tenant_id') { should eq tenant_id } - its('children_ids') { should include "/providers/#{mg_type}/#{child1_mg}" } - its('children_ids') { should include "/providers/#{mg_type}/#{child2_mg}" } - its('children_names') { should include child1_mg } - its('children_names') { should include child2_mg } - its('children_display_names') { should include 'Management Group Child 1' } - its('children_display_names') { should include 'Management Group Child 2' } + its("id") { should eq "/providers/#{mg_type}/#{parent_mg}" } + its("name") { should eq parent_mg } + its("display_name") { should eq parent_dn } + its("tenant_id") { should eq tenant_id } + its("children_ids") { should include "/providers/#{mg_type}/#{child1_mg}" } + its("children_ids") { should include "/providers/#{mg_type}/#{child2_mg}" } + its("children_names") { should include child1_mg } + its("children_names") { should include child2_mg } + its("children_display_names") { should include "Management Group Child 1" } + its("children_display_names") { should include "Management Group Child 2" } end - describe azurerm_management_group(group_id: child1_mg, expand: 'children', recurse: true) do + describe azurerm_management_group(group_id: child1_mg, expand: "children", recurse: true) do it { should exist } - its('id') { should eq "/providers/#{mg_type}/#{child1_mg}" } - its('name') { should eq child1_mg } - its('tenant_id') { should eq tenant_id } - its('parent_name') { should eq parent_mg } - its('parent_id') { should eq "/providers/#{mg_type}/#{parent_mg}" } - its('display_name') { should eq 'Management Group Child 1' } - its('parent_display_name') { should eq 'Management Group Parent' } - its('children_display_names') { should eq [] } - its('children_ids') { should eq [] } - its('children_names') { should eq [] } - its('children_types') { should eq [] } + its("id") { should eq "/providers/#{mg_type}/#{child1_mg}" } + its("name") { should eq child1_mg } + its("tenant_id") { should eq tenant_id } + its("parent_name") { should eq parent_mg } + its("parent_id") { should eq "/providers/#{mg_type}/#{parent_mg}" } + its("display_name") { should eq "Management Group Child 1" } + its("parent_display_name") { should eq "Management Group Parent" } + its("children_display_names") { should eq [] } + its("children_ids") { should eq [] } + its("children_names") { should eq [] } + its("children_types") { should eq [] } end - describe azurerm_management_group(group_id: child2_mg, expand: 'children', recurse: true) do + describe azurerm_management_group(group_id: child2_mg, expand: "children", recurse: true) do it { should exist } - its('id') { should eq "/providers/#{mg_type}/#{child2_mg}" } - its('name') { should eq child2_mg } - its('tenant_id') { should eq tenant_id } - its('parent_name') { should eq parent_mg } - its('parent_id') { should eq "/providers/#{mg_type}/#{parent_mg}" } - its('display_name') { should eq 'Management Group Child 2' } - its('parent_display_name') { should eq 'Management Group Parent' } - its('children_display_names') { should eq [] } - its('children_ids') { should eq [] } - its('children_names') { should eq [] } - its('children_types') { should eq [] } + its("id") { should eq "/providers/#{mg_type}/#{child2_mg}" } + its("name") { should eq child2_mg } + its("tenant_id") { should eq tenant_id } + its("parent_name") { should eq parent_mg } + its("parent_id") { should eq "/providers/#{mg_type}/#{parent_mg}" } + its("display_name") { should eq "Management Group Child 2" } + its("parent_display_name") { should eq "Management Group Parent" } + its("children_display_names") { should eq [] } + its("children_ids") { should eq [] } + its("children_names") { should eq [] } + its("children_types") { should eq [] } end end diff --git a/test/integration/verify/controls/azurerm_management_groups.rb b/test/integration/verify/controls/azurerm_management_groups.rb index 30babb286..9eaadff68 100644 --- a/test/integration/verify/controls/azurerm_management_groups.rb +++ b/test/integration/verify/controls/azurerm_management_groups.rb @@ -1,25 +1,25 @@ -tenant_id = input('tenant_id', value: nil) -parent_mg = input('parent_mg', value: nil) -child1_mg = input('child1_mg', value: nil) -child2_mg = input('child2_mg', value: nil) -parent_dn = input('parent_dn', value: nil) +tenant_id = input("tenant_id", value: nil) +parent_mg = input("parent_mg", value: nil) +child1_mg = input("child1_mg", value: nil) +child2_mg = input("child2_mg", value: nil) +parent_dn = input("parent_dn", value: nil) -control 'azurerm_management_groups' do +control "azurerm_management_groups" do - title 'Testing the plural resource of azurerm_management_groups.' - desc 'Testing the plural resource of azurerm_management_groups.' + title "Testing the plural resource of azurerm_management_groups." + desc "Testing the plural resource of azurerm_management_groups." only_if { !parent_mg.nil? } describe azurerm_management_groups do - its('ids') { should include "/providers/Microsoft.Management/managementGroups/#{parent_mg}" } - its('ids') { should include "/providers/Microsoft.Management/managementGroups/#{child1_mg}" } - its('ids') { should include "/providers/Microsoft.Management/managementGroups/#{child2_mg}" } - its('names') { should include parent_mg } - its('names') { should include child1_mg } - its('names') { should include child2_mg } + its("ids") { should include "/providers/Microsoft.Management/managementGroups/#{parent_mg}" } + its("ids") { should include "/providers/Microsoft.Management/managementGroups/#{child1_mg}" } + its("ids") { should include "/providers/Microsoft.Management/managementGroups/#{child2_mg}" } + its("names") { should include parent_mg } + its("names") { should include child1_mg } + its("names") { should include child2_mg } end - describe azurerm_management_groups.where(name: 'mg_parent').entries.first do - its('properties') { should have_attributes(tenantId: tenant_id, displayName: parent_dn) } + describe azurerm_management_groups.where(name: "mg_parent").entries.first do + its("properties") { should have_attributes(tenantId: tenant_id, displayName: parent_dn) } end end diff --git a/test/integration/verify/controls/azurerm_mariadb_server.rb b/test/integration/verify/controls/azurerm_mariadb_server.rb index f0b20605f..704361efe 100644 --- a/test/integration/verify/controls/azurerm_mariadb_server.rb +++ b/test/integration/verify/controls/azurerm_mariadb_server.rb @@ -1,20 +1,20 @@ -resource_group = input('resource_group', value: nil) -mariadb_server_name = input('mariadb_server_name', value: nil) +resource_group = input("resource_group", value: nil) +mariadb_server_name = input("mariadb_server_name", value: nil) -control 'azurerm_mariadb_server' do +control "azurerm_mariadb_server" do - title 'Testing the singular resource of azurerm_mariadb_server.' - desc 'Testing the singular resource of azurerm_mariadb_server.' + title "Testing the singular resource of azurerm_mariadb_server." + desc "Testing the singular resource of azurerm_mariadb_server." only_if { !mariadb_server_name.nil? } describe azurerm_mariadb_server(resource_group: resource_group, server_name: mariadb_server_name) do it { should exist } - its('id') { should_not be_nil } - its('name') { should eq mariadb_server_name } - its('sku') { should_not be_nil } - its('location') { should_not be_nil } - its('type') { should eq 'Microsoft.DBforMariaDB/servers' } - its('properties') { should have_attributes(version: '10.2') } + its("id") { should_not be_nil } + its("name") { should eq mariadb_server_name } + its("sku") { should_not be_nil } + its("location") { should_not be_nil } + its("type") { should eq "Microsoft.DBforMariaDB/servers" } + its("properties") { should have_attributes(version: "10.2") } end end diff --git a/test/integration/verify/controls/azurerm_mariadb_servers.rb b/test/integration/verify/controls/azurerm_mariadb_servers.rb index e60f64253..225d0f886 100644 --- a/test/integration/verify/controls/azurerm_mariadb_servers.rb +++ b/test/integration/verify/controls/azurerm_mariadb_servers.rb @@ -1,20 +1,20 @@ -resource_group = input('resource_group', value: nil) -mariadb_server_name = input('mariadb_server_name', value: nil) +resource_group = input("resource_group", value: nil) +mariadb_server_name = input("mariadb_server_name", value: nil) -control 'azurerm_mariadb_servers' do +control "azurerm_mariadb_servers" do - title 'Testing the plural resource of azurerm_mariadb_servers.' - desc 'Testing the plural resource of azurerm_mariadb_servers.' + title "Testing the plural resource of azurerm_mariadb_servers." + desc "Testing the plural resource of azurerm_mariadb_servers." only_if { !mariadb_server_name.nil? } describe azurerm_mariadb_servers(resource_group: resource_group) do it { should exist } - its('names') { should include mariadb_server_name } + its("names") { should include mariadb_server_name } end describe azurerm_mariadb_servers do it { should exist } - its('names') { should include mariadb_server_name } + its("names") { should include mariadb_server_name } end end diff --git a/test/integration/verify/controls/azurerm_monitor_activity_log_alert.rb b/test/integration/verify/controls/azurerm_monitor_activity_log_alert.rb index ab96f9613..3781a1a9f 100644 --- a/test/integration/verify/controls/azurerm_monitor_activity_log_alert.rb +++ b/test/integration/verify/controls/azurerm_monitor_activity_log_alert.rb @@ -1,33 +1,33 @@ -resource_group = input('resource_group', value: nil) -log_alert_name = input('activity_log_alert_name', value: nil) +resource_group = input("resource_group", value: nil) +log_alert_name = input("activity_log_alert_name", value: nil) alerts_and_operations = { - '5_3' => 'Microsoft.Authorization/policyAssignments/write', - '5_4' => 'Microsoft.Network/networkSecurityGroups/write', - '5_5' => 'Microsoft.Network/networkSecurityGroups/delete', - '5_6' => 'Microsoft.Network/networkSecurityGroups/securityRules/write', - '5_7' => 'Microsoft.Network/networkSecurityGroups/securityRules/delete', - '5_8' => 'Microsoft.Security/securitySolutions/write', - '5_9' => 'Microsoft.Security/securitySolutions/delete', - '5_10' => 'Microsoft.Sql/servers/firewallRules/write', - '5_11' => 'Microsoft.Sql/servers/firewallRules/delete', - '5_12' => 'Microsoft.Security/policies/write', + "5_3" => "Microsoft.Authorization/policyAssignments/write", + "5_4" => "Microsoft.Network/networkSecurityGroups/write", + "5_5" => "Microsoft.Network/networkSecurityGroups/delete", + "5_6" => "Microsoft.Network/networkSecurityGroups/securityRules/write", + "5_7" => "Microsoft.Network/networkSecurityGroups/securityRules/delete", + "5_8" => "Microsoft.Security/securitySolutions/write", + "5_9" => "Microsoft.Security/securitySolutions/delete", + "5_10" => "Microsoft.Sql/servers/firewallRules/write", + "5_11" => "Microsoft.Sql/servers/firewallRules/delete", + "5_12" => "Microsoft.Security/policies/write", } -control 'azurerm_monitor_activity_log_alert' do +control "azurerm_monitor_activity_log_alert" do - title 'Testing the singular resource of azurerm_monitor_activity_log_alert.' - desc 'Testing the singular resource of azurerm_monitor_activity_log_alert.' + title "Testing the singular resource of azurerm_monitor_activity_log_alert." + desc "Testing the singular resource of azurerm_monitor_activity_log_alert." alerts_and_operations.each do |alert, operation| describe azurerm_monitor_activity_log_alert(resource_group: resource_group, name: "#{log_alert_name}_#{alert}") do it { should exist } - its('operations') { should include operation } - its('conditions') { should_not be_nil } + its("operations") { should include operation } + its("conditions") { should_not be_nil } end end - describe azurerm_monitor_activity_log_alert(resource_group: resource_group, name: 'fake') do + describe azurerm_monitor_activity_log_alert(resource_group: resource_group, name: "fake") do it { should_not exist } end end diff --git a/test/integration/verify/controls/azurerm_monitor_activity_log_alerts.rb b/test/integration/verify/controls/azurerm_monitor_activity_log_alerts.rb index 8668771ea..f953c2f6d 100644 --- a/test/integration/verify/controls/azurerm_monitor_activity_log_alerts.rb +++ b/test/integration/verify/controls/azurerm_monitor_activity_log_alerts.rb @@ -1,9 +1,9 @@ -control 'azurerm_monitor_activity_log_alerts' do +control "azurerm_monitor_activity_log_alerts" do - title 'Testing the plural resource of azurerm_monitor_activity_log_alerts.' - desc 'Testing the plural resource of azurerm_monitor_activity_log_alerts.' + title "Testing the plural resource of azurerm_monitor_activity_log_alerts." + desc "Testing the plural resource of azurerm_monitor_activity_log_alerts." describe azurerm_monitor_activity_log_alerts do - its('names') { should include('defaultLogAlert_5_3') } + its("names") { should include("defaultLogAlert_5_3") } end end diff --git a/test/integration/verify/controls/azurerm_monitor_log_profile.rb b/test/integration/verify/controls/azurerm_monitor_log_profile.rb index 9667c670f..01793b200 100644 --- a/test/integration/verify/controls/azurerm_monitor_log_profile.rb +++ b/test/integration/verify/controls/azurerm_monitor_log_profile.rb @@ -1,13 +1,13 @@ -log_profile = input('log_profile_name', value: nil) +log_profile = input("log_profile_name", value: nil) -control 'azurerm_monitor_log_profile' do +control "azurerm_monitor_log_profile" do - title 'Testing the singular resource of azurerm_monitor_log_profile.' - desc 'Testing the singular resource of azurerm_monitor_log_profile.' + title "Testing the singular resource of azurerm_monitor_log_profile." + desc "Testing the singular resource of azurerm_monitor_log_profile." describe azurerm_monitor_log_profile(name: log_profile) do it { should exist } - its('retention_enabled') { should be true } - its('retention_days') { should eq(365) } + its("retention_enabled") { should be true } + its("retention_days") { should eq(365) } end end diff --git a/test/integration/verify/controls/azurerm_monitor_log_profiles.rb b/test/integration/verify/controls/azurerm_monitor_log_profiles.rb index 4bad132e5..92f9195c3 100644 --- a/test/integration/verify/controls/azurerm_monitor_log_profiles.rb +++ b/test/integration/verify/controls/azurerm_monitor_log_profiles.rb @@ -1,12 +1,12 @@ -log_profile = input('log_profile_name', value: nil) +log_profile = input("log_profile_name", value: nil) -control 'azurerm_monitor_log_profiles' do +control "azurerm_monitor_log_profiles" do - title 'Testing the plural resource of azurerm_monitor_log_profiles.' - desc 'Testing the plural resource of azurerm_monitor_log_profiles.' + title "Testing the plural resource of azurerm_monitor_log_profiles." + desc "Testing the plural resource of azurerm_monitor_log_profiles." describe azurerm_monitor_log_profiles do - its('names') { should include(log_profile) } + its("names") { should include(log_profile) } end azure_monitor_log_profiles.ids.each do |id| diff --git a/test/integration/verify/controls/azurerm_mysql_database.rb b/test/integration/verify/controls/azurerm_mysql_database.rb index 129e74a33..419f8e975 100644 --- a/test/integration/verify/controls/azurerm_mysql_database.rb +++ b/test/integration/verify/controls/azurerm_mysql_database.rb @@ -1,19 +1,19 @@ -resource_group = input('resource_group', value: nil) -mysql_server_name = input('mysql_server_name', value: nil) -mysql_db_name = input('mysql_database_name', value: nil) +resource_group = input("resource_group", value: nil) +mysql_server_name = input("mysql_server_name", value: nil) +mysql_db_name = input("mysql_database_name", value: nil) -control 'azurerm_mysql_database' do +control "azurerm_mysql_database" do - title 'Testing the singular resource of azurerm_mysql_database.' - desc 'Testing the singular resource of azurerm_mysql_database.' + title "Testing the singular resource of azurerm_mysql_database." + desc "Testing the singular resource of azurerm_mysql_database." only_if { !mysql_db_name.nil? } describe azurerm_mysql_database(resource_group: resource_group, server_name: mysql_server_name, database_name: mysql_db_name) do - it { should exist } - its('id') { should_not be_nil } - its('name') { should eq mysql_db_name } - its('type') { should eq 'Microsoft.DBforMySQL/servers/databases' } - end + it { should exist } + its("id") { should_not be_nil } + its("name") { should eq mysql_db_name } + its("type") { should eq "Microsoft.DBforMySQL/servers/databases" } + end end diff --git a/test/integration/verify/controls/azurerm_mysql_databases.rb b/test/integration/verify/controls/azurerm_mysql_databases.rb index c8048c43c..e41cdfa00 100644 --- a/test/integration/verify/controls/azurerm_mysql_databases.rb +++ b/test/integration/verify/controls/azurerm_mysql_databases.rb @@ -1,16 +1,16 @@ -resource_group = input('resource_group', value: nil) -mysql_server_name = input('mysql_server_name', value: nil) -mysql_server_database = input('mysql_database_name', value: nil) +resource_group = input("resource_group", value: nil) +mysql_server_name = input("mysql_server_name", value: nil) +mysql_server_database = input("mysql_database_name", value: nil) -control 'azurerm_mysql_databases' do +control "azurerm_mysql_databases" do - title 'Testing the plural resource of azurerm_mysql_databases.' - desc 'Testing the plural resource of azurerm_mysql_databases.' + title "Testing the plural resource of azurerm_mysql_databases." + desc "Testing the plural resource of azurerm_mysql_databases." only_if { !mysql_server_database.nil? } describe azurerm_mysql_databases(resource_group: resource_group, server_name: mysql_server_name) do it { should exist } - its('names') { should include mysql_server_database } + its("names") { should include mysql_server_database } end end diff --git a/test/integration/verify/controls/azurerm_mysql_server.rb b/test/integration/verify/controls/azurerm_mysql_server.rb index eb1cf8736..86cc26539 100644 --- a/test/integration/verify/controls/azurerm_mysql_server.rb +++ b/test/integration/verify/controls/azurerm_mysql_server.rb @@ -1,32 +1,32 @@ -resource_group = input('resource_group', value: nil) -mysql_server_name = input('mysql_server_name', value: nil) +resource_group = input("resource_group", value: nil) +mysql_server_name = input("mysql_server_name", value: nil) -control 'azurerm_mysql_server' do +control "azurerm_mysql_server" do - title 'Testing the singular resource of azure_streaming_analytics_function.' - desc 'Testing the singular resource of azure_streaming_analytics_function.' + title "Testing the singular resource of azure_streaming_analytics_function." + desc "Testing the singular resource of azure_streaming_analytics_function." only_if { !mysql_server_name.nil? } describe azurerm_mysql_server(resource_group: resource_group, server_name: mysql_server_name) do it { should exist } - its('id') { should_not be_nil } - its('name') { should eq mysql_server_name } - its('sku') { should_not be_nil } - its('location') { should_not be_nil } - its('type') { should eq 'Microsoft.DBforMySQL/servers' } - its('properties') { should have_attributes(version: '5.7') } + its("id") { should_not be_nil } + its("name") { should eq mysql_server_name } + its("sku") { should_not be_nil } + its("location") { should_not be_nil } + its("type") { should eq "Microsoft.DBforMySQL/servers" } + its("properties") { should have_attributes(version: "5.7") } end end -control 'azure_mysql_server' do +control "azure_mysql_server" do - title 'Testing the singular resource of azure_mysql_server.' - desc 'Testing the singular resource of azure_mysql_server.' + title "Testing the singular resource of azure_mysql_server." + desc "Testing the singular resource of azure_mysql_server." resource_id = azure_mysql_server(resource_group: resource_group, server_name: mysql_server_name).id describe azure_mysql_server(resource_id: resource_id) do it { should exist } - its('name') { should eq mysql_server_name } + its("name") { should eq mysql_server_name } end end diff --git a/test/integration/verify/controls/azurerm_mysql_servers.rb b/test/integration/verify/controls/azurerm_mysql_servers.rb index 64516f4df..11cffadf0 100644 --- a/test/integration/verify/controls/azurerm_mysql_servers.rb +++ b/test/integration/verify/controls/azurerm_mysql_servers.rb @@ -1,20 +1,20 @@ -resource_group = input('resource_group', value: nil) -mysql_server_name = input('mysql_server_name', value: nil) +resource_group = input("resource_group", value: nil) +mysql_server_name = input("mysql_server_name", value: nil) -control 'azurerm_mysql_servers' do +control "azurerm_mysql_servers" do - title 'Testing the plural resource of azurerm_mysql_servers.' - desc 'Testing the plural resource of azurerm_mysql_servers.' + title "Testing the plural resource of azurerm_mysql_servers." + desc "Testing the plural resource of azurerm_mysql_servers." only_if { !mysql_server_name.nil? } describe azurerm_mysql_servers(resource_group: resource_group) do it { should exist } - its('names') { should include mysql_server_name } + its("names") { should include mysql_server_name } end describe azurerm_mysql_servers do it { should exist } - its('names') { should include mysql_server_name } + its("names") { should include mysql_server_name } end end diff --git a/test/integration/verify/controls/azurerm_network_interface.rb b/test/integration/verify/controls/azurerm_network_interface.rb index a7be31f5c..13dbcadeb 100644 --- a/test/integration/verify/controls/azurerm_network_interface.rb +++ b/test/integration/verify/controls/azurerm_network_interface.rb @@ -1,17 +1,17 @@ -resource_group = attribute('resource_group', value: nil) -nic_name = attribute('windows_vm_nic_name', value: nil) +resource_group = attribute("resource_group", value: nil) +nic_name = attribute("windows_vm_nic_name", value: nil) -control 'azurerm_network_interface' do +control "azurerm_network_interface" do - title 'Testing the singular resource of azurerm_network_interface.' - desc 'Testing the singular resource of azurerm_network_interface.' + title "Testing the singular resource of azurerm_network_interface." + desc "Testing the singular resource of azurerm_network_interface." describe azurerm_network_interface(resource_group: resource_group, name: nic_name) do it { should exist } - its('id') { should_not be_nil } - its('name') { should eq nic_name } - its('location') { should_not be_nil } - its('type') { should eq 'Microsoft.Network/networkInterfaces' } + its("id") { should_not be_nil } + its("name") { should eq nic_name } + its("location") { should_not be_nil } + its("type") { should eq "Microsoft.Network/networkInterfaces" } it { should have_private_address_ip } end end diff --git a/test/integration/verify/controls/azurerm_network_interfaces.rb b/test/integration/verify/controls/azurerm_network_interfaces.rb index e3b919f86..7ea87e4e7 100644 --- a/test/integration/verify/controls/azurerm_network_interfaces.rb +++ b/test/integration/verify/controls/azurerm_network_interfaces.rb @@ -1,13 +1,13 @@ -resource_group = attribute('resource_group', value: nil) -nic_name = attribute('windows_vm_nic_name', value: nil) +resource_group = attribute("resource_group", value: nil) +nic_name = attribute("windows_vm_nic_name", value: nil) -control 'azurerm_network_interfaces' do +control "azurerm_network_interfaces" do - title 'Testing the plural resource of azurerm_network_interfaces.' - desc 'Testing the plural resource of azurerm_network_interfaces.' + title "Testing the plural resource of azurerm_network_interfaces." + desc "Testing the plural resource of azurerm_network_interfaces." describe azurerm_network_interfaces(resource_group: resource_group) do it { should exist } - its('names') { should include nic_name } + its("names") { should include nic_name } end end diff --git a/test/integration/verify/controls/azurerm_network_security_group.rb b/test/integration/verify/controls/azurerm_network_security_group.rb index b3b29c0e9..01cac81b3 100644 --- a/test/integration/verify/controls/azurerm_network_security_group.rb +++ b/test/integration/verify/controls/azurerm_network_security_group.rb @@ -1,49 +1,49 @@ -resource_group = input('resource_group', value: nil) -nsg = input('network_security_group', value: nil) -nsg_id = input('network_security_group_id', value: nil) -nsg_insecure = input('network_security_group_insecure', value: nil) -nsg_open = input('network_security_group_open', value: nil) +resource_group = input("resource_group", value: nil) +nsg = input("network_security_group", value: nil) +nsg_id = input("network_security_group_id", value: nil) +nsg_insecure = input("network_security_group_insecure", value: nil) +nsg_open = input("network_security_group_open", value: nil) -control 'azurerm_network_security_group' do +control "azurerm_network_security_group" do - title 'Testing the singular resource of azure_network_security_group.' - desc 'Testing the singular resource of azure_network_security_group.' + title "Testing the singular resource of azure_network_security_group." + desc "Testing the singular resource of azure_network_security_group." describe azurerm_network_security_group(resource_group: resource_group, name: nsg) do it { should exist } - its('id') { should eq nsg_id } - its('name') { should eq nsg } - its('type') { should eq 'Microsoft.Network/networkSecurityGroups' } - its('security_rules') { should be_empty } - its('default_security_rules') { should_not be_empty } + its("id") { should eq nsg_id } + its("name") { should eq nsg } + its("type") { should eq "Microsoft.Network/networkSecurityGroups" } + its("security_rules") { should be_empty } + its("default_security_rules") { should_not be_empty } it { should_not allow_rdp_from_internet } it { should_not allow_ssh_from_internet } - it { should_not allow_port_from_internet('1433') } - it { should_not allow_port_from_internet('1521') } - it { should_not allow_port_from_internet('4333') } - it { should_not allow_port_from_internet('5432') } - it { should_not allow_port_from_internet('139') } - it { should_not allow_port_from_internet('1433') } - it { should_not allow_port_from_internet('445') } - it { should_not allow_port_from_internet('1433') } - it { should_not allow_port_from_internet('21') } - it { should_not allow_port_from_internet('69') } + it { should_not allow_port_from_internet("1433") } + it { should_not allow_port_from_internet("1521") } + it { should_not allow_port_from_internet("4333") } + it { should_not allow_port_from_internet("5432") } + it { should_not allow_port_from_internet("139") } + it { should_not allow_port_from_internet("1433") } + it { should_not allow_port_from_internet("445") } + it { should_not allow_port_from_internet("1433") } + it { should_not allow_port_from_internet("21") } + it { should_not allow_port_from_internet("69") } end describe azurerm_network_security_group(resource_group: resource_group, name: nsg_insecure) do it { should exist } it { should allow_rdp_from_internet } it { should allow_ssh_from_internet } - it { should allow_port_from_internet('1433') } - it { should allow_port_from_internet('1521') } - it { should allow_port_from_internet('4333') } - it { should allow_port_from_internet('5432') } - it { should allow_port_from_internet('139') } - it { should allow_port_from_internet('1433') } - it { should allow_port_from_internet('445') } - it { should allow_port_from_internet('1433') } - it { should allow_port_from_internet('21') } - it { should allow_port_from_internet('69') } + it { should allow_port_from_internet("1433") } + it { should allow_port_from_internet("1521") } + it { should allow_port_from_internet("4333") } + it { should allow_port_from_internet("5432") } + it { should allow_port_from_internet("139") } + it { should allow_port_from_internet("1433") } + it { should allow_port_from_internet("445") } + it { should allow_port_from_internet("1433") } + it { should allow_port_from_internet("21") } + it { should allow_port_from_internet("69") } end describe azurerm_network_security_group(resource_group: resource_group, name: nsg_open) do @@ -52,29 +52,29 @@ it { should allow_ssh_from_internet } end - describe azurerm_network_security_group(resource_group: resource_group, name: 'fake') do + describe azurerm_network_security_group(resource_group: resource_group, name: "fake") do it { should_not exist } end - describe azurerm_network_security_group(resource_group: 'does-not-exist', name: nsg) do + describe azurerm_network_security_group(resource_group: "does-not-exist", name: nsg) do it { should_not exist } end end -control 'azure_network_security_group' do +control "azure_network_security_group" do - title 'Testing the singular resource of azure_network_security_group.' - desc 'Testing the singular resource of azure_network_security_group.' + title "Testing the singular resource of azure_network_security_group." + desc "Testing the singular resource of azure_network_security_group." describe azure_network_security_group(resource_group: resource_group, name: nsg_insecure) do - it { should allow_in(ip_range: '0.0.0.0', port: '22') } + it { should allow_in(ip_range: "0.0.0.0", port: "22") } it { should_not allow_udp_from_internet } - its('flow_log_retention_period') { should eq 0 } - it { should allow(source_ip_range: '0.0.0.0', destination_port: '22', direction: 'inbound') } - it { should allow_in(service_tag: 'Internet', port: %w{1433-1434 1521 4300-4350 5000-6000}) } - it { should allow(source_service_tag: 'Internet', destination_port: %w{1433-1434 1521 4300-4350 5000-6000}, direction: 'inbound') } - it { should allow_in(service_tag: 'Internet', port: '3389') } - it { should allow(source_service_tag: 'Internet', destination_port: '3389', direction: 'inbound') } + its("flow_log_retention_period") { should eq 0 } + it { should allow(source_ip_range: "0.0.0.0", destination_port: "22", direction: "inbound") } + it { should allow_in(service_tag: "Internet", port: %w{1433-1434 1521 4300-4350 5000-6000}) } + it { should allow(source_service_tag: "Internet", destination_port: %w{1433-1434 1521 4300-4350 5000-6000}, direction: "inbound") } + it { should allow_in(service_tag: "Internet", port: "3389") } + it { should allow(source_service_tag: "Internet", destination_port: "3389", direction: "inbound") } end end diff --git a/test/integration/verify/controls/azurerm_network_security_groups.rb b/test/integration/verify/controls/azurerm_network_security_groups.rb index d366212e2..aba995c6a 100644 --- a/test/integration/verify/controls/azurerm_network_security_groups.rb +++ b/test/integration/verify/controls/azurerm_network_security_groups.rb @@ -1,20 +1,20 @@ -resource_group = input('resource_group', value: nil) +resource_group = input("resource_group", value: nil) -control 'azurerm_network_security_groups' do +control "azurerm_network_security_groups" do - title 'Testing the plural resource of azure_network_security_groups.' - desc 'Testing the plural resource of azure_network_security_groups.' + title "Testing the plural resource of azure_network_security_groups." + desc "Testing the plural resource of azure_network_security_groups." describe azurerm_network_security_groups(resource_group: resource_group) do it { should exist } - its('names') { should be_an(Array) } + its("names") { should be_an(Array) } end end -control 'azure_network_security_groups' do +control "azure_network_security_groups" do - title 'Ensure that the resource tests all network security groups in a subscription.' - desc 'Testing the plural resource of azure_network_security_groups.' + title "Ensure that the resource tests all network security groups in a subscription." + desc "Testing the plural resource of azure_network_security_groups." describe azure_network_security_groups do it { should exist } diff --git a/test/integration/verify/controls/azurerm_network_watcher.rb b/test/integration/verify/controls/azurerm_network_watcher.rb index ac740c997..d698dcabe 100644 --- a/test/integration/verify/controls/azurerm_network_watcher.rb +++ b/test/integration/verify/controls/azurerm_network_watcher.rb @@ -1,27 +1,27 @@ -resource_group = input('resource_group', value: nil) -nw = input('network_watcher_name', value: []).first -nw_id = input('network_watcher_id', value: []).first +resource_group = input("resource_group", value: nil) +nw = input("network_watcher_name", value: []).first +nw_id = input("network_watcher_id", value: []).first -control 'azurerm_network_watcher' do +control "azurerm_network_watcher" do - title 'Testing the singular resource of azurerm_network_watcher.' - desc 'Testing the singular resource of azurerm_network_watcher.' + title "Testing the singular resource of azurerm_network_watcher." + desc "Testing the singular resource of azurerm_network_watcher." only_if { !nw.nil? } describe azurerm_network_watcher(resource_group: resource_group, name: nw) do it { should exist } - its('id') { should eq nw_id } - its('name') { should eq nw } - its('type') { should eq 'Microsoft.Network/networkWatchers' } - its('provisioning_state') { should eq 'Succeeded' } + its("id") { should eq nw_id } + its("name") { should eq nw } + its("type") { should eq "Microsoft.Network/networkWatchers" } + its("provisioning_state") { should eq "Succeeded" } end - describe azurerm_network_watcher(resource_group: resource_group, name: 'fake') do + describe azurerm_network_watcher(resource_group: resource_group, name: "fake") do it { should_not exist } end - describe azurerm_network_watcher(resource_group: 'does-not-exist', name: nw) do + describe azurerm_network_watcher(resource_group: "does-not-exist", name: nw) do it { should_not exist } end end diff --git a/test/integration/verify/controls/azurerm_network_watchers.rb b/test/integration/verify/controls/azurerm_network_watchers.rb index ce322c639..384c3b63e 100644 --- a/test/integration/verify/controls/azurerm_network_watchers.rb +++ b/test/integration/verify/controls/azurerm_network_watchers.rb @@ -1,23 +1,23 @@ -resource_group = input('resource_group', value: nil) -nw = input('network_watcher_name', value: []).first +resource_group = input("resource_group", value: nil) +nw = input("network_watcher_name", value: []).first -control 'azurerm_network_watchers' do +control "azurerm_network_watchers" do - title 'Testing the plural resource of azurerm_network_watchers.' - desc 'Testing the plural resource of azurerm_network_watchers.' + title "Testing the plural resource of azurerm_network_watchers." + desc "Testing the plural resource of azurerm_network_watchers." only_if { !nw.nil? } describe azurerm_network_watchers(resource_group: resource_group) do it { should exist } - its('names') { should be_an(Array) } + its("names") { should be_an(Array) } end end -control 'azure_network_watchers' do +control "azure_network_watchers" do - title 'Testing the plural resource of azurerm_network_watchers.' - desc 'Testing the plural resource of azurerm_network_watchers.' + title "Testing the plural resource of azurerm_network_watchers." + desc "Testing the plural resource of azurerm_network_watchers." only_if { !nw.nil? } @@ -27,7 +27,7 @@ end end - describe azure_network_watcher(resource_id: 'dummy') do + describe azure_network_watcher(resource_id: "dummy") do it { should_not exist } end end diff --git a/test/integration/verify/controls/azurerm_postgresql_database.rb b/test/integration/verify/controls/azurerm_postgresql_database.rb index 2ce934b82..016dd20e7 100644 --- a/test/integration/verify/controls/azurerm_postgresql_database.rb +++ b/test/integration/verify/controls/azurerm_postgresql_database.rb @@ -1,20 +1,20 @@ -resource_group = input('resource_group', value: nil) -postgresql_server_name = input('postgresql_server_name', value: nil) -postgresql_database_name = input('postgresql_database_name', value: nil) +resource_group = input("resource_group", value: nil) +postgresql_server_name = input("postgresql_server_name", value: nil) +postgresql_database_name = input("postgresql_database_name", value: nil) -control 'azurerm_postgresql_database' do +control "azurerm_postgresql_database" do - title 'Testing the singular resource of azurerm_postgresql_database.' - desc 'Testing the singular resource of azurerm_postgresql_database.' + title "Testing the singular resource of azurerm_postgresql_database." + desc "Testing the singular resource of azurerm_postgresql_database." only_if { !postgresql_database_name.nil? } describe azurerm_postgresql_database(resource_group: resource_group, server_name: postgresql_server_name, database_name: postgresql_database_name) do - it { should exist } - its('id') { should_not be_nil } - its('name') { should eq postgresql_database_name } - its('type') { should eq 'Microsoft.DBforPostgreSQL/servers/databases' } - end + it { should exist } + its("id") { should_not be_nil } + its("name") { should eq postgresql_database_name } + its("type") { should eq "Microsoft.DBforPostgreSQL/servers/databases" } + end end diff --git a/test/integration/verify/controls/azurerm_postgresql_databases.rb b/test/integration/verify/controls/azurerm_postgresql_databases.rb index 711268c76..25021903c 100644 --- a/test/integration/verify/controls/azurerm_postgresql_databases.rb +++ b/test/integration/verify/controls/azurerm_postgresql_databases.rb @@ -1,16 +1,16 @@ -resource_group = input('resource_group', value: nil) -postgresql_server_name = input('postgresql_server_name', value: nil) -postgresql_database_name = input('postgresql_database_name', value: nil) +resource_group = input("resource_group", value: nil) +postgresql_server_name = input("postgresql_server_name", value: nil) +postgresql_database_name = input("postgresql_database_name", value: nil) -control 'azurerm_postgresql_databases' do +control "azurerm_postgresql_databases" do - title 'Testing the plural resource of azurerm_postgresql_databases.' - desc 'Testing the plural resource of azurerm_postgresql_databases.' + title "Testing the plural resource of azurerm_postgresql_databases." + desc "Testing the plural resource of azurerm_postgresql_databases." only_if { !postgresql_database_name.nil? } describe azurerm_postgresql_databases(resource_group: resource_group, server_name: postgresql_server_name) do it { should exist } - its('names') { should include postgresql_database_name } + its("names") { should include postgresql_database_name } end end diff --git a/test/integration/verify/controls/azurerm_postgresql_server.rb b/test/integration/verify/controls/azurerm_postgresql_server.rb index 59a162494..df0fa63a2 100644 --- a/test/integration/verify/controls/azurerm_postgresql_server.rb +++ b/test/integration/verify/controls/azurerm_postgresql_server.rb @@ -1,31 +1,31 @@ -resource_group = input('resource_group', value: nil) -postgresql_server_name = input('postgresql_server_name', value: nil) +resource_group = input("resource_group", value: nil) +postgresql_server_name = input("postgresql_server_name", value: nil) -control 'azurerm_postgresql_server' do +control "azurerm_postgresql_server" do - title 'Testing the singular resource of azurerm_postgresql_server.' - desc 'Testing the singular resource of azurerm_postgresql_server.' + title "Testing the singular resource of azurerm_postgresql_server." + desc "Testing the singular resource of azurerm_postgresql_server." only_if { !postgresql_server_name.nil? } describe azurerm_postgresql_server(resource_group: resource_group, server_name: postgresql_server_name) do it { should exist } - its('id') { should_not be_nil } - its('name') { should eq postgresql_server_name } - its('sku') { should_not be_nil } - its('location') { should_not be_nil } - its('type') { should cmp 'Microsoft.DBforPostgreSQL/servers' } - its('properties') { should have_attributes(version: '9.5') } + its("id") { should_not be_nil } + its("name") { should eq postgresql_server_name } + its("sku") { should_not be_nil } + its("location") { should_not be_nil } + its("type") { should cmp "Microsoft.DBforPostgreSQL/servers" } + its("properties") { should have_attributes(version: "9.5") } end end -control 'azure_postgresql_server-firewall_rules-checking' do - title 'Checking the firewall rules for singular resource of azure_postgresql_server.' - desc 'Checking the firewall rules for singular resource of azure_postgresql_server.' +control "azure_postgresql_server-firewall_rules-checking" do + title "Checking the firewall rules for singular resource of azure_postgresql_server." + desc "Checking the firewall rules for singular resource of azure_postgresql_server." only_if { !postgresql_server_name.nil? } describe azure_postgresql_server(resource_group: resource_group, server_name: postgresql_server_name) do - its('firewall_rules') { should be_empty } # We can also use its('firewall_rules') { should eq {} } + its("firewall_rules") { should be_empty } # We can also use its('firewall_rules') { should eq {} } end end diff --git a/test/integration/verify/controls/azurerm_postgresql_servers.rb b/test/integration/verify/controls/azurerm_postgresql_servers.rb index 2ee429b9f..0a9a0f52f 100644 --- a/test/integration/verify/controls/azurerm_postgresql_servers.rb +++ b/test/integration/verify/controls/azurerm_postgresql_servers.rb @@ -1,21 +1,21 @@ -resource_group = input('resource_group', value: nil) -postgresql_server_name = input('postgresql_server_name', value: nil) +resource_group = input("resource_group", value: nil) +postgresql_server_name = input("postgresql_server_name", value: nil) -control 'azurerm_postgresql_servers' do +control "azurerm_postgresql_servers" do - title 'Testing the plural resource of azurerm_postgresql_servers.' - desc 'Testing the plural resource of azurerm_postgresql_servers.' + title "Testing the plural resource of azurerm_postgresql_servers." + desc "Testing the plural resource of azurerm_postgresql_servers." only_if { !postgresql_server_name.nil? } describe azurerm_postgresql_servers(resource_group: resource_group) do it { should exist } - its('names') { should include postgresql_server_name } + its("names") { should include postgresql_server_name } end describe azurerm_postgresql_servers do it { should exist } - its('names') { should include postgresql_server_name } + its("names") { should include postgresql_server_name } end azure_postgresql_servers.ids.each do |id| diff --git a/test/integration/verify/controls/azurerm_public_ip.rb b/test/integration/verify/controls/azurerm_public_ip.rb index 435ea6783..6d9b90a69 100644 --- a/test/integration/verify/controls/azurerm_public_ip.rb +++ b/test/integration/verify/controls/azurerm_public_ip.rb @@ -1,25 +1,25 @@ -resource_group = input('resource_group', value: nil) -address_name = input('ip_address_name', value: '') +resource_group = input("resource_group", value: nil) +address_name = input("ip_address_name", value: "") -control 'azurerm_public_ip' do +control "azurerm_public_ip" do - title 'Testing the singular resource of azurerm_public_ip.' - desc 'Testing the singular resource of azurerm_public_ip.' + title "Testing the singular resource of azurerm_public_ip." + desc "Testing the singular resource of azurerm_public_ip." only_if { !address_name.empty? } describe azurerm_public_ip(resource_group: resource_group, name: address_name) do it { should exist } - its('name') { should cmp address_name } - its('type') { should cmp 'Microsoft.Network/publicIPAddresses' } - its('properties.provisioningState') { should cmp 'Succeeded' } - its('properties.publicIPAddressVersion') { should eq 'IPv4' } + its("name") { should cmp address_name } + its("type") { should cmp "Microsoft.Network/publicIPAddresses" } + its("properties.provisioningState") { should cmp "Succeeded" } + its("properties.publicIPAddressVersion") { should eq "IPv4" } end - describe azurerm_public_ip(resource_group: resource_group, name: 'fake') do + describe azurerm_public_ip(resource_group: resource_group, name: "fake") do it { should_not exist } end - describe azurerm_public_ip(resource_group: 'does-not-exist', name: 'fake') do + describe azurerm_public_ip(resource_group: "does-not-exist", name: "fake") do it { should_not exist } end end diff --git a/test/integration/verify/controls/azurerm_resource_groups.rb b/test/integration/verify/controls/azurerm_resource_groups.rb index b39c70ce3..6bf910787 100644 --- a/test/integration/verify/controls/azurerm_resource_groups.rb +++ b/test/integration/verify/controls/azurerm_resource_groups.rb @@ -1,28 +1,28 @@ -resource_group = input('resource_group', value: nil) +resource_group = input("resource_group", value: nil) # Added to test `inspec check` command resource_group_names = azure_resource_groups.names -control 'azurerm_resource_groups' do +control "azurerm_resource_groups" do - title 'Testing the plural resource of azure_resource_groups.' - desc 'Testing the plural resource of azure_resource_groups.' + title "Testing the plural resource of azure_resource_groups." + desc "Testing the plural resource of azure_resource_groups." describe azurerm_resource_groups do it { should exist } - its('names') { should include(resource_group) } - its('names.size') { should eq resource_group_names.size } + its("names") { should include(resource_group) } + its("names.size") { should eq resource_group_names.size } end describe azurerm_resource_groups.where(name: resource_group) do - its('tags.first') { should include('ExampleTag'=>'example') } + its("tags.first") { should include("ExampleTag"=>"example") } end end -control 'azure_resource_groups_loop' do +control "azure_resource_groups_loop" do - title 'Testing the plural resource of azure_resource_groups.' - desc 'Testing the plural resource of azure_resource_groups.' + title "Testing the plural resource of azure_resource_groups." + desc "Testing the plural resource of azure_resource_groups." azure_resource_groups.ids.each do |id| describe azure_resource_group(resource_id: id) do diff --git a/test/integration/verify/controls/azurerm_role_definition.rb b/test/integration/verify/controls/azurerm_role_definition.rb index c55098a33..6bf792fe7 100644 --- a/test/integration/verify/controls/azurerm_role_definition.rb +++ b/test/integration/verify/controls/azurerm_role_definition.rb @@ -1,16 +1,16 @@ -contributor_name = input('contributor_role_name', value: nil) +contributor_name = input("contributor_role_name", value: nil) -control 'azurerm_role_definition' do +control "azurerm_role_definition" do - title 'Testing the singular resource of azurerm_role_definition.' - desc 'Testing the singular resource of azurerm_role_definition.' + title "Testing the singular resource of azurerm_role_definition." + desc "Testing the singular resource of azurerm_role_definition." describe azurerm_role_definition(name: contributor_name) do it { should exist } - its('permissions_allowed') { should include '*' } - its('role_name') { should cmp 'Contributor' } - its('assignable_scopes') { should cmp '/' } - its('permissions_allowed') { should cmp '*' } - its('permissions_not_allowed') { should include 'Microsoft.Authorization/*/Delete' } + its("permissions_allowed") { should include "*" } + its("role_name") { should cmp "Contributor" } + its("assignable_scopes") { should cmp "/" } + its("permissions_allowed") { should cmp "*" } + its("permissions_not_allowed") { should include "Microsoft.Authorization/*/Delete" } end end diff --git a/test/integration/verify/controls/azurerm_role_definitions.rb b/test/integration/verify/controls/azurerm_role_definitions.rb index 1bc0e1d23..752197b93 100644 --- a/test/integration/verify/controls/azurerm_role_definitions.rb +++ b/test/integration/verify/controls/azurerm_role_definitions.rb @@ -1,13 +1,13 @@ -contributor_name = input('contributor_role_name', value: nil) +contributor_name = input("contributor_role_name", value: nil) -control 'azurerm_role_definitions' do +control "azurerm_role_definitions" do - title 'Testing the plural resource of azurerm_role_definitions.' - desc 'Testing the plural resource of azurerm_role_definitions.' + title "Testing the plural resource of azurerm_role_definitions." + desc "Testing the plural resource of azurerm_role_definitions." describe azurerm_role_definitions.where(name: contributor_name) do - its('names') { should include contributor_name } - its('properties.first') { should have_attributes(roleName: 'Contributor') } - its('properties.first.permissions.first') { should have_attributes(actions: ['*']) } + its("names") { should include contributor_name } + its("properties.first") { should have_attributes(roleName: "Contributor") } + its("properties.first.permissions.first") { should have_attributes(actions: ["*"]) } end end diff --git a/test/integration/verify/controls/azurerm_security_center_policies.rb b/test/integration/verify/controls/azurerm_security_center_policies.rb index a2d86fca1..63dcf8a8e 100644 --- a/test/integration/verify/controls/azurerm_security_center_policies.rb +++ b/test/integration/verify/controls/azurerm_security_center_policies.rb @@ -1,10 +1,10 @@ -control 'azurerm_security_center_policies' do +control "azurerm_security_center_policies" do - title 'Testing the plural resource of azurerm_security_center_policies.' - desc 'Testing the plural resource of azurerm_security_center_policies.' + title "Testing the plural resource of azurerm_security_center_policies." + desc "Testing the plural resource of azurerm_security_center_policies." describe azurerm_security_center_policies do it { should exist } - its('policy_names') { should include('default') } + its("policy_names") { should include("default") } end end diff --git a/test/integration/verify/controls/azurerm_security_center_policy.rb b/test/integration/verify/controls/azurerm_security_center_policy.rb index 33f2bbc8c..3edf9a038 100644 --- a/test/integration/verify/controls/azurerm_security_center_policy.rb +++ b/test/integration/verify/controls/azurerm_security_center_policy.rb @@ -1,6 +1,6 @@ -control 'azurerm_security_center_policy' do +control "azurerm_security_center_policy" do - title 'Testing the singular resource of azurerm_role_definition.' + title "Testing the singular resource of azurerm_role_definition." desc <<-DESC This control is asserting state on global settings outside the control of Terraform. I will only be asserting on the expectation that things will be @@ -12,30 +12,30 @@ Security Policy names match resource group names. DESC - describe azurerm_security_center_policy(name: 'default') do + describe azurerm_security_center_policy(name: "default") do it { should exist } # if this fails run 'az security auto-provisioning-setting update -n "default" --auto-provision "On"' it { should have_auto_provisioning_enabled } - its('id') { should eq("/subscriptions/#{ENV['AZURE_SUBSCRIPTION_ID']}/providers/Microsoft.Security/policies/default") } - its('name') { should eq('default') } - its('log_collection') { should eq('On').or eq('Off') } - its('pricing_tier') { should eq('Standard').or eq('Free') } - its('patch') { should eq('On').or eq('Off') } - its('baseline') { should eq('On').or eq('Off') } - its('anti_malware') { should eq('On').or eq('Off') } - its('disk_encryption') { should eq('On').or eq('Off') } - its('network_security_groups') { should eq('On').or eq('Off') } - its('web_application_firewall') { should eq('On').or eq('Off') } - its('next_generation_firewall') { should eq('On').or eq('Off') } - its('vulnerability_assessment') { should eq('On').or eq('Off') } - its('just_in_time_network_access') { should eq('On').or eq('Off') } - its('app_whitelisting') { should eq('On').or eq('Off') } - its('sql_auditing') { should eq('On').or eq('Off') } - its('sql_transparent_data_encryption') { should eq('On').or eq('Off') } - its('notifications_enabled') { should eq(true).or eq(false) } - its('send_security_email_to_admin') { should eq(true).or eq(false) } - its('contact_emails') { should_not be_nil } - its('contact_phone') { should_not be_nil } - its('default_policy') { is_expected.to respond_to(:properties) } + its("id") { should eq("/subscriptions/#{ENV["AZURE_SUBSCRIPTION_ID"]}/providers/Microsoft.Security/policies/default") } + its("name") { should eq("default") } + its("log_collection") { should eq("On").or eq("Off") } + its("pricing_tier") { should eq("Standard").or eq("Free") } + its("patch") { should eq("On").or eq("Off") } + its("baseline") { should eq("On").or eq("Off") } + its("anti_malware") { should eq("On").or eq("Off") } + its("disk_encryption") { should eq("On").or eq("Off") } + its("network_security_groups") { should eq("On").or eq("Off") } + its("web_application_firewall") { should eq("On").or eq("Off") } + its("next_generation_firewall") { should eq("On").or eq("Off") } + its("vulnerability_assessment") { should eq("On").or eq("Off") } + its("just_in_time_network_access") { should eq("On").or eq("Off") } + its("app_whitelisting") { should eq("On").or eq("Off") } + its("sql_auditing") { should eq("On").or eq("Off") } + its("sql_transparent_data_encryption") { should eq("On").or eq("Off") } + its("notifications_enabled") { should eq(true).or eq(false) } + its("send_security_email_to_admin") { should eq(true).or eq(false) } + its("contact_emails") { should_not be_nil } + its("contact_phone") { should_not be_nil } + its("default_policy") { is_expected.to respond_to(:properties) } end end diff --git a/test/integration/verify/controls/azurerm_sql_database.rb b/test/integration/verify/controls/azurerm_sql_database.rb index 457805f8e..9feb87877 100644 --- a/test/integration/verify/controls/azurerm_sql_database.rb +++ b/test/integration/verify/controls/azurerm_sql_database.rb @@ -1,30 +1,30 @@ -resource_group = input('resource_group', value: nil) -sql_server_name = input('sql_server_name', value: nil) -sql_db_name = input('sql_database_name', value: nil) +resource_group = input("resource_group", value: nil) +sql_server_name = input("sql_server_name", value: nil) +sql_db_name = input("sql_database_name", value: nil) -control 'azurerm_sql_database' do +control "azurerm_sql_database" do - title 'Testing the singular resource of azure_sql_database.' - desc 'Testing the singular resource of azure_sql_database.' + title "Testing the singular resource of azure_sql_database." + desc "Testing the singular resource of azure_sql_database." only_if { !sql_db_name.nil? } describe azurerm_sql_database(resource_group: resource_group, server_name: sql_server_name, database_name: sql_db_name) do - it { should exist } - its('id') { should_not be_nil } - its('name') { should eq sql_db_name } - its('kind') { should_not be_nil } - its('location') { should_not be_nil } - its('type') { should eq 'Microsoft.Sql/servers/databases' } - end + it { should exist } + its("id") { should_not be_nil } + its("name") { should eq sql_db_name } + its("kind") { should_not be_nil } + its("location") { should_not be_nil } + its("type") { should eq "Microsoft.Sql/servers/databases" } + end end -control 'azure_sql_database' do +control "azure_sql_database" do - title 'Testing the singular resource of azure_sql_database.' - desc 'Testing the singular resource of azure_sql_database.' + title "Testing the singular resource of azure_sql_database." + desc "Testing the singular resource of azure_sql_database." only_if { !sql_db_name.nil? } @@ -33,6 +33,6 @@ name: sql_db_name).id describe azure_sql_database(resource_id: sql_db_id) do it { should exist } - its('name') { should eq sql_db_name } + its("name") { should eq sql_db_name } end end diff --git a/test/integration/verify/controls/azurerm_sql_databases.rb b/test/integration/verify/controls/azurerm_sql_databases.rb index ddbb034f2..27b7aa142 100644 --- a/test/integration/verify/controls/azurerm_sql_databases.rb +++ b/test/integration/verify/controls/azurerm_sql_databases.rb @@ -1,16 +1,16 @@ -resource_group = input('resource_group', value: nil) -sql_server_name = input('sql_server_name', value: nil) -sql_server_database = input('sql_database_name', value: nil) +resource_group = input("resource_group", value: nil) +sql_server_name = input("sql_server_name", value: nil) +sql_server_database = input("sql_database_name", value: nil) -control 'azurerm_sql_databases' do +control "azurerm_sql_databases" do - title 'Testing the plural resource of azurerm_sql_databases.' - desc 'Testing the plural resource of azurerm_sql_databases.' + title "Testing the plural resource of azurerm_sql_databases." + desc "Testing the plural resource of azurerm_sql_databases." only_if { !sql_server_database.nil? } describe azurerm_sql_databases(resource_group: resource_group, server_name: sql_server_name) do it { should exist } - its('names') { should include sql_server_database } + its("names") { should include sql_server_database } end end diff --git a/test/integration/verify/controls/azurerm_sql_server.rb b/test/integration/verify/controls/azurerm_sql_server.rb index aa89afd18..41c7825c4 100644 --- a/test/integration/verify/controls/azurerm_sql_server.rb +++ b/test/integration/verify/controls/azurerm_sql_server.rb @@ -1,20 +1,20 @@ -resource_group = input('resource_group', value: nil) -sql_server_name = input('sql_server_name', value: nil) +resource_group = input("resource_group", value: nil) +sql_server_name = input("sql_server_name", value: nil) -control 'azurerm_sql_server' do +control "azurerm_sql_server" do - title 'Testing the singular resource of azurerm_sql_server.' - desc 'Testing the singular resource of azurerm_sql_server.' + title "Testing the singular resource of azurerm_sql_server." + desc "Testing the singular resource of azurerm_sql_server." only_if { !sql_server_name.nil? } describe azurerm_sql_server(resource_group: resource_group, server_name: sql_server_name) do it { should exist } - its('id') { should_not be_nil } - its('name') { should eq sql_server_name } - its('kind') { should_not be_nil } - its('location') { should_not be_nil } - its('type') { should eq 'Microsoft.Sql/servers' } - its('properties') { should have_attributes(version: '12.0') } + its("id") { should_not be_nil } + its("name") { should eq sql_server_name } + its("kind") { should_not be_nil } + its("location") { should_not be_nil } + its("type") { should eq "Microsoft.Sql/servers" } + its("properties") { should have_attributes(version: "12.0") } end end diff --git a/test/integration/verify/controls/azurerm_sql_servers.rb b/test/integration/verify/controls/azurerm_sql_servers.rb index 532b000d3..b8452a27b 100644 --- a/test/integration/verify/controls/azurerm_sql_servers.rb +++ b/test/integration/verify/controls/azurerm_sql_servers.rb @@ -1,16 +1,16 @@ -resource_group = input('resource_group', value: nil) -sql_server_name = input('sql_server_name', value: nil) +resource_group = input("resource_group", value: nil) +sql_server_name = input("sql_server_name", value: nil) -control 'azurerm_sql_servers' do +control "azurerm_sql_servers" do - title 'Testing the plural resource of azurerm_sql_servers.' - desc 'Testing the plural resource of azurerm_sql_servers.' + title "Testing the plural resource of azurerm_sql_servers." + desc "Testing the plural resource of azurerm_sql_servers." only_if { !sql_server_name.nil? } describe azurerm_sql_servers(resource_group: resource_group) do it { should exist } - its('names') { should include sql_server_name } + its("names") { should include sql_server_name } end azure_sql_servers.ids.each do |id| diff --git a/test/integration/verify/controls/azurerm_storage_account_blob_container.rb b/test/integration/verify/controls/azurerm_storage_account_blob_container.rb index 00a2b64a9..7d1e9f9ed 100644 --- a/test/integration/verify/controls/azurerm_storage_account_blob_container.rb +++ b/test/integration/verify/controls/azurerm_storage_account_blob_container.rb @@ -1,16 +1,16 @@ -resource_group = input('resource_group', value: nil) -storage_account = input('storage_account', value: nil) -blob_container = input('storage_account_blob_container', value: nil) +resource_group = input("resource_group", value: nil) +storage_account = input("storage_account", value: nil) +blob_container = input("storage_account_blob_container", value: nil) -control 'azurerm_storage_account_blob_container' do +control "azurerm_storage_account_blob_container" do - title 'Testing the singular resource of azurerm_storage_account_blob_container.' - desc 'Testing the singular resource of azurerm_storage_account_blob_container.' + title "Testing the singular resource of azurerm_storage_account_blob_container." + desc "Testing the singular resource of azurerm_storage_account_blob_container." describe azurerm_storage_account_blob_container(resource_group: resource_group, storage_account_name: storage_account, blob_container_name: blob_container) do - it { should exist } - its('name') { should eq(blob_container) } - end + it { should exist } + its("name") { should eq(blob_container) } + end end diff --git a/test/integration/verify/controls/azurerm_storage_account_blob_containers.rb b/test/integration/verify/controls/azurerm_storage_account_blob_containers.rb index bd5c5a0f0..9727d167f 100644 --- a/test/integration/verify/controls/azurerm_storage_account_blob_containers.rb +++ b/test/integration/verify/controls/azurerm_storage_account_blob_containers.rb @@ -1,14 +1,14 @@ -resource_group = input('resource_group', value: nil) -storage_account = input('storage_account', value: nil) -blob_container = input('storage_account_blob_container', value: nil) +resource_group = input("resource_group", value: nil) +storage_account = input("storage_account", value: nil) +blob_container = input("storage_account_blob_container", value: nil) -control 'azurerm_storage_account_blob_containers' do +control "azurerm_storage_account_blob_containers" do - title 'Testing the plural resource of azurerm_storage_account_blob_containers.' - desc 'Testing the plural resource of azurerm_storage_account_blob_containers.' + title "Testing the plural resource of azurerm_storage_account_blob_containers." + desc "Testing the plural resource of azurerm_storage_account_blob_containers." describe azurerm_storage_account_blob_containers(resource_group: resource_group, storage_account_name: storage_account) do - its('names') { should include(blob_container) } - end + its("names") { should include(blob_container) } + end end diff --git a/test/integration/verify/controls/azurerm_subnet.rb b/test/integration/verify/controls/azurerm_subnet.rb index 2c8b25a58..2d446eac3 100644 --- a/test/integration/verify/controls/azurerm_subnet.rb +++ b/test/integration/verify/controls/azurerm_subnet.rb @@ -1,39 +1,39 @@ -resource_group = input('resource_group', value: nil) -name = input('subnet_name', value: nil) -id = input('subnet_id', value: nil) -vnet = input('vnet_name', value: nil) -address_prefix = input('subnet_address_prefix', value: nil) -nsg = input('subnet_nsg', value: nil) +resource_group = input("resource_group", value: nil) +name = input("subnet_name", value: nil) +id = input("subnet_id", value: nil) +vnet = input("vnet_name", value: nil) +address_prefix = input("subnet_address_prefix", value: nil) +nsg = input("subnet_nsg", value: nil) -control 'azurerm_subnet' do +control "azurerm_subnet" do - title 'Testing the singular resource of azurerm_subnet.' - desc 'Testing the singular resource of azurerm_subnet.' + title "Testing the singular resource of azurerm_subnet." + desc "Testing the singular resource of azurerm_subnet." describe azurerm_subnet(resource_group: resource_group, vnet: vnet, name: name) do it { should exist } - its('id') { should eq id } - its('name') { should eq name } - its('type') { should eq 'Microsoft.Network/virtualNetworks/subnets' } - its('address_prefix') { should eq address_prefix } - its('nsg') { should eq nsg } + its("id") { should eq id } + its("name") { should eq name } + its("type") { should eq "Microsoft.Network/virtualNetworks/subnets" } + its("address_prefix") { should eq address_prefix } + its("nsg") { should eq nsg } end - describe azurerm_subnet(resource_group: resource_group, vnet: vnet, name: 'fake') do + describe azurerm_subnet(resource_group: resource_group, vnet: vnet, name: "fake") do it { should_not exist } end - describe azurerm_subnet(resource_group: 'does-not-exist', vnet: vnet, name: name) do + describe azurerm_subnet(resource_group: "does-not-exist", vnet: vnet, name: name) do it { should_not exist } end end -control 'azure_subnet' do +control "azure_subnet" do - title 'Ensure that azure_subnet supports `resource_id` as a parameter.' - desc 'Testing the singular resource of azurerm_subnet.' + title "Ensure that azure_subnet supports `resource_id` as a parameter." + desc "Testing the singular resource of azurerm_subnet." describe azure_virtual_network(resource_id: id) do - its('name') { should cmp name } + its("name") { should cmp name } end end diff --git a/test/integration/verify/controls/azurerm_subnets.rb b/test/integration/verify/controls/azurerm_subnets.rb index 924380d0d..570a10f4c 100644 --- a/test/integration/verify/controls/azurerm_subnets.rb +++ b/test/integration/verify/controls/azurerm_subnets.rb @@ -1,30 +1,30 @@ -resource_group = input('resource_group', value: nil) -vnet = input('vnet_name', value: nil) -subnet = input('subnet_name', value: nil) +resource_group = input("resource_group", value: nil) +vnet = input("vnet_name", value: nil) +subnet = input("subnet_name", value: nil) -control 'azurerm_subnets' do +control "azurerm_subnets" do - title 'Testing the plural resource of azurerm_subnets.' - desc 'Testing the plural resource of azurerm_subnets.' + title "Testing the plural resource of azurerm_subnets." + desc "Testing the plural resource of azurerm_subnets." describe azurerm_subnets(resource_group: resource_group, vnet: vnet) do it { should exist } - its('names') { should be_an(Array) } - its('names') { should include(subnet) } + its("names") { should be_an(Array) } + its("names") { should include(subnet) } end - describe azurerm_subnets(resource_group: 'fake-group', vnet: vnet) do + describe azurerm_subnets(resource_group: "fake-group", vnet: vnet) do it { should_not exist } - its('names') { should_not include('fake') } + its("names") { should_not include("fake") } end - describe azurerm_subnets(resource_group: resource_group, vnet: 'fake') do + describe azurerm_subnets(resource_group: resource_group, vnet: "fake") do it { should_not exist } - its('names') { should_not include('fake') } + its("names") { should_not include("fake") } end describe azurerm_subnets(resource_group: resource_group, vnet: vnet) .where(name: subnet) do - it { should exist } - end + it { should exist } + end end diff --git a/test/integration/verify/controls/azurerm_subscription.rb b/test/integration/verify/controls/azurerm_subscription.rb index 2a9f89584..1975ff409 100644 --- a/test/integration/verify/controls/azurerm_subscription.rb +++ b/test/integration/verify/controls/azurerm_subscription.rb @@ -1,18 +1,18 @@ -control 'azurerm_subscription' do +control "azurerm_subscription" do - title 'Testing the singular resource of azure_subscription.' - desc 'Testing the singular resource of azure_subscription.' + title "Testing the singular resource of azure_subscription." + desc "Testing the singular resource of azure_subscription." describe azurerm_subscription do - its('name') { should_not be_nil } - its('locations') { should include 'eastus' } + its("name") { should_not be_nil } + its("locations") { should include "eastus" } end end -control 'azure_subscription' do +control "azure_subscription" do - title 'Testing the singular resource of azure_subscription.' - desc 'Testing the singular resource of azure_subscription.' + title "Testing the singular resource of azure_subscription." + desc "Testing the singular resource of azure_subscription." subscription_id = azure_subscription.id physical_locations_size = azure_subscription.physical_locations.size @@ -20,6 +20,6 @@ describe azure_subscription(id: subscription_id) do it { should exist } - its('all_locations.size') { should eq physical_locations_size + logical_locations_size } + its("all_locations.size") { should eq physical_locations_size + logical_locations_size } end end diff --git a/test/integration/verify/controls/azurerm_virtual_machine.rb b/test/integration/verify/controls/azurerm_virtual_machine.rb index 7aca31c37..918f0c9a7 100644 --- a/test/integration/verify/controls/azurerm_virtual_machine.rb +++ b/test/integration/verify/controls/azurerm_virtual_machine.rb @@ -1,54 +1,54 @@ -resource_group = input('resource_group', value: nil) -win_name = input('windows_vm_name', value: nil) -win_id = input('windows_vm_id', value: nil) -win_location = input('windows_vm_location', value: nil) -win_tags = input('windows_vm_tags', value: nil) -win_os_disk_name = input('windows_vm_os_disk', value: nil) -win_data_disk_names = input('windows_vm_data_disks', value: nil) -win_monitoring_agent_name = input('monitoring_agent_name', value: nil) +resource_group = input("resource_group", value: nil) +win_name = input("windows_vm_name", value: nil) +win_id = input("windows_vm_id", value: nil) +win_location = input("windows_vm_location", value: nil) +win_tags = input("windows_vm_tags", value: nil) +win_os_disk_name = input("windows_vm_os_disk", value: nil) +win_data_disk_names = input("windows_vm_data_disks", value: nil) +win_monitoring_agent_name = input("monitoring_agent_name", value: nil) -control 'azurerm_virtual_machine' do +control "azurerm_virtual_machine" do - title 'Testing the singular resource of azurerm_virtual_machine.' - desc 'Testing the singular resource of azurerm_virtual_machine.' + title "Testing the singular resource of azurerm_virtual_machine." + desc "Testing the singular resource of azurerm_virtual_machine." describe azurerm_virtual_machine(resource_group: resource_group, name: win_name) do it { should exist } it { should have_monitoring_agent_installed } it { should_not have_endpoint_protection_installed([]) } - it { should have_only_approved_extensions(['MicrosoftMonitoringAgent']) } - its('id') { should eq win_id } - its('name') { should eq win_name } - its('location') { should eq win_location } - its('tags') { should eq win_tags } - its('type') { should eq 'Microsoft.Compute/virtualMachines' } - its('zones') { should be_nil } - its('os_disk_name') { should eq win_os_disk_name } - its('data_disk_names') { should eq win_data_disk_names } - its('installed_extensions_types') { should include('MicrosoftMonitoringAgent') } - its('installed_extensions_names') { should include(win_monitoring_agent_name) } + it { should have_only_approved_extensions(["MicrosoftMonitoringAgent"]) } + its("id") { should eq win_id } + its("name") { should eq win_name } + its("location") { should eq win_location } + its("tags") { should eq win_tags } + its("type") { should eq "Microsoft.Compute/virtualMachines" } + its("zones") { should be_nil } + its("os_disk_name") { should eq win_os_disk_name } + its("data_disk_names") { should eq win_data_disk_names } + its("installed_extensions_types") { should include("MicrosoftMonitoringAgent") } + its("installed_extensions_names") { should include(win_monitoring_agent_name) } end - describe azurerm_virtual_machine(resource_group: resource_group, name: 'fake') do + describe azurerm_virtual_machine(resource_group: resource_group, name: "fake") do it { should_not exist } end - describe azurerm_virtual_machine(resource_group: 'does-not-exist', name: win_name) do + describe azurerm_virtual_machine(resource_group: "does-not-exist", name: win_name) do it { should_not exist } end describe azurerm_virtual_machine(resource_group: resource_group, name: win_name) do - its('properties.osProfile.linuxConfiguration.ssh') { should be_nil } + its("properties.osProfile.linuxConfiguration.ssh") { should be_nil } end end -control 'azure_virtual_machine' do +control "azure_virtual_machine" do - title 'Ensure azure_virtual_machine accepts resource_id and tests resource_group as a property.' - desc 'Testing the singular resource of azure_virtual_machine.' + title "Ensure azure_virtual_machine accepts resource_id and tests resource_group as a property." + desc "Testing the singular resource of azure_virtual_machine." describe azure_virtual_machine(resource_id: win_id) do - its('name') { should eq win_name } - its('resource_group') { should eq resource_group } + its("name") { should eq win_name } + its("resource_group") { should eq resource_group } end end diff --git a/test/integration/verify/controls/azurerm_virtual_machine_disk.rb b/test/integration/verify/controls/azurerm_virtual_machine_disk.rb index 857304feb..25902753c 100644 --- a/test/integration/verify/controls/azurerm_virtual_machine_disk.rb +++ b/test/integration/verify/controls/azurerm_virtual_machine_disk.rb @@ -1,25 +1,25 @@ -resource_group = input('resource_group', value: nil) -location = input('encrypted_disk_location', value: nil) -attached_disk_name = input('attached_disk_name', value: nil) -encrypted_disk_name = input('encrypted_disk_name', value: nil) -unmanaged_disk_name = input('unamaged_disk_name', value: nil) +resource_group = input("resource_group", value: nil) +location = input("encrypted_disk_location", value: nil) +attached_disk_name = input("attached_disk_name", value: nil) +encrypted_disk_name = input("encrypted_disk_name", value: nil) +unmanaged_disk_name = input("unamaged_disk_name", value: nil) -control 'azurerm_virtual_machine_disk' do +control "azurerm_virtual_machine_disk" do - title 'Testing the singular resource of azurerm_virtual_machine_disk.' - desc 'Testing the singular resource of azurerm_virtual_machine_disk.' + title "Testing the singular resource of azurerm_virtual_machine_disk." + desc "Testing the singular resource of azurerm_virtual_machine_disk." describe azurerm_virtual_machine_disk(resource_group: resource_group, name: encrypted_disk_name) do it { should exist } - its('id') { should eq "/subscriptions/#{ENV['AZURE_SUBSCRIPTION_ID']}/resourceGroups/#{resource_group}/providers/Microsoft.Compute/disks/#{encrypted_disk_name}" } - its('name') { should eq(encrypted_disk_name) } - its('tags') { should eq({}) } - its('location') { should eq(location) } - its('type') { should eq('Microsoft.Compute/disks') } - its('sku.name') { should eq('Standard_LRS') } - its('sku.tier') { should eq('Standard') } - its('encryption_enabled') { should be true } - its('properties') { should_not be_nil } + its("id") { should eq "/subscriptions/#{ENV["AZURE_SUBSCRIPTION_ID"]}/resourceGroups/#{resource_group}/providers/Microsoft.Compute/disks/#{encrypted_disk_name}" } + its("name") { should eq(encrypted_disk_name) } + its("tags") { should eq({}) } + its("location") { should eq(location) } + its("type") { should eq("Microsoft.Compute/disks") } + its("sku.name") { should eq("Standard_LRS") } + its("sku.tier") { should eq("Standard") } + its("encryption_enabled") { should be true } + its("properties") { should_not be_nil } end describe azurerm_virtual_machine_disk(resource_group: resource_group, name: attached_disk_name) do @@ -28,6 +28,6 @@ describe azurerm_virtual_machine_disk(resource_group: resource_group, name: unmanaged_disk_name) do it { should_not exist } - its('encryption_enabled') { should be_nil } + its("encryption_enabled") { should be_nil } end end diff --git a/test/integration/verify/controls/azurerm_virtual_machine_disks.rb b/test/integration/verify/controls/azurerm_virtual_machine_disks.rb index 998bb736c..016ac55e7 100644 --- a/test/integration/verify/controls/azurerm_virtual_machine_disks.rb +++ b/test/integration/verify/controls/azurerm_virtual_machine_disks.rb @@ -1,23 +1,23 @@ -rg = input('resource_group', value: nil) -windows_vm_os_disk = input('windows_vm_os_disk', value: nil) +rg = input("resource_group", value: nil) +windows_vm_os_disk = input("windows_vm_os_disk", value: nil) -control 'azurerm_virtual_machine_disks' do +control "azurerm_virtual_machine_disks" do - title 'Testing the plural resource of azurerm_virtual_machine_disks.' - desc 'Testing the plural resource of azurerm_virtual_machine_disks.' + title "Testing the plural resource of azurerm_virtual_machine_disks." + desc "Testing the plural resource of azurerm_virtual_machine_disks." describe azurerm_virtual_machine_disks do it { should exist } - its('names') { should include windows_vm_os_disk } + its("names") { should include windows_vm_os_disk } end # rubocop:disable Lint/AmbiguousBlockAssociation describe azurerm_virtual_machine_disks.where { attached == true } do - its('names') { should include windows_vm_os_disk } + its("names") { should include windows_vm_os_disk } end describe azurerm_virtual_machine_disks.where { resource_group.casecmp(rg) } do - its('names') { should include windows_vm_os_disk } + its("names") { should include windows_vm_os_disk } end # rubocop:enable Lint/AmbiguousBlockAssociation end diff --git a/test/integration/verify/controls/azurerm_virtual_machines.rb b/test/integration/verify/controls/azurerm_virtual_machines.rb index 5208b5535..348b9c481 100644 --- a/test/integration/verify/controls/azurerm_virtual_machines.rb +++ b/test/integration/verify/controls/azurerm_virtual_machines.rb @@ -1,7 +1,7 @@ -resource_group = input('resource_group', value: nil) -vm_names = input('vm_names', value: []) -os_disks = input('os_disks', value: []) -data_disks = input('data_disks', value: []) +resource_group = input("resource_group", value: nil) +vm_names = input("vm_names", value: []) +os_disks = input("os_disks", value: []) +data_disks = input("data_disks", value: []) windows_vm_names = vm_names.select { |disk| disk.match(/windows/i) } linux_vm_names = vm_names.select { |disk| disk.match(/linux/i) } @@ -12,43 +12,43 @@ windows_data_disks = data_disks.select { |disk| disk.match(/windows/i) } linux_data_disks = data_disks.select { |disk| disk.match(/linux/i) } -control 'azurerm_virtual_machines' do +control "azurerm_virtual_machines" do - title 'Testing the plural resource of azurerm_virtual_machines.' - desc 'Testing the plural resource of azurerm_virtual_machines.' + title "Testing the plural resource of azurerm_virtual_machines." + desc "Testing the plural resource of azurerm_virtual_machines." describe azurerm_virtual_machines(resource_group: resource_group) do it { should exist } - its('vm_names.sort') { should eq vm_names.sort } - its('os_disks.sort') { should eq os_disks.sort } - its('data_disks.flatten.sort') { should include(data_disks.first) } + its("vm_names.sort") { should eq vm_names.sort } + its("os_disks.sort") { should eq os_disks.sort } + its("data_disks.flatten.sort") { should include(data_disks.first) } end describe azurerm_virtual_machines(resource_group: resource_group) - .where(platform: 'windows') do - it { should exist } - its('vm_names.sort') { should eq windows_vm_names.sort } - its('os_disks.sort') { should eq windows_os_disks.sort } - its('data_disks.flatten.sort') { should eq windows_data_disks.sort } - end + .where(platform: "windows") do + it { should exist } + its("vm_names.sort") { should eq windows_vm_names.sort } + its("os_disks.sort") { should eq windows_os_disks.sort } + its("data_disks.flatten.sort") { should eq windows_data_disks.sort } + end describe azurerm_virtual_machines(resource_group: resource_group) - .where(platform: 'linux') do - it { should exist } - its('vm_names.sort') { should eq linux_vm_names.sort } - its('os_disks.sort') { should eq linux_os_disks.sort } - its('data_disks.flatten.sort') { should eq linux_data_disks.sort } - end + .where(platform: "linux") do + it { should exist } + its("vm_names.sort") { should eq linux_vm_names.sort } + its("os_disks.sort") { should eq linux_os_disks.sort } + its("data_disks.flatten.sort") { should eq linux_data_disks.sort } + end - describe azurerm_virtual_machines(resource_group: 'fake-group') do + describe azurerm_virtual_machines(resource_group: "fake-group") do it { should_not exist } end end -control 'azure_virtual_machines' do +control "azure_virtual_machines" do - title 'Ensure azure_virtual_machines works without providing resource_group.' - desc 'Testing the plural resource of azurerm_virtual_machines.' + title "Ensure azure_virtual_machines works without providing resource_group." + desc "Testing the plural resource of azurerm_virtual_machines." describe azure_virtual_machines do it { should exist } diff --git a/test/integration/verify/controls/azurerm_virtual_network.rb b/test/integration/verify/controls/azurerm_virtual_network.rb index 11c123389..e930bfe65 100644 --- a/test/integration/verify/controls/azurerm_virtual_network.rb +++ b/test/integration/verify/controls/azurerm_virtual_network.rb @@ -1,50 +1,50 @@ -resource_group = input('resource_group', value: nil) -vnet = input('vnet_name', value: nil) -tags = input('vnet_tags', value: nil) -vnet_id = input('vnet_id', value: nil) -location = input('vnet_location', value: nil) -subnets = input('vnet_subnets', value: nil) -address_space = input('vnet_address_space', value: nil) -dns_servers = input('vnet_dns_servers', value: nil) -vnet_peerings = input('vnet_peerings', value: nil) -enable_ddos = input('vnet_enable_ddos_protection', value: false) -enable_vm_protection = input('vnet_enable_vm_protection', value: false) - -control 'azurerm_virtual_network' do - - title 'Testing the singular resource of azurerm_virtual_network.' - desc 'Testing the singular resource of azurerm_virtual_network.' +resource_group = input("resource_group", value: nil) +vnet = input("vnet_name", value: nil) +tags = input("vnet_tags", value: nil) +vnet_id = input("vnet_id", value: nil) +location = input("vnet_location", value: nil) +subnets = input("vnet_subnets", value: nil) +address_space = input("vnet_address_space", value: nil) +dns_servers = input("vnet_dns_servers", value: nil) +vnet_peerings = input("vnet_peerings", value: nil) +enable_ddos = input("vnet_enable_ddos_protection", value: false) +enable_vm_protection = input("vnet_enable_vm_protection", value: false) + +control "azurerm_virtual_network" do + + title "Testing the singular resource of azurerm_virtual_network." + desc "Testing the singular resource of azurerm_virtual_network." describe azurerm_virtual_network(resource_group: resource_group, name: vnet) do it { should exist } - its('id') { should eq vnet_id } - its('name') { should eq vnet } - its('location') { should eq location } - its('type') { should eq 'Microsoft.Network/virtualNetworks' } - its('tags') { should eq tags } - its('subnets') { should eq subnets } - its('address_space') { should eq address_space } - its('dns_servers') { should eq dns_servers } - its('vnet_peerings') { should eq vnet_peerings } - its('enable_ddos_protection') { should eq enable_ddos } - its('enable_vm_protection') { should eq enable_vm_protection } + its("id") { should eq vnet_id } + its("name") { should eq vnet } + its("location") { should eq location } + its("type") { should eq "Microsoft.Network/virtualNetworks" } + its("tags") { should eq tags } + its("subnets") { should eq subnets } + its("address_space") { should eq address_space } + its("dns_servers") { should eq dns_servers } + its("vnet_peerings") { should eq vnet_peerings } + its("enable_ddos_protection") { should eq enable_ddos } + its("enable_vm_protection") { should eq enable_vm_protection } end - describe azurerm_virtual_network(resource_group: resource_group, name: 'fake') do + describe azurerm_virtual_network(resource_group: resource_group, name: "fake") do it { should_not exist } end - describe azurerm_virtual_network(resource_group: 'does-not-exist', name: vnet) do + describe azurerm_virtual_network(resource_group: "does-not-exist", name: vnet) do it { should_not exist } end end -control 'azure_virtual_network' do +control "azure_virtual_network" do - title 'Ensure that azure_virtual_network supports `resource_id` as a parameter.' - desc 'Testing the singular resource of azure_virtual_network.' + title "Ensure that azure_virtual_network supports `resource_id` as a parameter." + desc "Testing the singular resource of azure_virtual_network." describe azure_virtual_network(resource_id: vnet_id) do - its('name') { should cmp vnet } + its("name") { should cmp vnet } end end diff --git a/test/integration/verify/controls/azurerm_virtual_network_peering.rb b/test/integration/verify/controls/azurerm_virtual_network_peering.rb index 96fba0161..33184e405 100644 --- a/test/integration/verify/controls/azurerm_virtual_network_peering.rb +++ b/test/integration/verify/controls/azurerm_virtual_network_peering.rb @@ -1,25 +1,25 @@ -resource_group = input('resource_group', value: nil) -name = input('virtual_network_peering_name', value: nil) -id = input('virtual_network_peering_id', value: nil) -vnet = input('vnet_name', value: nil) +resource_group = input("resource_group", value: nil) +name = input("virtual_network_peering_name", value: nil) +id = input("virtual_network_peering_id", value: nil) +vnet = input("vnet_name", value: nil) -control 'azurerm_virtual_network_peering' do +control "azurerm_virtual_network_peering" do - title 'Testing the singular resource of azurerm_virtual_network_peering.' - desc 'Testing the singular resource of azurerm_virtual_network_peering.' + title "Testing the singular resource of azurerm_virtual_network_peering." + desc "Testing the singular resource of azurerm_virtual_network_peering." describe azurerm_virtual_network_peering(resource_group: resource_group, vnet: vnet, name: name) do it { should exist } - its('id') { should eq id } - its('name') { should eq name } - its('peering_state') { should eq 'Connected' } + its("id") { should eq id } + its("name") { should eq name } + its("peering_state") { should eq "Connected" } end - describe azurerm_virtual_network_peering(resource_group: resource_group, vnet: vnet, name: 'fake') do + describe azurerm_virtual_network_peering(resource_group: resource_group, vnet: vnet, name: "fake") do it { should_not exist } end - describe azurerm_virtual_network_peering(resource_group: 'does-not-exist', vnet: vnet, name: name) do + describe azurerm_virtual_network_peering(resource_group: "does-not-exist", vnet: vnet, name: name) do it { should_not exist } end end diff --git a/test/integration/verify/controls/azurerm_virtual_network_peerings.rb b/test/integration/verify/controls/azurerm_virtual_network_peerings.rb index 36676ec13..09cdaca39 100644 --- a/test/integration/verify/controls/azurerm_virtual_network_peerings.rb +++ b/test/integration/verify/controls/azurerm_virtual_network_peerings.rb @@ -1,25 +1,25 @@ -resource_group = input('resource_group', value: nil) -name = input('virtual_network_peering_name', value: nil) -vnet = input('vnet_name', value: nil) +resource_group = input("resource_group", value: nil) +name = input("virtual_network_peering_name", value: nil) +vnet = input("vnet_name", value: nil) -control 'azurerm_virtual_network_peerings' do +control "azurerm_virtual_network_peerings" do - title 'Testing the plural resource of azurerm_virtual_network_peerings.' - desc 'Testing the plural resource of azurerm_virtual_network_peerings.' + title "Testing the plural resource of azurerm_virtual_network_peerings." + desc "Testing the plural resource of azurerm_virtual_network_peerings." describe azurerm_virtual_network_peerings(resource_group: resource_group, vnet: vnet) do it { should exist } - its('names') { should include(name) } + its("names") { should include(name) } end - describe azurerm_virtual_network_peerings(resource_group: 'fake-group', vnet: vnet) do + describe azurerm_virtual_network_peerings(resource_group: "fake-group", vnet: vnet) do it { should_not exist } - its('names') { should_not include('fake') } + its("names") { should_not include("fake") } end describe azurerm_virtual_network_peerings(resource_group: resource_group, vnet: vnet) .where(name: name) do - it { should exist } - end + it { should exist } + end end diff --git a/test/integration/verify/controls/azurerm_virtual_networks.rb b/test/integration/verify/controls/azurerm_virtual_networks.rb index fa2427601..49e560b64 100644 --- a/test/integration/verify/controls/azurerm_virtual_networks.rb +++ b/test/integration/verify/controls/azurerm_virtual_networks.rb @@ -1,32 +1,32 @@ -resource_group = input('resource_group', value: nil) -vnet = input('vnet_name', value: nil) +resource_group = input("resource_group", value: nil) +vnet = input("vnet_name", value: nil) -control 'azurerm_virtual_networks' do +control "azurerm_virtual_networks" do - title 'Testing the plural resource of azure_virtual_networks.' - desc 'Testing the plural resource of azure_virtual_networks.' + title "Testing the plural resource of azure_virtual_networks." + desc "Testing the plural resource of azure_virtual_networks." describe azurerm_virtual_networks(resource_group: resource_group) do it { should exist } - its('names') { should be_an(Array) } - its('names') { should include(vnet) } + its("names") { should be_an(Array) } + its("names") { should include(vnet) } end - describe azurerm_virtual_networks(resource_group: 'fake-group') do + describe azurerm_virtual_networks(resource_group: "fake-group") do it { should_not exist } - its('names') { should_not include('fake') } + its("names") { should_not include("fake") } end describe azurerm_virtual_networks(resource_group: resource_group) .where(name: vnet) do - it { should exist } - end + it { should exist } + end end -control 'azure_virtual_networks' do +control "azure_virtual_networks" do - title 'Ensure that the resource tests all virtual networks in a subscription.' - desc 'Testing the plural resource of azure_virtual_networks.' + title "Ensure that the resource tests all virtual networks in a subscription." + desc "Testing the plural resource of azure_virtual_networks." describe azure_virtual_networks do it { should exist } diff --git a/test/integration/verify/controls/azurerm_webapp.rb b/test/integration/verify/controls/azurerm_webapp.rb index 840117dd8..1b03137a6 100644 --- a/test/integration/verify/controls/azurerm_webapp.rb +++ b/test/integration/verify/controls/azurerm_webapp.rb @@ -1,14 +1,14 @@ -resource_group = input('resource_group', value: nil) -webapp_name = input('webapp_name', value: nil) +resource_group = input("resource_group", value: nil) +webapp_name = input("webapp_name", value: nil) -control 'azurerm_webapp' do +control "azurerm_webapp" do - title 'Testing the singular resource of azurerm_webapp.' - desc 'Testing the singular resource of azurerm_webapp.' + title "Testing the singular resource of azurerm_webapp." + desc "Testing the singular resource of azurerm_webapp." describe azurerm_webapp(resource_group: resource_group, name: webapp_name) do it { should have_identity } - it { should be_using_latest('aspnet') } - its('properties') { should have_attributes(httpsOnly: true) } + it { should be_using_latest("aspnet") } + its("properties") { should have_attributes(httpsOnly: true) } end end diff --git a/test/integration/verify/controls/azurerm_webapps.rb b/test/integration/verify/controls/azurerm_webapps.rb index 882f18164..1701570e4 100644 --- a/test/integration/verify/controls/azurerm_webapps.rb +++ b/test/integration/verify/controls/azurerm_webapps.rb @@ -1,13 +1,13 @@ -resource_group = input('resource_group', value: nil) -webapp_name = input('webapp_name', value: nil) +resource_group = input("resource_group", value: nil) +webapp_name = input("webapp_name", value: nil) -control 'azurerm_webapps' do +control "azurerm_webapps" do - title 'Testing the plural resource of azurerm_webapps.' - desc 'Testing the plural resource of azurerm_webapps.' + title "Testing the plural resource of azurerm_webapps." + desc "Testing the plural resource of azurerm_webapps." describe azurerm_webapps(resource_group: resource_group) do it { should exist } - its('names') { should include webapp_name } + its("names") { should include webapp_name } end end diff --git a/test/unit/helpers/simplecov_minitest.rb b/test/unit/helpers/simplecov_minitest.rb index a79bb2182..1d9d754aa 100644 --- a/test/unit/helpers/simplecov_minitest.rb +++ b/test/unit/helpers/simplecov_minitest.rb @@ -1,35 +1,35 @@ # Load default formatter gem -require 'English' -require 'pathname' -require 'simplecov_json_formatter' -require 'simplecov/profiles/root_filter' -require 'simplecov/profiles/test_frameworks' -require 'simplecov/profiles/bundler_filter' -require 'simplecov/profiles/rails' +require "English" +require "pathname" +require "simplecov_json_formatter" +require "simplecov/profiles/root_filter" +require "simplecov/profiles/test_frameworks" +require "simplecov/profiles/bundler_filter" +require "simplecov/profiles/rails" # Default configuration SimpleCov.configure do formatter SimpleCov::Formatter::JSONFormatter - load_profile 'bundler_filter' + load_profile "bundler_filter" # Exclude files outside of SimpleCov.root - load_profile 'root_filter' + load_profile "root_filter" # We don't actually tolerate anything this low, we just don't want a nonizero exit under any cirumstances minimum_coverage 50 end # Gotta stash this a-s-a-p, see the CommandGuesser class and i.e. #110 for further info -SimpleCov::CommandGuesser.original_run_command = "#{$PROGRAM_NAME} #{ARGV.join(' ')}" +SimpleCov::CommandGuesser.original_run_command = "#{$PROGRAM_NAME} #{ARGV.join(" ")}" # Autoload config from ~/.simplecov if present -require 'simplecov/load_global_config' +require "simplecov/load_global_config" # Autoload config from .simplecov if present # Recurse upwards until we find .simplecov or reach the root directory config_path = Pathname.new(SimpleCov.root) loop do - filename = config_path.join('.simplecov') + filename = config_path.join(".simplecov") if filename.exist? begin load filename diff --git a/test/unit/lib/env_file_test.rb b/test/unit/lib/env_file_test.rb index 93500a8be..cf19039b1 100644 --- a/test/unit/lib/env_file_test.rb +++ b/test/unit/lib/env_file_test.rb @@ -1,12 +1,12 @@ -require 'tempfile' +require "tempfile" -require_relative '../test_helper' -require_relative '../../../lib/environment_file' +require_relative "../test_helper" +require_relative "../../../lib/environment_file" # rubocop:disable Metrics/BlockLength describe EnvironmentFile do before do - @tmp_file = Tempfile.new('env') + @tmp_file = Tempfile.new("env") @content = <<~CONTENT unrelated content @@ -27,33 +27,33 @@ @tmp_file.unlink end - describe 'no env file' do - it 'returns no options' do - assert_equal([], EnvironmentFile.options('fake/path')) + describe "no env file" do + it "returns no options" do + assert_equal([], EnvironmentFile.options("fake/path")) end end - describe 'env file' do - it 'returns no options' do + describe "env file" do + it "returns no options" do assert_equal(%w{graph network_watcher}, EnvironmentFile.options(@tmp_file.path)) end end - describe 'current configuration' do - it 'gives the current options in file' do + describe "current configuration" do + it "gives the current options in file" do @env_file.current_options.eql? %w{graph network_watcher} end - it 'gives empty list if not options in file' do + it "gives empty list if not options in file" do @env_file.synchronize([]) @env_file.current_options.eql? [] end end - describe 'synchronizing environment' do - it 'adds given keys and removes missing keys' do - @env_file.synchronize(['network_watcher']) + describe "synchronizing environment" do + it "adds given keys and removes missing keys" do + @env_file.synchronize(["network_watcher"]) @tmp_file.open @tmp_file.read.eql? <<~CONTENT @@ -68,7 +68,7 @@ CONTENT end - it 'raises an error when unknown keys are given' do + it "raises an error when unknown keys are given" do assert_raises RuntimeError do @env_file.synchronize(%w{network_watcher graph unknown}) end diff --git a/test/unit/resources/azure_active_directory_domain_service_test.rb b/test/unit/resources/azure_active_directory_domain_service_test.rb index aa15f3f1f..42bf4658a 100644 --- a/test/unit/resources/azure_active_directory_domain_service_test.rb +++ b/test/unit/resources/azure_active_directory_domain_service_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_active_directory_domain_service' +require_relative "helper" +require "azure_active_directory_domain_service" class AzureActiveDirectoryDomainServiceConstructorTest < Minitest::Test # Generic resource requires a parameter. @@ -8,17 +8,17 @@ def test_empty_params_not_ok end def test_not_allowed_parameter - assert_raises(ArgumentError) { AzureActiveDirectoryDomainService.new(resource: 'domains', id: 'some_id', fake: 'random') } + assert_raises(ArgumentError) { AzureActiveDirectoryDomainService.new(resource: "domains", id: "some_id", fake: "random") } end def test_filter_not_allowed - assert_raises(ArgumentError) { AzureActiveDirectoryDomainService.new(resource: 'domains', id: 'some_id', filter: 'random') } + assert_raises(ArgumentError) { AzureActiveDirectoryDomainService.new(resource: "domains", id: "some_id", filter: "random") } end def test_resource_identifier_is_a_list assert_raises(ArgumentError) do - AzureActiveDirectoryDomainService.new(resource: 'domains', id: 'some_id', - resource_identifier: 'random') + AzureActiveDirectoryDomainService.new(resource: "domains", id: "some_id", + resource_identifier: "random") end end end diff --git a/test/unit/resources/azure_active_directory_domain_services_test.rb b/test/unit/resources/azure_active_directory_domain_services_test.rb index 463495b2a..7a38c1390 100644 --- a/test/unit/resources/azure_active_directory_domain_services_test.rb +++ b/test/unit/resources/azure_active_directory_domain_services_test.rb @@ -1,19 +1,19 @@ -require_relative 'helper' -require 'azure_active_directory_domain_services' +require_relative "helper" +require "azure_active_directory_domain_services" class AzureActiveDirectoryDomainServicesConstructorTest < Minitest::Test def test_not_allowed_parameter - assert_raises(ArgumentError) { AzureActiveDirectoryDomainServices.new(resource: 'domains', fake: 'rubbish') } + assert_raises(ArgumentError) { AzureActiveDirectoryDomainServices.new(resource: "domains", fake: "rubbish") } end def test_id_not_allowed - assert_raises(ArgumentError) { AzureActiveDirectoryDomainServices.new(resource: 'domains', id: 'some_id') } + assert_raises(ArgumentError) { AzureActiveDirectoryDomainServices.new(resource: "domains", id: "some_id") } end def test_filter_filter_free_text_together_not_allowed assert_raises(ArgumentError) do - AzureActiveDirectoryDomainServices.new(resource: 'domains', - filter: { name: 'some_id' }, filter_free_text: %w{some_filter}) + AzureActiveDirectoryDomainServices.new(resource: "domains", + filter: { name: "some_id" }, filter_free_text: %w{some_filter}) end end end diff --git a/test/unit/resources/azure_active_directory_object_test.rb b/test/unit/resources/azure_active_directory_object_test.rb index 25e4f986f..dc67b4b47 100644 --- a/test/unit/resources/azure_active_directory_object_test.rb +++ b/test/unit/resources/azure_active_directory_object_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_active_directory_object' +require_relative "helper" +require "azure_active_directory_object" class AzureActiveDirectoryObjectConstructorTest < Minitest::Test # Generic resource requires a parameter. @@ -8,17 +8,17 @@ def test_empty_params_not_ok end def test_not_allowed_parameter - assert_raises(ArgumentError) { AzureActiveDirectoryObject.new(resource: 'directoryObjects', id: 'some_id', fake: 'random') } + assert_raises(ArgumentError) { AzureActiveDirectoryObject.new(resource: "directoryObjects", id: "some_id", fake: "random") } end def test_filter_not_allowed - assert_raises(ArgumentError) { AzureActiveDirectoryObject.new(resource: 'directoryObjects', id: 'some_id', filter: 'random') } + assert_raises(ArgumentError) { AzureActiveDirectoryObject.new(resource: "directoryObjects", id: "some_id", filter: "random") } end def test_resource_identifier_is_a_list assert_raises(ArgumentError) do - AzureActiveDirectoryObject.new(resource: 'directoryObjects', id: 'some_id', - resource_identifier: 'random') + AzureActiveDirectoryObject.new(resource: "directoryObjects", id: "some_id", + resource_identifier: "random") end end end diff --git a/test/unit/resources/azure_aks_cluster_test.rb b/test/unit/resources/azure_aks_cluster_test.rb index f8f460598..86faacf6e 100644 --- a/test/unit/resources/azure_aks_cluster_test.rb +++ b/test/unit/resources/azure_aks_cluster_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_aks_cluster' +require_relative "helper" +require "azure_aks_cluster" class AzureAksClusterConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureAksCluster.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureAksCluster.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureAksCluster.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureAksCluster.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_aks_clusters_test.rb b/test/unit/resources/azure_aks_clusters_test.rb index 29d895281..db9600102 100644 --- a/test/unit/resources/azure_aks_clusters_test.rb +++ b/test/unit/resources/azure_aks_clusters_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_aks_clusters' +require_relative "helper" +require "azure_aks_clusters" class AzureAksClustersConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureAksClusters.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureAksClusters.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureAksClusters.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureAksClusters.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureAksClusters.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureAksClusters.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureAksClusters.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureAksClusters.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureAksClusters.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureAksClusters.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_api_management_test.rb b/test/unit/resources/azure_api_management_test.rb index 7a2091f0d..fd76ea194 100644 --- a/test/unit/resources/azure_api_management_test.rb +++ b/test/unit/resources/azure_api_management_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_api_management' +require_relative "helper" +require "azure_api_management" class AzureApiManagementConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureApiManagement.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureApiManagement.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureApiManagement.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureApiManagement.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_api_managements_test.rb b/test/unit/resources/azure_api_managements_test.rb index bd369f18b..5b34aa4f0 100644 --- a/test/unit/resources/azure_api_managements_test.rb +++ b/test/unit/resources/azure_api_managements_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_api_managements' +require_relative "helper" +require "azure_api_managements" class AzureApiManagementsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureApiManagements.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureApiManagements.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureApiManagements.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureApiManagements.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureApiManagements.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureApiManagements.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureApiManagements.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureApiManagements.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureApiManagements.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureApiManagements.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_application_gateway_test.rb b/test/unit/resources/azure_application_gateway_test.rb index 489b662af..cacfb5ad1 100644 --- a/test/unit/resources/azure_application_gateway_test.rb +++ b/test/unit/resources/azure_application_gateway_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_application_gateway' +require_relative "helper" +require "azure_application_gateway" class AzureApplicationGatewayConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureApplicationGateway.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureApplicationGateway.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureApplicationGateway.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureApplicationGateway.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_application_gateways_test.rb b/test/unit/resources/azure_application_gateways_test.rb index de1e94ae8..11d64ca96 100644 --- a/test/unit/resources/azure_application_gateways_test.rb +++ b/test/unit/resources/azure_application_gateways_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_application_gateways' +require_relative "helper" +require "azure_application_gateways" class AzureApplicationGatewaysConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureApplicationGateways.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureApplicationGateways.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureApplicationGateways.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureApplicationGateways.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureApplicationGateways.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureApplicationGateways.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureApplicationGateways.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureApplicationGateways.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureApplicationGateways.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureApplicationGateways.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_bastion_hosts_resource_test.rb b/test/unit/resources/azure_bastion_hosts_resource_test.rb index d014c6cc8..1e5ad28e0 100644 --- a/test/unit/resources/azure_bastion_hosts_resource_test.rb +++ b/test/unit/resources/azure_bastion_hosts_resource_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_bastion_hosts_resource' +require_relative "helper" +require "azure_bastion_hosts_resource" class AzureBastionHostsResourceConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureBastionHostsResource.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureBastionHostsResource.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureBastionHostsResource.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureBastionHostsResource.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_bastion_hosts_resources_test.rb b/test/unit/resources/azure_bastion_hosts_resources_test.rb index 94ddecd79..52a7acc0b 100644 --- a/test/unit/resources/azure_bastion_hosts_resources_test.rb +++ b/test/unit/resources/azure_bastion_hosts_resources_test.rb @@ -1,17 +1,17 @@ -require_relative 'helper' -require 'azure_bastion_hosts_resources' +require_relative "helper" +require "azure_bastion_hosts_resources" class AzureBastionHostsResourcesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureBastionHostsResources.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureBastionHostsResources.new(resource_provider: "some_type") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureBastionHostsResources.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureBastionHostsResources.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureBastionHostsResources.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureBastionHostsResources.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_blob_service.rb b/test/unit/resources/azure_blob_service.rb index 879fd0c6e..00c07abb9 100644 --- a/test/unit/resources/azure_blob_service.rb +++ b/test/unit/resources/azure_blob_service.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_blob_service' +require_relative "helper" +require "azure_blob_service" class AzureBlobServiceConstructorTest < Minitest::Test # Generic resource requires a parameter. @@ -8,10 +8,10 @@ def test_empty_params_not_ok end def test_not_allowed_parameter - assert_raises(ArgumentError) { AzureBlobService.new(resource: 'domains', id: 'some_id', fake: 'random') } + assert_raises(ArgumentError) { AzureBlobService.new(resource: "domains", id: "some_id", fake: "random") } end def test_filter_not_allowed - assert_raises(ArgumentError) { AzureBlobService.new(resource: 'domains', id: 'some_id', filter: 'random') } + assert_raises(ArgumentError) { AzureBlobService.new(resource: "domains", id: "some_id", filter: "random") } end end diff --git a/test/unit/resources/azure_blob_services.rb b/test/unit/resources/azure_blob_services.rb index 294c391ba..a5f62c36f 100644 --- a/test/unit/resources/azure_blob_services.rb +++ b/test/unit/resources/azure_blob_services.rb @@ -1,12 +1,12 @@ -require_relative 'helper' -require 'azure_blob_services' +require_relative "helper" +require "azure_blob_services" class AzureBlobServicesConstructorTest < Minitest::Test def test_not_allowed_parameter - assert_raises(ArgumentError) { AzureBlobServices.new(resource: 'domains', fake: 'rubbish') } + assert_raises(ArgumentError) { AzureBlobServices.new(resource: "domains", fake: "rubbish") } end def test_id_not_allowed - assert_raises(ArgumentError) { AzureBlobServices.new(resource: 'domains', id: 'some_id') } + assert_raises(ArgumentError) { AzureBlobServices.new(resource: "domains", id: "some_id") } end end diff --git a/test/unit/resources/azure_cdn_profile_test.rb b/test/unit/resources/azure_cdn_profile_test.rb index 1d64ea6a5..e392b7b97 100644 --- a/test/unit/resources/azure_cdn_profile_test.rb +++ b/test/unit/resources/azure_cdn_profile_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_cdn_profile' +require_relative "helper" +require "azure_cdn_profile" class AzureCDNProfileConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -7,6 +7,6 @@ def test_empty_param_not_ok end def test_resource_group_alone_not_ok - assert_raises(ArgumentError) { AzureCDNProfile.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureCDNProfile.new(resource_provider: "some_type") } end end diff --git a/test/unit/resources/azure_cdn_profiles_test.rb b/test/unit/resources/azure_cdn_profiles_test.rb index a7754daca..7bc28090b 100644 --- a/test/unit/resources/azure_cdn_profiles_test.rb +++ b/test/unit/resources/azure_cdn_profiles_test.rb @@ -1,12 +1,12 @@ -require_relative 'helper' -require 'azure_cdn_profiles' +require_relative "helper" +require "azure_cdn_profiles" class AzureCDNProfilesConstructorTest < Minitest::Test def tag_value_not_ok - assert_raises(ArgumentError) { AzureCDNProfiles.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureCDNProfiles.new(tag_value: "some_tag_value") } end def test_resource_id_alone_not_ok - assert_raises(ArgumentError) { AzureCDNProfiles.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureCDNProfiles.new(resource_id: "some_id") } end end diff --git a/test/unit/resources/azure_container_group_test.rb b/test/unit/resources/azure_container_group_test.rb index dc996c3bd..bba001709 100644 --- a/test/unit/resources/azure_container_group_test.rb +++ b/test/unit/resources/azure_container_group_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_container_group' +require_relative "helper" +require "azure_container_group" class AzureContainerGroupConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -7,6 +7,6 @@ def test_empty_param_not_ok end def test_resource_group_alone_not_ok - assert_raises(ArgumentError) { AzureContainerGroup.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureContainerGroup.new(resource_provider: "some_type") } end end diff --git a/test/unit/resources/azure_container_groups_test.rb b/test/unit/resources/azure_container_groups_test.rb index 161847a77..8b1f930f5 100644 --- a/test/unit/resources/azure_container_groups_test.rb +++ b/test/unit/resources/azure_container_groups_test.rb @@ -1,12 +1,12 @@ -require_relative 'helper' -require 'azure_container_groups' +require_relative "helper" +require "azure_container_groups" class AzureContainerGroupsConstructorTest < Minitest::Test def tag_value_not_ok - assert_raises(ArgumentError) { AzureContainerGroups.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureContainerGroups.new(tag_value: "some_tag_value") } end def test_resource_id_alone_not_ok - assert_raises(ArgumentError) { AzureContainerGroups.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureContainerGroups.new(resource_id: "some_id") } end end diff --git a/test/unit/resources/azure_container_registries_test.rb b/test/unit/resources/azure_container_registries_test.rb index e871e3350..2613c3118 100644 --- a/test/unit/resources/azure_container_registries_test.rb +++ b/test/unit/resources/azure_container_registries_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_container_registries' +require_relative "helper" +require "azure_container_registries" class AzureContainerRegistriesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureContainerRegistries.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureContainerRegistries.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureContainerRegistries.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureContainerRegistries.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureContainerRegistries.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureContainerRegistries.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureContainerRegistries.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureContainerRegistries.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureContainerRegistries.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureContainerRegistries.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_container_registry_test.rb b/test/unit/resources/azure_container_registry_test.rb index c3be7a1cc..ed1abb6bd 100644 --- a/test/unit/resources/azure_container_registry_test.rb +++ b/test/unit/resources/azure_container_registry_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_container_registry' +require_relative "helper" +require "azure_container_registry" class AzureContainerRegistryConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureContainerRegistry.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureContainerRegistry.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureContainerRegistry.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureContainerRegistry.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_cosmosdb_database_account_test.rb b/test/unit/resources/azure_cosmosdb_database_account_test.rb index d463bec8a..825239cf8 100644 --- a/test/unit/resources/azure_cosmosdb_database_account_test.rb +++ b/test/unit/resources/azure_cosmosdb_database_account_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_cosmosdb_database_account' +require_relative "helper" +require "azure_cosmosdb_database_account" class AzureCosmosDbDatabaseAccountConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureCosmosDbDatabaseAccount.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureCosmosDbDatabaseAccount.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureCosmosDbDatabaseAccount.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureCosmosDbDatabaseAccount.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_data_factories_test.rb b/test/unit/resources/azure_data_factories_test.rb index f90b8578b..25926709b 100644 --- a/test/unit/resources/azure_data_factories_test.rb +++ b/test/unit/resources/azure_data_factories_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_data_factories' +require_relative "helper" +require "azure_data_factories" class AzureDataFactoriesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureDataFactories.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureDataFactories.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureDataFactories.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureDataFactories.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureDataFactories.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureDataFactories.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureDataFactories.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureDataFactories.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureDataFactories.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureDataFactories.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_data_factory_dataset_test.rb b/test/unit/resources/azure_data_factory_dataset_test.rb index ed72a9a9b..abbe2f968 100644 --- a/test/unit/resources/azure_data_factory_dataset_test.rb +++ b/test/unit/resources/azure_data_factory_dataset_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_data_factory_dataset' +require_relative "helper" +require "azure_data_factory_dataset" class AzureDataFactoryDataSetConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureDataFactoryDataSet.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureDataFactoryDataSet.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureDataFactoryDataSet.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureDataFactoryDataSet.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_data_factory_datasets_test.rb b/test/unit/resources/azure_data_factory_datasets_test.rb index 34b8e63a2..6bc0b18b8 100644 --- a/test/unit/resources/azure_data_factory_datasets_test.rb +++ b/test/unit/resources/azure_data_factory_datasets_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_data_factory_datasets' +require_relative "helper" +require "azure_data_factory_datasets" class AzureDataFactoryDataSetsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureDataFactoryDataSets.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureDataFactoryDataSets.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureDataFactoryDataSets.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureDataFactoryDataSets.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureDataFactoryDataSets.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureDataFactoryDataSets.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureDataFactoryDataSets.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureDataFactoryDataSets.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureDataFactoryDataSets.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureDataFactoryDataSets.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_data_factory_linked_service_test.rb b/test/unit/resources/azure_data_factory_linked_service_test.rb index 72c222790..37370d9c4 100644 --- a/test/unit/resources/azure_data_factory_linked_service_test.rb +++ b/test/unit/resources/azure_data_factory_linked_service_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_data_factory_linked_service' +require_relative "helper" +require "azure_data_factory_linked_service" class AzureDataFactoryLinkedServiceTestConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureDataFactoryLinkedService.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureDataFactoryLinkedService.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureDataFactoryLinkedService.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureDataFactoryLinkedService.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_data_factory_linked_services_test.rb b/test/unit/resources/azure_data_factory_linked_services_test.rb index a8092e468..1ff78e71b 100644 --- a/test/unit/resources/azure_data_factory_linked_services_test.rb +++ b/test/unit/resources/azure_data_factory_linked_services_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_data_factory_linked_services' +require_relative "helper" +require "azure_data_factory_linked_services" class AzureDataFactoryLinkedServicesTestConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureDataFactoryLinkedServices.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureDataFactoryLinkedServices.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureDataFactoryLinkedServices.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureDataFactoryLinkedServices.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureDataFactoryLinkedServices.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureDataFactoryLinkedServices.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureDataFactoryLinkedServices.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureDataFactoryLinkedServices.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureDataFactoryLinkedServices.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureDataFactoryLinkedServices.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_data_factory_pipeline_run_resource.rb b/test/unit/resources/azure_data_factory_pipeline_run_resource.rb index 4217b4b61..a9cd06b18 100644 --- a/test/unit/resources/azure_data_factory_pipeline_run_resource.rb +++ b/test/unit/resources/azure_data_factory_pipeline_run_resource.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_data_factory_pipeline_run_resource' +require_relative "helper" +require "azure_data_factory_pipeline_run_resource" class AzureDataFactoryPipelineRunResourceTestConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureDataFactoryPipelineRunResource.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureDataFactoryPipelineRunResource.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureDataFactoryPipelineRunResource.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureDataFactoryPipelineRunResource.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_data_factory_pipeline_run_resources.rb b/test/unit/resources/azure_data_factory_pipeline_run_resources.rb index 09f8b6ce7..7c52d5041 100644 --- a/test/unit/resources/azure_data_factory_pipeline_run_resources.rb +++ b/test/unit/resources/azure_data_factory_pipeline_run_resources.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_data_factory_pipeline_run_resources' +require_relative "helper" +require "azure_data_factory_pipeline_run_resources" class AzureDataFactoryPipelineRunResourcesTestConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureDataFactoryPipelineRunResources.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureDataFactoryPipelineRunResources.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureDataFactoryPipelineRunResources.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureDataFactoryPipelineRunResources.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureDataFactoryPipelineRunResources.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureDataFactoryPipelineRunResources.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureDataFactoryPipelineRunResources.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureDataFactoryPipelineRunResources.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureDataFactoryPipelineRunResources.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureDataFactoryPipelineRunResources.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_data_factory_pipeline_test.rb b/test/unit/resources/azure_data_factory_pipeline_test.rb index d93f202a9..6dcf34880 100644 --- a/test/unit/resources/azure_data_factory_pipeline_test.rb +++ b/test/unit/resources/azure_data_factory_pipeline_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_data_factory_pipeline' +require_relative "helper" +require "azure_data_factory_pipeline" class AzureDataFactoryPipelineTestConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureDataFactoryPipeline.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureDataFactoryPipeline.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureDataFactoryPipeline.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureDataFactoryPipeline.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_data_factory_pipelines_test.rb b/test/unit/resources/azure_data_factory_pipelines_test.rb index edd975a6d..79d2238b4 100644 --- a/test/unit/resources/azure_data_factory_pipelines_test.rb +++ b/test/unit/resources/azure_data_factory_pipelines_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_data_factory_pipelines' +require_relative "helper" +require "azure_data_factory_pipelines" class AzureDataFactoryPipelinesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureDataFactoryPipelines.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureDataFactoryPipelines.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureDataFactoryPipelines.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureDataFactoryPipelines.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureDataFactoryPipelines.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureDataFactoryPipelines.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureDataFactoryPipelines.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureDataFactoryPipelines.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureDataFactoryPipelines.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureDataFactoryPipelines.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_data_factory_test.rb b/test/unit/resources/azure_data_factory_test.rb index a9e0afe45..be28ee2ad 100644 --- a/test/unit/resources/azure_data_factory_test.rb +++ b/test/unit/resources/azure_data_factory_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_data_factory' +require_relative "helper" +require "azure_data_factory" class AzureDataFactoryTestConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureDataFactory.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureDataFactory.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureDataFactory.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureDataFactory.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_data_lake_storage_gen2_filesystem_test.rb b/test/unit/resources/azure_data_lake_storage_gen2_filesystem_test.rb index ee5d14d7a..8433ab872 100644 --- a/test/unit/resources/azure_data_lake_storage_gen2_filesystem_test.rb +++ b/test/unit/resources/azure_data_lake_storage_gen2_filesystem_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_data_lake_storage_gen2_filesystem' +require_relative "helper" +require "azure_data_lake_storage_gen2_filesystem" class AzureDataLakeStorageGen2FilesystemConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureDataLakeStorageGen2Filesystem.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureDataLakeStorageGen2Filesystem.new(resource_provider: "some_type") } end def test_resource_group_name_alone_ok - assert_raises(ArgumentError) { AzureDataLakeStorageGen2Filesystem.new(name: 'my-name', resource_group: 'test') } + assert_raises(ArgumentError) { AzureDataLakeStorageGen2Filesystem.new(name: "my-name", resource_group: "test") } end end diff --git a/test/unit/resources/azure_data_lake_storage_gen2_filesystems_test.rb b/test/unit/resources/azure_data_lake_storage_gen2_filesystems_test.rb index a537c06c9..1ecf97ecb 100644 --- a/test/unit/resources/azure_data_lake_storage_gen2_filesystems_test.rb +++ b/test/unit/resources/azure_data_lake_storage_gen2_filesystems_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_data_lake_storage_gen2_filesystems' +require_relative "helper" +require "azure_data_lake_storage_gen2_filesystems" class AzureDataLakeStorageGen2FilesystemsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureDataLakeStorageGen2Filesystems.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureDataLakeStorageGen2Filesystems.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureDataLakeStorageGen2Filesystems.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureDataLakeStorageGen2Filesystems.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureDataLakeStorageGen2Filesystems.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureDataLakeStorageGen2Filesystems.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureDataLakeStorageGen2Filesystems.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureDataLakeStorageGen2Filesystems.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_data_lake_storage_gen2_path_test.rb b/test/unit/resources/azure_data_lake_storage_gen2_path_test.rb index 2c8fdd5a9..b55778543 100644 --- a/test/unit/resources/azure_data_lake_storage_gen2_path_test.rb +++ b/test/unit/resources/azure_data_lake_storage_gen2_path_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_data_lake_storage_gen2_path' +require_relative "helper" +require "azure_data_lake_storage_gen2_path" class AzureDataLakeStorageGen2PathConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureDataLakeStorageGen2Path.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureDataLakeStorageGen2Path.new(resource_provider: "some_type") } end def test_resource_group_name_alone_ok - assert_raises(ArgumentError) { AzureDataLakeStorageGen2Path.new(name: 'my-name', resource_group: 'test') } + assert_raises(ArgumentError) { AzureDataLakeStorageGen2Path.new(name: "my-name", resource_group: "test") } end end diff --git a/test/unit/resources/azure_data_lake_storage_gen2_paths_test.rb b/test/unit/resources/azure_data_lake_storage_gen2_paths_test.rb index 953a412f6..2cd154a4d 100644 --- a/test/unit/resources/azure_data_lake_storage_gen2_paths_test.rb +++ b/test/unit/resources/azure_data_lake_storage_gen2_paths_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_data_lake_storage_gen2_paths' +require_relative "helper" +require "azure_data_lake_storage_gen2_paths" class AzureDataLakeStorageGen2PathsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureDataLakeStorageGen2Paths.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureDataLakeStorageGen2Paths.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureDataLakeStorageGen2Paths.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureDataLakeStorageGen2Paths.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureDataLakeStorageGen2Paths.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureDataLakeStorageGen2Paths.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureDataLakeStorageGen2Paths.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureDataLakeStorageGen2Paths.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_db_migration_service_test.rb b/test/unit/resources/azure_db_migration_service_test.rb index 5c395fd99..b8f85854f 100644 --- a/test/unit/resources/azure_db_migration_service_test.rb +++ b/test/unit/resources/azure_db_migration_service_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_db_migration_service' +require_relative "helper" +require "azure_db_migration_service" class AzureDBMigrationServiceConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -7,6 +7,6 @@ def test_empty_param_not_ok end def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureDBMigrationService.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureDBMigrationService.new(resource_provider: "some_type") } end end diff --git a/test/unit/resources/azure_db_migration_services_test.rb b/test/unit/resources/azure_db_migration_services_test.rb index 13f77d978..bf1dd1cba 100644 --- a/test/unit/resources/azure_db_migration_services_test.rb +++ b/test/unit/resources/azure_db_migration_services_test.rb @@ -1,16 +1,16 @@ -require_relative 'helper' -require 'azure_db_migration_services' +require_relative "helper" +require "azure_db_migration_services" class AzureDBMigrationServicesConstructorTest < Minitest::Test def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureDBMigrationServices.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureDBMigrationServices.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureDBMigrationServices.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureDBMigrationServices.new(tag_value: "some_tag_value") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureDBMigrationServices.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureDBMigrationServices.new(resource_id: "some_id") } end end diff --git a/test/unit/resources/azure_ddos_protection_resource_test.rb b/test/unit/resources/azure_ddos_protection_resource_test.rb index e73331c17..25eca46bc 100644 --- a/test/unit/resources/azure_ddos_protection_resource_test.rb +++ b/test/unit/resources/azure_ddos_protection_resource_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_ddos_protection_resource' +require_relative "helper" +require "azure_ddos_protection_resource" class AzureDdosProtectionResourceConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureDdosProtectionResource.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureDdosProtectionResource.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureDdosProtectionResource.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureDdosProtectionResource.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_ddos_protection_resources_test.rb b/test/unit/resources/azure_ddos_protection_resources_test.rb index aa5de7fa1..b1e37de6c 100644 --- a/test/unit/resources/azure_ddos_protection_resources_test.rb +++ b/test/unit/resources/azure_ddos_protection_resources_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_ddos_protection_resources' +require_relative "helper" +require "azure_ddos_protection_resources" class AzureDdosProtectionResourcesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureDdosProtectionResources.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureDdosProtectionResources.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureDdosProtectionResources.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureDdosProtectionResources.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureDdosProtectionResources.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureDdosProtectionResources.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureDdosProtectionResources.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureDdosProtectionResources.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureDdosProtectionResources.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureDdosProtectionResources.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_dns_zones_resource_test.rb b/test/unit/resources/azure_dns_zones_resource_test.rb index 2fe46fb91..30edbb304 100644 --- a/test/unit/resources/azure_dns_zones_resource_test.rb +++ b/test/unit/resources/azure_dns_zones_resource_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_dns_zones_resource' +require_relative "helper" +require "azure_dns_zones_resource" class AzureDNSResourceConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureDNSZonesResource.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureDNSZonesResource.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureDNSZonesResource.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureDNSZonesResource.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureDNSZonesResource.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureDNSZonesResource.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureDNSZonesResource.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureDNSZonesResource.new(resource_id: "some_id") } end end diff --git a/test/unit/resources/azure_dns_zones_resources_test.rb b/test/unit/resources/azure_dns_zones_resources_test.rb index 0d439453c..b5f0097c8 100644 --- a/test/unit/resources/azure_dns_zones_resources_test.rb +++ b/test/unit/resources/azure_dns_zones_resources_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_dns_zones_resources' +require_relative "helper" +require "azure_dns_zones_resources" class AzureDNSZonesResourcesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureDNSZonesResources.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureDNSZonesResources.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureDNSZonesResources.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureDNSZonesResources.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureDNSZonesResources.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureDNSZonesResources.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureDNSZonesResources.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureDNSZonesResources.new(resource_id: "some_id") } end end diff --git a/test/unit/resources/azure_event_hub_authorization_rule_test.rb b/test/unit/resources/azure_event_hub_authorization_rule_test.rb index eede65657..89afa8469 100644 --- a/test/unit/resources/azure_event_hub_authorization_rule_test.rb +++ b/test/unit/resources/azure_event_hub_authorization_rule_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_event_hub_authorization_rule' +require_relative "helper" +require "azure_event_hub_authorization_rule" class AzureEventHubAuthorizationRuleConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureEventHubAuthorizationRule.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureEventHubAuthorizationRule.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureEventHubAuthorizationRule.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureEventHubAuthorizationRule.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_event_hub_event_hub_test.rb b/test/unit/resources/azure_event_hub_event_hub_test.rb index 98dc2ddca..f1302e781 100644 --- a/test/unit/resources/azure_event_hub_event_hub_test.rb +++ b/test/unit/resources/azure_event_hub_event_hub_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_event_hub_event_hub' +require_relative "helper" +require "azure_event_hub_event_hub" class AzureEventHubEventHubConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureEventHubEventHub.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureEventHubEventHub.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureEventHubEventHub.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureEventHubEventHub.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_event_hub_namespace_test.rb b/test/unit/resources/azure_event_hub_namespace_test.rb index 15b53073a..119fcacf7 100644 --- a/test/unit/resources/azure_event_hub_namespace_test.rb +++ b/test/unit/resources/azure_event_hub_namespace_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_event_hub_namespace' +require_relative "helper" +require "azure_event_hub_namespace" class AzureEventHubNamespaceConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureEventHubNamespace.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureEventHubNamespace.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureEventHubNamespace.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureEventHubNamespace.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_express_route_circuit_test.rb b/test/unit/resources/azure_express_route_circuit_test.rb index 1394858cb..061fa55d6 100644 --- a/test/unit/resources/azure_express_route_circuit_test.rb +++ b/test/unit/resources/azure_express_route_circuit_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_express_route_circuit' +require_relative "helper" +require "azure_express_route_circuit" class AzureExpressRouteCircuitConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureExpressRouteCircuit.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureExpressRouteCircuit.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureExpressRouteCircuit.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureExpressRouteCircuit.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_express_route_circuits_test.rb b/test/unit/resources/azure_express_route_circuits_test.rb index 461e2f0da..ec1ce8fdb 100644 --- a/test/unit/resources/azure_express_route_circuits_test.rb +++ b/test/unit/resources/azure_express_route_circuits_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_express_route_circuits' +require_relative "helper" +require "azure_express_route_circuits" class AzureExpressRouteCircuitsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureExpressRouteCircuits.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureExpressRouteCircuits.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureExpressRouteCircuits.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureExpressRouteCircuits.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureExpressRouteCircuits.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureExpressRouteCircuits.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureExpressRouteCircuits.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureExpressRouteCircuits.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureExpressRouteCircuits.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureExpressRouteCircuits.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_express_route_providers_test.rb b/test/unit/resources/azure_express_route_providers_test.rb index 078f703a7..24b940cbb 100644 --- a/test/unit/resources/azure_express_route_providers_test.rb +++ b/test/unit/resources/azure_express_route_providers_test.rb @@ -1,24 +1,24 @@ -require_relative 'helper' -require 'azure_express_route_providers' +require_relative "helper" +require "azure_express_route_providers" class AzureExpressRouteServiceProvidersConstructorTest < Minitest::Test def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureExpressRouteServiceProviders.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureExpressRouteServiceProviders.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureExpressRouteServiceProviders.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureExpressRouteServiceProviders.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureExpressRouteServiceProviders.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureExpressRouteServiceProviders.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureExpressRouteServiceProviders.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureExpressRouteServiceProviders.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureExpressRouteServiceProviders.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureExpressRouteServiceProviders.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_generic_resource_test.rb b/test/unit/resources/azure_generic_resource_test.rb index 44ed11466..a38d1a360 100644 --- a/test/unit/resources/azure_generic_resource_test.rb +++ b/test/unit/resources/azure_generic_resource_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_generic_resource' +require_relative "helper" +require "azure_generic_resource" class AzureGenericResourceConstructorTest < Minitest::Test # Generic resource requires a parameter. @@ -12,15 +12,15 @@ def test_empty_params_not_ok # They all exist in resource_id: # /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} def test_only_resource_id_ok - assert_raises(ArgumentError) { AzureGenericResource.new(resource_id: 'some_id', resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureGenericResource.new(resource_id: "some_id", resource_provider: "some_type") } end def test_invalid_endpoint - assert_raises(ArgumentError) { AzureGenericResource.new(endpoint: 'fake_endpoint') } + assert_raises(ArgumentError) { AzureGenericResource.new(endpoint: "fake_endpoint") } end def test_resource_uri # add_subscription_id, name and resource_uri have to be provided together - assert_raises(ArgumentError) { AzureGenericResource.new(resource_uri: 'test') } + assert_raises(ArgumentError) { AzureGenericResource.new(resource_uri: "test") } end end diff --git a/test/unit/resources/azure_generic_resources_test.rb b/test/unit/resources/azure_generic_resources_test.rb index 59b178051..3101a5d4a 100644 --- a/test/unit/resources/azure_generic_resources_test.rb +++ b/test/unit/resources/azure_generic_resources_test.rb @@ -1,18 +1,18 @@ -require_relative 'helper' -require 'azure_generic_resources' +require_relative "helper" +require "azure_generic_resources" class AzureGenericResourcesConstructorTest < Minitest::Test # resource_id is not allowed def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureGenericResources.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureGenericResources.new(resource_id: "some_id") } end def test_api_version_not_ok - assert_raises(ArgumentError) { AzureGenericResources.new(api_version: '2020-01-01') } + assert_raises(ArgumentError) { AzureGenericResources.new(api_version: "2020-01-01") } end def test_resource_uri # add_subscription_id and resource_uri have to be provided together - assert_raises(ArgumentError) { AzureGenericResources.new(resource_uri: 'test') } + assert_raises(ArgumentError) { AzureGenericResources.new(resource_uri: "test") } end end diff --git a/test/unit/resources/azure_graph_generic_resource_test.rb b/test/unit/resources/azure_graph_generic_resource_test.rb index 59910c9c2..25f9c8ada 100644 --- a/test/unit/resources/azure_graph_generic_resource_test.rb +++ b/test/unit/resources/azure_graph_generic_resource_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_graph_generic_resource' +require_relative "helper" +require "azure_graph_generic_resource" class AzureGraphGenericResourceConstructorTest < Minitest::Test # Generic resource requires a parameter. @@ -8,17 +8,17 @@ def test_empty_params_not_ok end def test_not_allowed_parameter - assert_raises(ArgumentError) { AzureGraphGenericResource.new(resource: 'users', id: 'some_id', fake: 'rubbish') } + assert_raises(ArgumentError) { AzureGraphGenericResource.new(resource: "users", id: "some_id", fake: "rubbish") } end def test_filter_not_allowed - assert_raises(ArgumentError) { AzureGraphGenericResource.new(resource: 'users', id: 'some_id', filter: 'rubbish') } + assert_raises(ArgumentError) { AzureGraphGenericResource.new(resource: "users", id: "some_id", filter: "rubbish") } end def test_resource_identifier_is_a_list assert_raises(ArgumentError) do - AzureGraphGenericResource.new(resource: 'users', id: 'some_id', - resource_identifier: 'rubbish') + AzureGraphGenericResource.new(resource: "users", id: "some_id", + resource_identifier: "rubbish") end end end diff --git a/test/unit/resources/azure_graph_generic_resources_test.rb b/test/unit/resources/azure_graph_generic_resources_test.rb index fd9d15834..f471b983a 100644 --- a/test/unit/resources/azure_graph_generic_resources_test.rb +++ b/test/unit/resources/azure_graph_generic_resources_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_graph_generic_resources' +require_relative "helper" +require "azure_graph_generic_resources" class AzureGraphGenericResourcesConstructorTest < Minitest::Test # Generic resource requires `resource` parameter at least. @@ -8,17 +8,17 @@ def test_empty_params_not_ok end def test_not_allowed_parameter - assert_raises(ArgumentError) { AzureGraphGenericResources.new(resource: 'users', fake: 'rubbish') } + assert_raises(ArgumentError) { AzureGraphGenericResources.new(resource: "users", fake: "rubbish") } end def test_id_not_allowed - assert_raises(ArgumentError) { AzureGraphGenericResources.new(resource: 'users', id: 'some_id') } + assert_raises(ArgumentError) { AzureGraphGenericResources.new(resource: "users", id: "some_id") } end def test_filter_filter_free_text_together_not_allowed assert_raises(ArgumentError) do - AzureGraphGenericResources.new(resource: 'users', - filter: { name: 'some_id' }, filter_free_text: %w{some_filter}) + AzureGraphGenericResources.new(resource: "users", + filter: { name: "some_id" }, filter_free_text: %w{some_filter}) end end end diff --git a/test/unit/resources/azure_hdinsight_cluster_test.rb b/test/unit/resources/azure_hdinsight_cluster_test.rb index 5a80e8b60..bf2c6eb72 100644 --- a/test/unit/resources/azure_hdinsight_cluster_test.rb +++ b/test/unit/resources/azure_hdinsight_cluster_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_hdinsight_cluster' +require_relative "helper" +require "azure_hdinsight_cluster" class AzureHdinsightClusterConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureHdinsightCluster.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureHdinsightCluster.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureHdinsightCluster.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureHdinsightCluster.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_hpc_asc_operation_test.rb b/test/unit/resources/azure_hpc_asc_operation_test.rb index 9cae6ec55..84d721057 100644 --- a/test/unit/resources/azure_hpc_asc_operation_test.rb +++ b/test/unit/resources/azure_hpc_asc_operation_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_hpc_asc_operation' +require_relative "helper" +require "azure_hpc_asc_operation" class AzureHPCASCOperationConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureHPCASCOperation.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureHPCASCOperation.new(resource_provider: "some_type") } end def test_resource_group_name_alone_not_ok - assert_raises(ArgumentError) { AzureHPCASCOperation.new(resource_group: 'test') } + assert_raises(ArgumentError) { AzureHPCASCOperation.new(resource_group: "test") } end end diff --git a/test/unit/resources/azure_hpc_cache_skus_test.rb b/test/unit/resources/azure_hpc_cache_skus_test.rb index ede585835..21040f43a 100644 --- a/test/unit/resources/azure_hpc_cache_skus_test.rb +++ b/test/unit/resources/azure_hpc_cache_skus_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_hpc_cache_skus' +require_relative "helper" +require "azure_hpc_cache_skus" class AzureHPCCacheSKUsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureHPCCacheSKUs.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureHPCCacheSKUs.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureHPCCacheSKUs.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureHPCCacheSKUs.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureHPCCacheSKUs.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureHPCCacheSKUs.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureHPCCacheSKUs.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureHPCCacheSKUs.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_hpc_cache_test.rb b/test/unit/resources/azure_hpc_cache_test.rb index 55bf2f545..80dcf7a24 100644 --- a/test/unit/resources/azure_hpc_cache_test.rb +++ b/test/unit/resources/azure_hpc_cache_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_hpc_cache' +require_relative "helper" +require "azure_hpc_cache" class AzureHPCCacheConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureHPCCache.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureHPCCache.new(resource_provider: "some_type") } end def test_resource_group_name_alone_not_ok - assert_raises(ArgumentError) { AzureHPCCache.new(resource_group: 'test') } + assert_raises(ArgumentError) { AzureHPCCache.new(resource_group: "test") } end end diff --git a/test/unit/resources/azure_hpc_caches_test.rb b/test/unit/resources/azure_hpc_caches_test.rb index a50e8b4df..1a258539b 100644 --- a/test/unit/resources/azure_hpc_caches_test.rb +++ b/test/unit/resources/azure_hpc_caches_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_hpc_caches' +require_relative "helper" +require "azure_hpc_caches" class AzureHPCCachesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureHPCCaches.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureHPCCaches.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureHPCCaches.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureHPCCaches.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureHPCCaches.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureHPCCaches.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureHPCCaches.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureHPCCaches.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_hpc_storage_target_test.rb b/test/unit/resources/azure_hpc_storage_target_test.rb index 1696c9c1e..ba151184e 100644 --- a/test/unit/resources/azure_hpc_storage_target_test.rb +++ b/test/unit/resources/azure_hpc_storage_target_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_hpc_storage_target' +require_relative "helper" +require "azure_hpc_storage_target" class AzureHPCStorageTargetConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureHPCStorageTarget.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureHPCStorageTarget.new(resource_provider: "some_type") } end def test_resource_group_name_alone_not_ok - assert_raises(ArgumentError) { AzureHPCStorageTarget.new(resource_group: 'test') } + assert_raises(ArgumentError) { AzureHPCStorageTarget.new(resource_group: "test") } end end diff --git a/test/unit/resources/azure_hpc_storage_targets_test.rb b/test/unit/resources/azure_hpc_storage_targets_test.rb index c05bccc38..a36a5d725 100644 --- a/test/unit/resources/azure_hpc_storage_targets_test.rb +++ b/test/unit/resources/azure_hpc_storage_targets_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_hpc_storage_targets' +require_relative "helper" +require "azure_hpc_storage_targets" class AzureHPCStorageTargetsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureHPCStorageTargets.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureHPCStorageTargets.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureHPCStorageTargets.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureHPCStorageTargets.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureHPCStorageTargets.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureHPCStorageTargets.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureHPCStorageTargets.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureHPCStorageTargets.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_iothub_event_hub_consumer_group_test.rb b/test/unit/resources/azure_iothub_event_hub_consumer_group_test.rb index bc95495ea..7a26afd87 100644 --- a/test/unit/resources/azure_iothub_event_hub_consumer_group_test.rb +++ b/test/unit/resources/azure_iothub_event_hub_consumer_group_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_iothub_event_hub_consumer_group' +require_relative "helper" +require "azure_iothub_event_hub_consumer_group" class AzureIotHubEventHubConsumerGroupConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureIotHubEventHubConsumerGroup.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureIotHubEventHubConsumerGroup.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureIotHubEventHubConsumerGroup.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureIotHubEventHubConsumerGroup.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_iothub_event_hub_consumer_groups_test.rb b/test/unit/resources/azure_iothub_event_hub_consumer_groups_test.rb index de2406d2f..97c1232c7 100644 --- a/test/unit/resources/azure_iothub_event_hub_consumer_groups_test.rb +++ b/test/unit/resources/azure_iothub_event_hub_consumer_groups_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_iothub_event_hub_consumer_groups' +require_relative "helper" +require "azure_iothub_event_hub_consumer_groups" class AzureIotHubEventHubConsumerGroupsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureIotHubEventHubConsumerGroups.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureIotHubEventHubConsumerGroups.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureIotHubEventHubConsumerGroups.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureIotHubEventHubConsumerGroups.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureIotHubEventHubConsumerGroups.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureIotHubEventHubConsumerGroups.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureIotHubEventHubConsumerGroups.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureIotHubEventHubConsumerGroups.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureIotHubEventHubConsumerGroups.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureIotHubEventHubConsumerGroups.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_iothub_test.rb b/test/unit/resources/azure_iothub_test.rb index 74edf34a3..bad3c0a1f 100644 --- a/test/unit/resources/azure_iothub_test.rb +++ b/test/unit/resources/azure_iothub_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_iothub' +require_relative "helper" +require "azure_iothub" class AzureIotHubConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureIotHub.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureIotHub.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureIotHub.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureIotHub.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_key_vault_key_test.rb b/test/unit/resources/azure_key_vault_key_test.rb index 7291430c6..f8b5a1778 100644 --- a/test/unit/resources/azure_key_vault_key_test.rb +++ b/test/unit/resources/azure_key_vault_key_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_key_vault_key' +require_relative "helper" +require "azure_key_vault_key" class AzureKeyVaultKeyConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureKeyVaultKey.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureKeyVaultKey.new(resource_provider: "some_type") } end def test_missing_argument - assert_raises(ArgumentError) { AzureKeyVaultKey.new(vault_name: 'my-name') } + assert_raises(ArgumentError) { AzureKeyVaultKey.new(vault_name: "my-name") } end end diff --git a/test/unit/resources/azure_key_vault_keys_test.rb b/test/unit/resources/azure_key_vault_keys_test.rb index ac8a3042e..5400c4932 100644 --- a/test/unit/resources/azure_key_vault_keys_test.rb +++ b/test/unit/resources/azure_key_vault_keys_test.rb @@ -1,20 +1,20 @@ -require_relative 'helper' -require 'azure_key_vault_keys' +require_relative "helper" +require "azure_key_vault_keys" class AzureKeyVaultKeysConstructorTest < Minitest::Test def tag_value_not_ok - assert_raises(ArgumentError) { AzureKeyVaultKeys.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureKeyVaultKeys.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureKeyVaultKeys.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureKeyVaultKeys.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureKeyVaultKeys.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureKeyVaultKeys.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureKeyVaultKeys.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureKeyVaultKeys.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_key_vault_secret_test.rb b/test/unit/resources/azure_key_vault_secret_test.rb index 917bc00a5..3378fdfd0 100644 --- a/test/unit/resources/azure_key_vault_secret_test.rb +++ b/test/unit/resources/azure_key_vault_secret_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_key_vault_secret' +require_relative "helper" +require "azure_key_vault_secret" class AzureKeyVaultSecretConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureKeyVaultSecret.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureKeyVaultSecret.new(resource_provider: "some_type") } end def test_missing_argument - assert_raises(ArgumentError) { AzureKeyVaultSecret.new(vault_name: 'my-name') } + assert_raises(ArgumentError) { AzureKeyVaultSecret.new(vault_name: "my-name") } end end diff --git a/test/unit/resources/azure_key_vault_secrets_test.rb b/test/unit/resources/azure_key_vault_secrets_test.rb index b15ca03f6..9f0f664fd 100644 --- a/test/unit/resources/azure_key_vault_secrets_test.rb +++ b/test/unit/resources/azure_key_vault_secrets_test.rb @@ -1,20 +1,20 @@ -require_relative 'helper' -require 'azure_key_vault_secrets' +require_relative "helper" +require "azure_key_vault_secrets" class AzureKeyVaultSecretsConstructorTest < Minitest::Test def tag_value_not_ok - assert_raises(ArgumentError) { AzureKeyVaultSecrets.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureKeyVaultSecrets.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureKeyVaultSecrets.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureKeyVaultSecrets.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureKeyVaultSecrets.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureKeyVaultSecrets.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureKeyVaultSecrets.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureKeyVaultSecrets.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_key_vault_test.rb b/test/unit/resources/azure_key_vault_test.rb index 344032bcf..d8e950da7 100644 --- a/test/unit/resources/azure_key_vault_test.rb +++ b/test/unit/resources/azure_key_vault_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_key_vault' +require_relative "helper" +require "azure_key_vault" class AzureKeyVaultConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureKeyVault.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureKeyVault.new(resource_provider: "some_type") } end def test_resource_group_should_exist - assert_raises(ArgumentError) { AzureKeyVault.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureKeyVault.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_key_vaults_test.rb b/test/unit/resources/azure_key_vaults_test.rb index c8dd78f34..b89100404 100644 --- a/test/unit/resources/azure_key_vaults_test.rb +++ b/test/unit/resources/azure_key_vaults_test.rb @@ -1,24 +1,24 @@ -require_relative 'helper' -require 'azure_key_vaults' +require_relative "helper" +require "azure_key_vaults" class AzureKeyVaultsConstructorTest < Minitest::Test def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureKeyVaults.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureKeyVaults.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureKeyVaults.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureKeyVaults.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureKeyVaults.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureKeyVaults.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureKeyVaults.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureKeyVaults.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureKeyVaults.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureKeyVaults.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_load_balancer_test.rb b/test/unit/resources/azure_load_balancer_test.rb index 5edab232f..59d5da9a9 100644 --- a/test/unit/resources/azure_load_balancer_test.rb +++ b/test/unit/resources/azure_load_balancer_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_load_balancer' +require_relative "helper" +require "azure_load_balancer" class AzureLoadBalancerConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureLoadBalancer.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureLoadBalancer.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureLoadBalancer.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureLoadBalancer.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_load_balancers_test.rb b/test/unit/resources/azure_load_balancers_test.rb index 5b94ad72d..f61c0a908 100644 --- a/test/unit/resources/azure_load_balancers_test.rb +++ b/test/unit/resources/azure_load_balancers_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_load_balancers' +require_relative "helper" +require "azure_load_balancers" class AzureLoadBalancersConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureLoadBalancers.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureLoadBalancers.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureLoadBalancers.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureLoadBalancers.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureLoadBalancers.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureLoadBalancers.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureLoadBalancers.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureLoadBalancers.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureLoadBalancers.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureLoadBalancers.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_lock_test.rb b/test/unit/resources/azure_lock_test.rb index 1f43f293e..1608e958f 100644 --- a/test/unit/resources/azure_lock_test.rb +++ b/test/unit/resources/azure_lock_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_lock' +require_relative "helper" +require "azure_lock" class AzureLockConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureLock.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureLock.new(resource_provider: "some_type") } end def test_resource_group_name_not_ok - assert_raises(ArgumentError) { AzureLock.new(name: 'my-name', resource_group: 'test') } + assert_raises(ArgumentError) { AzureLock.new(name: "my-name", resource_group: "test") } end end diff --git a/test/unit/resources/azure_locks_test.rb b/test/unit/resources/azure_locks_test.rb index 4aded7dd3..0767c728f 100644 --- a/test/unit/resources/azure_locks_test.rb +++ b/test/unit/resources/azure_locks_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_locks' +require_relative "helper" +require "azure_locks" class AzureLocksConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureLocks.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureLocks.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureLocks.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureLocks.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureLocks.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureLocks.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureLocks.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureLocks.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_managed_application_test.rb b/test/unit/resources/azure_managed_application_test.rb index 9ea1fcdd8..b26824557 100644 --- a/test/unit/resources/azure_managed_application_test.rb +++ b/test/unit/resources/azure_managed_application_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_managed_application' +require_relative "helper" +require "azure_managed_application" class AzureManagedApplicationConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureManagedApplication.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureManagedApplication.new(resource_provider: "some_type") } end def test_resource_group_name_alone_not_ok - assert_raises(ArgumentError) { AzureManagedApplication.new(resource_group: 'test') } + assert_raises(ArgumentError) { AzureManagedApplication.new(resource_group: "test") } end end diff --git a/test/unit/resources/azure_managed_applications_test.rb b/test/unit/resources/azure_managed_applications_test.rb index 722fd77cc..662c94c79 100644 --- a/test/unit/resources/azure_managed_applications_test.rb +++ b/test/unit/resources/azure_managed_applications_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_managed_applications' +require_relative "helper" +require "azure_managed_applications" class AzureManagedApplicationsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureManagedApplications.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureManagedApplications.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureManagedApplications.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureManagedApplications.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureManagedApplications.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureManagedApplications.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureManagedApplications.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureManagedApplications.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_management_group_test.rb b/test/unit/resources/azure_management_group_test.rb index c11237721..1b79edf6c 100644 --- a/test/unit/resources/azure_management_group_test.rb +++ b/test/unit/resources/azure_management_group_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_management_group' +require_relative "helper" +require "azure_management_group" class AzureManagementGroupConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,6 +8,6 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureManagementGroup.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureManagementGroup.new(resource_provider: "some_type") } end end diff --git a/test/unit/resources/azure_management_groups_test.rb b/test/unit/resources/azure_management_groups_test.rb index e8f11337b..725f8b2f4 100644 --- a/test/unit/resources/azure_management_groups_test.rb +++ b/test/unit/resources/azure_management_groups_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_management_groups' +require_relative "helper" +require "azure_management_groups" class AzureManagementGroupsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureManagementGroups.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureManagementGroups.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureManagementGroups.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureManagementGroups.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureManagementGroups.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureManagementGroups.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureManagementGroups.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureManagementGroups.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureManagementGroups.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureManagementGroups.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_mariadb_server_test.rb b/test/unit/resources/azure_mariadb_server_test.rb index 46129fce4..d16e9620d 100644 --- a/test/unit/resources/azure_mariadb_server_test.rb +++ b/test/unit/resources/azure_mariadb_server_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_mariadb_server' +require_relative "helper" +require "azure_mariadb_server" class AzureMariaDBServerConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureMariaDBServer.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMariaDBServer.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureMariaDBServer.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureMariaDBServer.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_mariadb_servers_test.rb b/test/unit/resources/azure_mariadb_servers_test.rb index 3b023c2d6..a223ebfbd 100644 --- a/test/unit/resources/azure_mariadb_servers_test.rb +++ b/test/unit/resources/azure_mariadb_servers_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_mariadb_servers' +require_relative "helper" +require "azure_mariadb_servers" class AzureMariaDBServersConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureMariaDBServers.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMariaDBServers.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureMariaDBServers.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureMariaDBServers.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureMariaDBServers.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureMariaDBServers.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureMariaDBServers.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureMariaDBServers.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureMariaDBServers.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureMariaDBServers.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_microsoft_defender_pricing_test.rb b/test/unit/resources/azure_microsoft_defender_pricing_test.rb index c20bd644d..130a96fad 100644 --- a/test/unit/resources/azure_microsoft_defender_pricing_test.rb +++ b/test/unit/resources/azure_microsoft_defender_pricing_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_microsoft_defender_pricing' +require_relative "helper" +require "azure_microsoft_defender_pricing" class AzureMicrosoftDefenderPricingConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,6 +8,6 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureMicrosoftDefenderPricing.new(resource_group: 'some_type') } + assert_raises(ArgumentError) { AzureMicrosoftDefenderPricing.new(resource_group: "some_type") } end end diff --git a/test/unit/resources/azure_microsoft_defender_pricings_test.rb b/test/unit/resources/azure_microsoft_defender_pricings_test.rb index d63af9690..9f233d360 100644 --- a/test/unit/resources/azure_microsoft_defender_pricings_test.rb +++ b/test/unit/resources/azure_microsoft_defender_pricings_test.rb @@ -1,8 +1,8 @@ -require_relative 'helper' -require 'azure_microsoft_defender_pricings' +require_relative "helper" +require "azure_microsoft_defender_pricings" class AzureMicrosoftDefenderPricingsTestConstructorTest < Minitest::Test def name_not_ok - assert_raises(ArgumentError) { AzureMicrosoftDefenderPricings.new(name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureMicrosoftDefenderPricings.new(name: "some_tag_name") } end end diff --git a/test/unit/resources/azure_microsoft_defender_security_contact_test.rb b/test/unit/resources/azure_microsoft_defender_security_contact_test.rb index cd77e7197..2b3d79ffe 100644 --- a/test/unit/resources/azure_microsoft_defender_security_contact_test.rb +++ b/test/unit/resources/azure_microsoft_defender_security_contact_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_microsoft_defender_security_contact' +require_relative "helper" +require "azure_microsoft_defender_security_contact" class AzureMicrosoftDefenderSecurityContactConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,6 +8,6 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureMicrosoftDefenderSecurityContact.new(resource_group: 'some_type') } + assert_raises(ArgumentError) { AzureMicrosoftDefenderSecurityContact.new(resource_group: "some_type") } end end diff --git a/test/unit/resources/azure_microsoft_defender_setting_test.rb b/test/unit/resources/azure_microsoft_defender_setting_test.rb index 50a84a2be..04e48f139 100644 --- a/test/unit/resources/azure_microsoft_defender_setting_test.rb +++ b/test/unit/resources/azure_microsoft_defender_setting_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_microsoft_defender_setting' +require_relative "helper" +require "azure_microsoft_defender_setting" class AzureMicrosoftDefenderSettingConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,6 +8,6 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureMicrosoftDefenderSetting.new(resource_group: 'some_type') } + assert_raises(ArgumentError) { AzureMicrosoftDefenderSetting.new(resource_group: "some_type") } end end diff --git a/test/unit/resources/azure_microsoft_defender_settings_test.rb b/test/unit/resources/azure_microsoft_defender_settings_test.rb index 622a47b19..5a3d108d2 100644 --- a/test/unit/resources/azure_microsoft_defender_settings_test.rb +++ b/test/unit/resources/azure_microsoft_defender_settings_test.rb @@ -1,8 +1,8 @@ -require_relative 'helper' -require 'azure_microsoft_defender_settings' +require_relative "helper" +require "azure_microsoft_defender_settings" class AzureMicrosoftDefenderSettingsTestConstructorTest < Minitest::Test def name_not_ok - assert_raises(ArgumentError) { AzureMicrosoftDefenderSettings.new(name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureMicrosoftDefenderSettings.new(name: "some_tag_name") } end end diff --git a/test/unit/resources/azure_migrate_assessment_group_test.rb b/test/unit/resources/azure_migrate_assessment_group_test.rb index 8dac5f1b6..49daee965 100644 --- a/test/unit/resources/azure_migrate_assessment_group_test.rb +++ b/test/unit/resources/azure_migrate_assessment_group_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_migrate_assessment_group' +require_relative "helper" +require "azure_migrate_assessment_group" class AzureMigrateAssessmentGroupConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureMigrateAssessmentGroup.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMigrateAssessmentGroup.new(resource_provider: "some_type") } end def test_resource_group_name_alone_ok - assert_raises(ArgumentError) { AzureMigrateAssessmentGroup.new(name: 'my-name', resource_group: 'test') } + assert_raises(ArgumentError) { AzureMigrateAssessmentGroup.new(name: "my-name", resource_group: "test") } end end diff --git a/test/unit/resources/azure_migrate_assessment_groups_test.rb b/test/unit/resources/azure_migrate_assessment_groups_test.rb index 442137411..514385dd0 100644 --- a/test/unit/resources/azure_migrate_assessment_groups_test.rb +++ b/test/unit/resources/azure_migrate_assessment_groups_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_migrate_assessment_groups' +require_relative "helper" +require "azure_migrate_assessment_groups" class AzureMigrateAssessmentGroupsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureMigrateAssessmentGroups.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMigrateAssessmentGroups.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureMigrateAssessmentGroups.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureMigrateAssessmentGroups.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureMigrateAssessmentGroups.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureMigrateAssessmentGroups.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureMigrateAssessmentGroups.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureMigrateAssessmentGroups.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_migrate_assessment_machine_test.rb b/test/unit/resources/azure_migrate_assessment_machine_test.rb index 656bedf92..be18b863a 100644 --- a/test/unit/resources/azure_migrate_assessment_machine_test.rb +++ b/test/unit/resources/azure_migrate_assessment_machine_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_migrate_assessment_machine' +require_relative "helper" +require "azure_migrate_assessment_machine" class AzureMigrateAssessmentMachineConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureMigrateAssessmentMachine.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMigrateAssessmentMachine.new(resource_provider: "some_type") } end def test_resource_group_name_alone_ok - assert_raises(ArgumentError) { AzureMigrateAssessmentMachine.new(name: 'my-name', resource_group: 'test') } + assert_raises(ArgumentError) { AzureMigrateAssessmentMachine.new(name: "my-name", resource_group: "test") } end end diff --git a/test/unit/resources/azure_migrate_assessment_machines_test.rb b/test/unit/resources/azure_migrate_assessment_machines_test.rb index f55125b48..6e43b7240 100644 --- a/test/unit/resources/azure_migrate_assessment_machines_test.rb +++ b/test/unit/resources/azure_migrate_assessment_machines_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_migrate_assessment_machines' +require_relative "helper" +require "azure_migrate_assessment_machines" class AzureMigrateAssessmentMachinesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureMigrateAssessmentMachines.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMigrateAssessmentMachines.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureMigrateAssessmentMachines.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureMigrateAssessmentMachines.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureMigrateAssessmentMachines.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureMigrateAssessmentMachines.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureMigrateAssessmentMachines.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureMigrateAssessmentMachines.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_migrate_assessment_project_test.rb b/test/unit/resources/azure_migrate_assessment_project_test.rb index 2164134aa..0ed1efb8c 100644 --- a/test/unit/resources/azure_migrate_assessment_project_test.rb +++ b/test/unit/resources/azure_migrate_assessment_project_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_migrate_assessment_project' +require_relative "helper" +require "azure_migrate_assessment_project" class AzureMigrateAssessmentProjectConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureMigrateAssessmentProject.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMigrateAssessmentProject.new(resource_provider: "some_type") } end def test_name_alone_ok - assert_raises(ArgumentError) { AzureMigrateAssessmentProject.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureMigrateAssessmentProject.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_migrate_assessment_projects_test.rb b/test/unit/resources/azure_migrate_assessment_projects_test.rb index 50b0f9f58..bb3091afc 100644 --- a/test/unit/resources/azure_migrate_assessment_projects_test.rb +++ b/test/unit/resources/azure_migrate_assessment_projects_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_migrate_assessment_projects' +require_relative "helper" +require "azure_migrate_assessment_projects" class AzureMigrateAssessmentProjectsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureMigrateAssessmentProjects.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMigrateAssessmentProjects.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureMigrateAssessmentProjects.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureMigrateAssessmentProjects.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureMigrateAssessmentProjects.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureMigrateAssessmentProjects.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureMigrateAssessmentProjects.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureMigrateAssessmentProjects.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_migrate_assessment_test.rb b/test/unit/resources/azure_migrate_assessment_test.rb index 3023040c1..a958ac2ae 100644 --- a/test/unit/resources/azure_migrate_assessment_test.rb +++ b/test/unit/resources/azure_migrate_assessment_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_migrate_assessment' +require_relative "helper" +require "azure_migrate_assessment" class AzureMigrateAssessmentConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureMigrateAssessment.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMigrateAssessment.new(resource_provider: "some_type") } end def test_resource_group_name_alone_ok - assert_raises(ArgumentError) { AzureMigrateAssessment.new(name: 'my-name', resource_group: 'test') } + assert_raises(ArgumentError) { AzureMigrateAssessment.new(name: "my-name", resource_group: "test") } end end diff --git a/test/unit/resources/azure_migrate_assessments_test.rb b/test/unit/resources/azure_migrate_assessments_test.rb index cbbca5b9b..2535e1f7b 100644 --- a/test/unit/resources/azure_migrate_assessments_test.rb +++ b/test/unit/resources/azure_migrate_assessments_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_migrate_assessments' +require_relative "helper" +require "azure_migrate_assessments" class AzureMigrateAssessmentsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureMigrateAssessments.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMigrateAssessments.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureMigrateAssessments.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureMigrateAssessments.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureMigrateAssessments.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureMigrateAssessments.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureMigrateAssessments.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureMigrateAssessments.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_migrate_project_database_instance_test.rb b/test/unit/resources/azure_migrate_project_database_instance_test.rb index 45beaf7e5..669aee40b 100644 --- a/test/unit/resources/azure_migrate_project_database_instance_test.rb +++ b/test/unit/resources/azure_migrate_project_database_instance_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_migrate_project_database_instance' +require_relative "helper" +require "azure_migrate_project_database_instance" class AzureMigrateProjectDatabaseInstanceConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureMigrateProjectDatabaseInstance.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMigrateProjectDatabaseInstance.new(resource_provider: "some_type") } end def test_resource_group_name_alone_ok - assert_raises(ArgumentError) { AzureMigrateProjectDatabaseInstance.new(name: 'my-name', resource_group: 'test') } + assert_raises(ArgumentError) { AzureMigrateProjectDatabaseInstance.new(name: "my-name", resource_group: "test") } end end diff --git a/test/unit/resources/azure_migrate_project_database_instances_test.rb b/test/unit/resources/azure_migrate_project_database_instances_test.rb index 0b0b34ff6..c27604bdf 100644 --- a/test/unit/resources/azure_migrate_project_database_instances_test.rb +++ b/test/unit/resources/azure_migrate_project_database_instances_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_migrate_project_database_instances' +require_relative "helper" +require "azure_migrate_project_database_instances" class AzureMigrateProjectDatabaseInstancesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureMigrateProjectDatabaseInstances.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMigrateProjectDatabaseInstances.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureMigrateProjectDatabaseInstances.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureMigrateProjectDatabaseInstances.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureMigrateProjectDatabaseInstances.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureMigrateProjectDatabaseInstances.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureMigrateProjectDatabaseInstances.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureMigrateProjectDatabaseInstances.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_migrate_project_database_test.rb b/test/unit/resources/azure_migrate_project_database_test.rb index 1a5e54ce0..fd6f10c77 100644 --- a/test/unit/resources/azure_migrate_project_database_test.rb +++ b/test/unit/resources/azure_migrate_project_database_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_migrate_project_database' +require_relative "helper" +require "azure_migrate_project_database" class AzureMigrateProjectDatabaseConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureMigrateProjectDatabase.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMigrateProjectDatabase.new(resource_provider: "some_type") } end def test_resource_group_name_alone_ok - assert_raises(ArgumentError) { AzureMigrateProjectDatabase.new(name: 'my-name', resource_group: 'test') } + assert_raises(ArgumentError) { AzureMigrateProjectDatabase.new(name: "my-name", resource_group: "test") } end end diff --git a/test/unit/resources/azure_migrate_project_databases_test.rb b/test/unit/resources/azure_migrate_project_databases_test.rb index 5d2b3f854..4bfb9d63d 100644 --- a/test/unit/resources/azure_migrate_project_databases_test.rb +++ b/test/unit/resources/azure_migrate_project_databases_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_migrate_project_databases' +require_relative "helper" +require "azure_migrate_project_databases" class AzureMigrateProjectDatabasesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureMigrateProjectDatabases.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMigrateProjectDatabases.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureMigrateProjectDatabases.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureMigrateProjectDatabases.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureMigrateProjectDatabases.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureMigrateProjectDatabases.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureMigrateProjectDatabases.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureMigrateProjectDatabases.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_migrate_project_event_test.rb b/test/unit/resources/azure_migrate_project_event_test.rb index 7a168c6c9..3095cffe0 100644 --- a/test/unit/resources/azure_migrate_project_event_test.rb +++ b/test/unit/resources/azure_migrate_project_event_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_migrate_project_event' +require_relative "helper" +require "azure_migrate_project_event" class AzureMigrateProjectEventConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureMigrateProjectEvent.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMigrateProjectEvent.new(resource_provider: "some_type") } end def test_resource_group_name_alone_ok - assert_raises(ArgumentError) { AzureMigrateProjectEvent.new(name: 'my-name', resource_group: 'test') } + assert_raises(ArgumentError) { AzureMigrateProjectEvent.new(name: "my-name", resource_group: "test") } end end diff --git a/test/unit/resources/azure_migrate_project_events_test.rb b/test/unit/resources/azure_migrate_project_events_test.rb index c87d7a7b0..e9e64e75c 100644 --- a/test/unit/resources/azure_migrate_project_events_test.rb +++ b/test/unit/resources/azure_migrate_project_events_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_migrate_project_events' +require_relative "helper" +require "azure_migrate_project_events" class AzureMigrateProjectEventsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureMigrateProjectEvents.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMigrateProjectEvents.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureMigrateProjectEvents.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureMigrateProjectEvents.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureMigrateProjectEvents.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureMigrateProjectEvents.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureMigrateProjectEvents.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureMigrateProjectEvents.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_migrate_project_machine_test.rb b/test/unit/resources/azure_migrate_project_machine_test.rb index 9c0d9cbba..acbc6f049 100644 --- a/test/unit/resources/azure_migrate_project_machine_test.rb +++ b/test/unit/resources/azure_migrate_project_machine_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_migrate_project_machine' +require_relative "helper" +require "azure_migrate_project_machine" class AzureMigrateProjectMachineConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureMigrateProjectMachine.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMigrateProjectMachine.new(resource_provider: "some_type") } end def test_resource_group_name_alone_ok - assert_raises(ArgumentError) { AzureMigrateProjectMachine.new(name: 'my-name', resource_group: 'test') } + assert_raises(ArgumentError) { AzureMigrateProjectMachine.new(name: "my-name", resource_group: "test") } end end diff --git a/test/unit/resources/azure_migrate_project_machines_test.rb b/test/unit/resources/azure_migrate_project_machines_test.rb index c5541f7e6..d3c0aa943 100644 --- a/test/unit/resources/azure_migrate_project_machines_test.rb +++ b/test/unit/resources/azure_migrate_project_machines_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_migrate_project_machines' +require_relative "helper" +require "azure_migrate_project_machines" class AzureMigrateProjectMachinesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureMigrateProjectMachines.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMigrateProjectMachines.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureMigrateProjectMachines.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureMigrateProjectMachines.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureMigrateProjectMachines.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureMigrateProjectMachines.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureMigrateProjectMachines.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureMigrateProjectMachines.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_migrate_project_solution_test.rb b/test/unit/resources/azure_migrate_project_solution_test.rb index 6aa23cc77..a2e2faecf 100644 --- a/test/unit/resources/azure_migrate_project_solution_test.rb +++ b/test/unit/resources/azure_migrate_project_solution_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_migrate_project_solution' +require_relative "helper" +require "azure_migrate_project_solution" class AzureMigrateProjectSolutionConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureMigrateProjectSolution.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMigrateProjectSolution.new(resource_provider: "some_type") } end def test_resource_group_name_alone_ok - assert_raises(ArgumentError) { AzureMigrateProjectSolution.new(name: 'my-name', resource_group: 'test') } + assert_raises(ArgumentError) { AzureMigrateProjectSolution.new(name: "my-name", resource_group: "test") } end end diff --git a/test/unit/resources/azure_migrate_project_solutions_test.rb b/test/unit/resources/azure_migrate_project_solutions_test.rb index 07141b783..8b1d41749 100644 --- a/test/unit/resources/azure_migrate_project_solutions_test.rb +++ b/test/unit/resources/azure_migrate_project_solutions_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_migrate_project_solutions' +require_relative "helper" +require "azure_migrate_project_solutions" class AzureMigrateProjectSolutionsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureMigrateProjectSolutions.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMigrateProjectSolutions.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureMigrateProjectSolutions.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureMigrateProjectSolutions.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureMigrateProjectSolutions.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureMigrateProjectSolutions.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureMigrateProjectSolutions.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureMigrateProjectSolutions.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_migrate_project_test.rb b/test/unit/resources/azure_migrate_project_test.rb index cda3707ad..b41eb4b75 100644 --- a/test/unit/resources/azure_migrate_project_test.rb +++ b/test/unit/resources/azure_migrate_project_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_migrate_project' +require_relative "helper" +require "azure_migrate_project" class AzureMigrateProjectConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureMigrateProject.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMigrateProject.new(resource_provider: "some_type") } end def test_resource_group_name_alone_ok - assert_raises(ArgumentError) { AzureMigrateProject.new(resource_group: 'test') } + assert_raises(ArgumentError) { AzureMigrateProject.new(resource_group: "test") } end end diff --git a/test/unit/resources/azure_monitor_activity_log_alert_test.rb b/test/unit/resources/azure_monitor_activity_log_alert_test.rb index b23fa6021..83590ba7a 100644 --- a/test/unit/resources/azure_monitor_activity_log_alert_test.rb +++ b/test/unit/resources/azure_monitor_activity_log_alert_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_monitor_activity_log_alert' +require_relative "helper" +require "azure_monitor_activity_log_alert" class AzureMonitorActivityLogAlertConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureMonitorActivityLogAlert.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMonitorActivityLogAlert.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureMonitorActivityLogAlert.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureMonitorActivityLogAlert.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_monitor_activity_log_alerts_test.rb b/test/unit/resources/azure_monitor_activity_log_alerts_test.rb index 66773728c..be3a799af 100644 --- a/test/unit/resources/azure_monitor_activity_log_alerts_test.rb +++ b/test/unit/resources/azure_monitor_activity_log_alerts_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_monitor_activity_log_alerts' +require_relative "helper" +require "azure_monitor_activity_log_alerts" class AzureMonitorActivityLogAlertsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureMonitorActivityLogAlerts.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMonitorActivityLogAlerts.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureMonitorActivityLogAlerts.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureMonitorActivityLogAlerts.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureMonitorActivityLogAlerts.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureMonitorActivityLogAlerts.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureMonitorActivityLogAlerts.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureMonitorActivityLogAlerts.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureMonitorActivityLogAlerts.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureMonitorActivityLogAlerts.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_monitor_log_profile_test.rb b/test/unit/resources/azure_monitor_log_profile_test.rb index 805346deb..32dd56cc0 100644 --- a/test/unit/resources/azure_monitor_log_profile_test.rb +++ b/test/unit/resources/azure_monitor_log_profile_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_monitor_log_profile' +require_relative "helper" +require "azure_monitor_log_profile" class AzureMonitorLogProfileConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,6 +8,6 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureMonitorLogProfile.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMonitorLogProfile.new(resource_provider: "some_type") } end end diff --git a/test/unit/resources/azure_monitor_log_profiles_test.rb b/test/unit/resources/azure_monitor_log_profiles_test.rb index 572829c59..7a96bf45c 100644 --- a/test/unit/resources/azure_monitor_log_profiles_test.rb +++ b/test/unit/resources/azure_monitor_log_profiles_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_monitor_log_profiles' +require_relative "helper" +require "azure_monitor_log_profiles" class AzureMonitorLogProfilesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureMonitorLogProfiles.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMonitorLogProfiles.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureMonitorLogProfiles.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureMonitorLogProfiles.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureMonitorLogProfiles.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureMonitorLogProfiles.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureMonitorLogProfiles.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureMonitorLogProfiles.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureMonitorLogProfiles.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureMonitorLogProfiles.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_mysql_database_configuration_test.rb b/test/unit/resources/azure_mysql_database_configuration_test.rb index 4159c0859..3276927d9 100644 --- a/test/unit/resources/azure_mysql_database_configuration_test.rb +++ b/test/unit/resources/azure_mysql_database_configuration_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_mysql_database_configuration' +require_relative "helper" +require "azure_mysql_database_configuration" class AzureMySqlDatabaseConfigurationConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureMySqlDatabaseConfiguration.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMySqlDatabaseConfiguration.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureMySqlDatabaseConfiguration.new(server_name: 'my-server-name', name: 'my-name') } + assert_raises(ArgumentError) { AzureMySqlDatabaseConfiguration.new(server_name: "my-server-name", name: "my-name") } end end diff --git a/test/unit/resources/azure_mysql_database_configurations_test.rb b/test/unit/resources/azure_mysql_database_configurations_test.rb index d7cfbcf02..7480d1163 100644 --- a/test/unit/resources/azure_mysql_database_configurations_test.rb +++ b/test/unit/resources/azure_mysql_database_configurations_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_mysql_database_configurations' +require_relative "helper" +require "azure_mysql_database_configurations" class AzureMySqlDatabaseConfigurationsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureMySqlDatabaseConfigurations.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMySqlDatabaseConfigurations.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureMySqlDatabaseConfigurations.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureMySqlDatabaseConfigurations.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureMySqlDatabaseConfigurations.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureMySqlDatabaseConfigurations.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureMySqlDatabaseConfigurations.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureMySqlDatabaseConfigurations.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureMySqlDatabaseConfigurations.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureMySqlDatabaseConfigurations.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_mysql_database_test.rb b/test/unit/resources/azure_mysql_database_test.rb index 425885a08..b5f6cb343 100644 --- a/test/unit/resources/azure_mysql_database_test.rb +++ b/test/unit/resources/azure_mysql_database_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_mysql_database' +require_relative "helper" +require "azure_mysql_database" class AzureMySqlDatabaseConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,14 +8,14 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureMySqlDatabase.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMySqlDatabase.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureMySqlDatabase.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureMySqlDatabase.new(name: "my-name") } end def test_server_name - assert_raises(ArgumentError) { AzureSqlDatabase.new(resource_group: 'my_group', name: 'my-name') } + assert_raises(ArgumentError) { AzureSqlDatabase.new(resource_group: "my_group", name: "my-name") } end end diff --git a/test/unit/resources/azure_mysql_databases_test.rb b/test/unit/resources/azure_mysql_databases_test.rb index 1f6e6c654..77f2e2b00 100644 --- a/test/unit/resources/azure_mysql_databases_test.rb +++ b/test/unit/resources/azure_mysql_databases_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_mysql_databases' +require_relative "helper" +require "azure_mysql_databases" class AzureMySqlDatabasesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureMySqlDatabases.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMySqlDatabases.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureMySqlDatabases.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureMySqlDatabases.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureMySqlDatabases.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureMySqlDatabases.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureMySqlDatabases.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureMySqlDatabases.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureMySqlDatabases.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureMySqlDatabases.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_mysql_server_test.rb b/test/unit/resources/azure_mysql_server_test.rb index 068f10fe0..a8cda7cbb 100644 --- a/test/unit/resources/azure_mysql_server_test.rb +++ b/test/unit/resources/azure_mysql_server_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_mysql_server' +require_relative "helper" +require "azure_mysql_server" class AzureMysqlServerConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureMysqlServer.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMysqlServer.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureMysqlServer.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureMysqlServer.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_mysql_servers_test.rb b/test/unit/resources/azure_mysql_servers_test.rb index a142429fc..05ad466fb 100644 --- a/test/unit/resources/azure_mysql_servers_test.rb +++ b/test/unit/resources/azure_mysql_servers_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_mysql_servers' +require_relative "helper" +require "azure_mysql_servers" class AzureMysqlServersConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureMysqlServers.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureMysqlServers.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureMysqlServers.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureMysqlServers.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureMysqlServers.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureMysqlServers.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureMysqlServers.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureMysqlServers.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureMysqlServers.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureMysqlServers.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_network_interface_test.rb b/test/unit/resources/azure_network_interface_test.rb index 104aee6cb..16d9c7268 100644 --- a/test/unit/resources/azure_network_interface_test.rb +++ b/test/unit/resources/azure_network_interface_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_network_interface' +require_relative "helper" +require "azure_network_interface" class AzureNetworkInterfaceConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureNetworkInterface.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureNetworkInterface.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureNetworkInterface.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureNetworkInterface.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_network_interfaces_test.rb b/test/unit/resources/azure_network_interfaces_test.rb index 3516df88d..b0e33489b 100644 --- a/test/unit/resources/azure_network_interfaces_test.rb +++ b/test/unit/resources/azure_network_interfaces_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_network_interfaces' +require_relative "helper" +require "azure_network_interfaces" class AzureNetworkInterfacesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureNetworkInterfaces.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureNetworkInterfaces.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureNetworkInterfaces.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureNetworkInterfaces.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureNetworkInterfaces.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureNetworkInterfaces.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureNetworkInterfaces.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureNetworkInterfaces.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureNetworkInterfaces.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureNetworkInterfaces.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_network_security_group_test.rb b/test/unit/resources/azure_network_security_group_test.rb index b7d090650..d802300b5 100644 --- a/test/unit/resources/azure_network_security_group_test.rb +++ b/test/unit/resources/azure_network_security_group_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_network_security_group' +require_relative "helper" +require "azure_network_security_group" class AzureNetworkSecurityGroupConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureNetworkSecurityGroup.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureNetworkSecurityGroup.new(resource_provider: "some_type") } end def test_resource_group_should_exist - assert_raises(ArgumentError) { AzureNetworkSecurityGroup.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureNetworkSecurityGroup.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_network_security_groups_test.rb b/test/unit/resources/azure_network_security_groups_test.rb index 7703a9dff..b5996186f 100644 --- a/test/unit/resources/azure_network_security_groups_test.rb +++ b/test/unit/resources/azure_network_security_groups_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_network_security_groups' +require_relative "helper" +require "azure_network_security_groups" class AzureNetworkSecurityGroupsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureNetworkSecurityGroups.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureNetworkSecurityGroups.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureNetworkSecurityGroups.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureNetworkSecurityGroups.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureNetworkSecurityGroups.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureNetworkSecurityGroups.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureNetworkSecurityGroups.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureNetworkSecurityGroups.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureNetworkSecurityGroups.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureNetworkSecurityGroups.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_network_watchers_test.rb b/test/unit/resources/azure_network_watchers_test.rb index eb3e25e3f..c3846bc8c 100644 --- a/test/unit/resources/azure_network_watchers_test.rb +++ b/test/unit/resources/azure_network_watchers_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_network_watchers' +require_relative "helper" +require "azure_network_watchers" class AzureNetworkWatchersConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureNetworkWatchers.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureNetworkWatchers.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureNetworkWatchers.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureNetworkWatchers.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureNetworkWatchers.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureNetworkWatchers.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureNetworkWatchers.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureNetworkWatchers.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureNetworkWatchers.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureNetworkWatchers.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_networke_watcher_test.rb b/test/unit/resources/azure_networke_watcher_test.rb index 60cb0fa59..4ebe40e24 100644 --- a/test/unit/resources/azure_networke_watcher_test.rb +++ b/test/unit/resources/azure_networke_watcher_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_network_watcher' +require_relative "helper" +require "azure_network_watcher" class AzureNetworkWatcherConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureNetworkWatcher.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureNetworkWatcher.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureNetworkWatcher.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureNetworkWatcher.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_policy_definition_test.rb b/test/unit/resources/azure_policy_definition_test.rb index 14d38e496..f10a3f35b 100644 --- a/test/unit/resources/azure_policy_definition_test.rb +++ b/test/unit/resources/azure_policy_definition_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_policy_definition' +require_relative "helper" +require "azure_policy_definition" class AzurePolicyDefinitionConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,11 +8,11 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzurePolicyDefinition.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePolicyDefinition.new(resource_provider: "some_type") } end # resource_group should not be allowed. def test_resource_group_not_ok - assert_raises(ArgumentError) { AzureRoleDefinition.new(resource_group: 'some_group') } + assert_raises(ArgumentError) { AzureRoleDefinition.new(resource_group: "some_group") } end end diff --git a/test/unit/resources/azure_policy_definitions_test.rb b/test/unit/resources/azure_policy_definitions_test.rb index 28a54bd2b..b8a5a4422 100644 --- a/test/unit/resources/azure_policy_definitions_test.rb +++ b/test/unit/resources/azure_policy_definitions_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_policy_definitions' +require_relative "helper" +require "azure_policy_definitions" class AzurePolicyDefinitionsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzurePolicyDefinitions.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePolicyDefinitions.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzurePolicyDefinitions.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzurePolicyDefinitions.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzurePolicyDefinitions.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzurePolicyDefinitions.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzurePolicyDefinitions.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzurePolicyDefinitions.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzurePolicyDefinitions.new(name: 'some_name') } + assert_raises(ArgumentError) { AzurePolicyDefinitions.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_policy_exemption_test.rb b/test/unit/resources/azure_policy_exemption_test.rb index 68eebe7c9..ea6ddc430 100644 --- a/test/unit/resources/azure_policy_exemption_test.rb +++ b/test/unit/resources/azure_policy_exemption_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_policy_exemption' +require_relative "helper" +require "azure_policy_exemption" class AzurePolicyExemptionConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -7,6 +7,6 @@ def test_empty_param_not_ok end def test_resource_group_alone_not_ok - assert_raises(ArgumentError) { AzurePolicyExemption.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePolicyExemption.new(resource_provider: "some_type") } end end diff --git a/test/unit/resources/azure_policy_exemptions_test.rb b/test/unit/resources/azure_policy_exemptions_test.rb index caee87a0e..97dae870a 100644 --- a/test/unit/resources/azure_policy_exemptions_test.rb +++ b/test/unit/resources/azure_policy_exemptions_test.rb @@ -1,12 +1,12 @@ -require_relative 'helper' -require 'azure_policy_exemptions' +require_relative "helper" +require "azure_policy_exemptions" class AzurePolicyExemptionsConstructorTest < Minitest::Test def tag_value_not_ok - assert_raises(ArgumentError) { AzurePolicyExemptions.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzurePolicyExemptions.new(tag_value: "some_tag_value") } end def test_resource_id_alone_not_ok - assert_raises(ArgumentError) { AzurePolicyExemptions.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzurePolicyExemptions.new(resource_id: "some_id") } end end diff --git a/test/unit/resources/azure_policy_insights_query_result_test.rb b/test/unit/resources/azure_policy_insights_query_result_test.rb index 058037eb3..e0ea0bc41 100644 --- a/test/unit/resources/azure_policy_insights_query_result_test.rb +++ b/test/unit/resources/azure_policy_insights_query_result_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_policy_insights_query_result' +require_relative "helper" +require "azure_policy_insights_query_result" class AzurePolicyInsightsQueryResultTest < Minitest::Test def test_empty_param_not_ok @@ -8,11 +8,11 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_only_policy_definition_not_ok - assert_raises(ArgumentError) { AzurePolicyInsightsQueryResult.new(policy_definition: 'new_policy') } + assert_raises(ArgumentError) { AzurePolicyInsightsQueryResult.new(policy_definition: "new_policy") } end def test_only_resource_id - resource_id = '/subscriptions/80b824de-ec53-4116-9868-3deeab10b0cd/resourcegroups/edm_app_management_storage/providers/microsoft.insights/actiongroups/application insights smart detection' + resource_id = "/subscriptions/80b824de-ec53-4116-9868-3deeab10b0cd/resourcegroups/edm_app_management_storage/providers/microsoft.insights/actiongroups/application insights smart detection" assert_raises(ArgumentError) { AzurePolicyInsightsQueryResult.new(resource_id: resource_id) } end end diff --git a/test/unit/resources/azure_policy_insights_query_results_test.rb b/test/unit/resources/azure_policy_insights_query_results_test.rb index c80d1771e..db093262a 100644 --- a/test/unit/resources/azure_policy_insights_query_results_test.rb +++ b/test/unit/resources/azure_policy_insights_query_results_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_policy_insights_query_results' +require_relative "helper" +require "azure_policy_insights_query_results" class AzurePolicyInsightsQueryResultsConstructorTest < Minitest::Test def test_empty_param_ok diff --git a/test/unit/resources/azure_postgresql_database_test.rb b/test/unit/resources/azure_postgresql_database_test.rb index 18f1fd110..affa53fa5 100644 --- a/test/unit/resources/azure_postgresql_database_test.rb +++ b/test/unit/resources/azure_postgresql_database_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_postgresql_database' +require_relative "helper" +require "azure_postgresql_database" class AzurePostgreSQLDatabaseConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzurePostgreSQLDatabase.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePostgreSQLDatabase.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzurePostgreSQLDatabase.new(name: 'my-name') } + assert_raises(ArgumentError) { AzurePostgreSQLDatabase.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_postgresql_databases_test.rb b/test/unit/resources/azure_postgresql_databases_test.rb index 49269f515..258d70210 100644 --- a/test/unit/resources/azure_postgresql_databases_test.rb +++ b/test/unit/resources/azure_postgresql_databases_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_postgresql_databases' +require_relative "helper" +require "azure_postgresql_databases" class AzurePostgreSQLDatabasesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzurePostgreSQLDatabases.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePostgreSQLDatabases.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzurePostgreSQLDatabases.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzurePostgreSQLDatabases.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzurePostgreSQLDatabases.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzurePostgreSQLDatabases.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzurePostgreSQLDatabases.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzurePostgreSQLDatabases.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzurePostgreSQLDatabases.new(name: 'some_name') } + assert_raises(ArgumentError) { AzurePostgreSQLDatabases.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_postgresql_server_test.rb b/test/unit/resources/azure_postgresql_server_test.rb index 2b85c0d89..4202392a5 100644 --- a/test/unit/resources/azure_postgresql_server_test.rb +++ b/test/unit/resources/azure_postgresql_server_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_postgresql_server' +require_relative "helper" +require "azure_postgresql_server" class AzurePostgreSQLServerConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzurePostgreSQLServer.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePostgreSQLServer.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzurePostgreSQLServer.new(name: 'my-name') } + assert_raises(ArgumentError) { AzurePostgreSQLServer.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_postgresql_servers_test.rb b/test/unit/resources/azure_postgresql_servers_test.rb index 9abd32c79..3da5294f2 100644 --- a/test/unit/resources/azure_postgresql_servers_test.rb +++ b/test/unit/resources/azure_postgresql_servers_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_postgresql_servers' +require_relative "helper" +require "azure_postgresql_servers" class AzurePostgreSQLServersConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzurePostgreSQLServers.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePostgreSQLServers.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzurePostgreSQLServers.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzurePostgreSQLServers.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzurePostgreSQLServers.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzurePostgreSQLServers.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzurePostgreSQLServers.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzurePostgreSQLServers.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzurePostgreSQLServers.new(name: 'some_name') } + assert_raises(ArgumentError) { AzurePostgreSQLServers.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_power_bi_app_dashboard_test.rb b/test/unit/resources/azure_power_bi_app_dashboard_test.rb index 7a6f76dc0..6885884a5 100644 --- a/test/unit/resources/azure_power_bi_app_dashboard_test.rb +++ b/test/unit/resources/azure_power_bi_app_dashboard_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_power_bi_app_dashboard' +require_relative "helper" +require "azure_power_bi_app_dashboard" class AzurePowerBIAppDashboardConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzurePowerBIAppDashboard.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePowerBIAppDashboard.new(resource_provider: "some_type") } end def test_resource_group_name_alone_ok - assert_raises(ArgumentError) { AzurePowerBIAppDashboard.new(name: 'my-name', resource_group: 'test') } + assert_raises(ArgumentError) { AzurePowerBIAppDashboard.new(name: "my-name", resource_group: "test") } end end diff --git a/test/unit/resources/azure_power_bi_app_dashboard_tile_test.rb b/test/unit/resources/azure_power_bi_app_dashboard_tile_test.rb index 085df2b56..0b0d736cc 100644 --- a/test/unit/resources/azure_power_bi_app_dashboard_tile_test.rb +++ b/test/unit/resources/azure_power_bi_app_dashboard_tile_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_power_bi_app_dashboard_tile' +require_relative "helper" +require "azure_power_bi_app_dashboard_tile" class AzurePowerBIAppDashboardTileConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzurePowerBIAppDashboardTile.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePowerBIAppDashboardTile.new(resource_provider: "some_type") } end def test_resource_group_name_alone_ok - assert_raises(ArgumentError) { AzurePowerBIAppDashboardTile.new(name: 'my-name', resource_group: 'test') } + assert_raises(ArgumentError) { AzurePowerBIAppDashboardTile.new(name: "my-name", resource_group: "test") } end end diff --git a/test/unit/resources/azure_power_bi_app_dashboard_tiles_test.rb b/test/unit/resources/azure_power_bi_app_dashboard_tiles_test.rb index 4f51a76e9..b28f8bde2 100644 --- a/test/unit/resources/azure_power_bi_app_dashboard_tiles_test.rb +++ b/test/unit/resources/azure_power_bi_app_dashboard_tiles_test.rb @@ -1,22 +1,22 @@ -require_relative 'helper' -require 'azure_power_bi_app_dashboard_tiles' +require_relative "helper" +require "azure_power_bi_app_dashboard_tiles" class AzurePowerBIAppDashboardTilesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzurePowerBIAppDashboardTiles.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePowerBIAppDashboardTiles.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzurePowerBIAppDashboardTiles.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzurePowerBIAppDashboardTiles.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzurePowerBIAppDashboardTiles.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzurePowerBIAppDashboardTiles.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzurePowerBIAppDashboardTiles.new(name: 'some_name') } + assert_raises(ArgumentError) { AzurePowerBIAppDashboardTiles.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_power_bi_app_dashboards_test.rb b/test/unit/resources/azure_power_bi_app_dashboards_test.rb index a2e2a64a3..0fbeaae90 100644 --- a/test/unit/resources/azure_power_bi_app_dashboards_test.rb +++ b/test/unit/resources/azure_power_bi_app_dashboards_test.rb @@ -1,22 +1,22 @@ -require_relative 'helper' -require 'azure_power_bi_app_dashboards' +require_relative "helper" +require "azure_power_bi_app_dashboards" class AzurePowerBIAppDashboardsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzurePowerBIAppDashboards.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePowerBIAppDashboards.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzurePowerBIAppDashboards.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzurePowerBIAppDashboards.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzurePowerBIAppDashboards.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzurePowerBIAppDashboards.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzurePowerBIAppDashboards.new(name: 'some_name') } + assert_raises(ArgumentError) { AzurePowerBIAppDashboards.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_power_bi_app_report_test.rb b/test/unit/resources/azure_power_bi_app_report_test.rb index 8830ea61a..f23cdc479 100644 --- a/test/unit/resources/azure_power_bi_app_report_test.rb +++ b/test/unit/resources/azure_power_bi_app_report_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_power_bi_app_report' +require_relative "helper" +require "azure_power_bi_app_report" class AzurePowerBIAppReportConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzurePowerBIAppReport.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePowerBIAppReport.new(resource_provider: "some_type") } end def test_resource_group_name_alone_ok - assert_raises(ArgumentError) { AzurePowerBIAppReport.new(name: 'my-name', resource_group: 'test') } + assert_raises(ArgumentError) { AzurePowerBIAppReport.new(name: "my-name", resource_group: "test") } end end diff --git a/test/unit/resources/azure_power_bi_app_reports_test.rb b/test/unit/resources/azure_power_bi_app_reports_test.rb index 2d1d860d4..c8eb407b6 100644 --- a/test/unit/resources/azure_power_bi_app_reports_test.rb +++ b/test/unit/resources/azure_power_bi_app_reports_test.rb @@ -1,22 +1,22 @@ -require_relative 'helper' -require 'azure_power_bi_app_reports' +require_relative "helper" +require "azure_power_bi_app_reports" class AzurePowerBIAppReportsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzurePowerBIAppReports.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePowerBIAppReports.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzurePowerBIAppReports.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzurePowerBIAppReports.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzurePowerBIAppReports.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzurePowerBIAppReports.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzurePowerBIAppReports.new(name: 'some_name') } + assert_raises(ArgumentError) { AzurePowerBIAppReports.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_power_bi_app_test.rb b/test/unit/resources/azure_power_bi_app_test.rb index 22453959a..6edc5efeb 100644 --- a/test/unit/resources/azure_power_bi_app_test.rb +++ b/test/unit/resources/azure_power_bi_app_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_power_bi_app' +require_relative "helper" +require "azure_power_bi_app" class AzurePowerBIAppConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzurePowerBIApp.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePowerBIApp.new(resource_provider: "some_type") } end def test_resource_group_name_alone_ok - assert_raises(ArgumentError) { AzurePowerBIApp.new(name: 'my-name', resource_group: 'test') } + assert_raises(ArgumentError) { AzurePowerBIApp.new(name: "my-name", resource_group: "test") } end end diff --git a/test/unit/resources/azure_power_bi_apps_test.rb b/test/unit/resources/azure_power_bi_apps_test.rb index 963cc55d5..c20facb54 100644 --- a/test/unit/resources/azure_power_bi_apps_test.rb +++ b/test/unit/resources/azure_power_bi_apps_test.rb @@ -1,22 +1,22 @@ -require_relative 'helper' -require 'azure_power_bi_apps' +require_relative "helper" +require "azure_power_bi_apps" class AzurePowerBIAppsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzurePowerBIApps.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePowerBIApps.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzurePowerBIApps.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzurePowerBIApps.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzurePowerBIApps.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzurePowerBIApps.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzurePowerBIApps.new(name: 'some_name') } + assert_raises(ArgumentError) { AzurePowerBIApps.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_power_bi_capacities_test.rb b/test/unit/resources/azure_power_bi_capacities_test.rb index e50d7f680..48e77445e 100644 --- a/test/unit/resources/azure_power_bi_capacities_test.rb +++ b/test/unit/resources/azure_power_bi_capacities_test.rb @@ -1,22 +1,22 @@ -require_relative 'helper' -require 'azure_power_bi_capacities' +require_relative "helper" +require "azure_power_bi_capacities" class AzurePowerBICapacitiesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzurePowerBICapacities.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePowerBICapacities.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzurePowerBICapacities.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzurePowerBICapacities.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzurePowerBICapacities.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzurePowerBICapacities.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzurePowerBICapacities.new(name: 'some_name') } + assert_raises(ArgumentError) { AzurePowerBICapacities.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_power_bi_capacity_refreshable_test.rb b/test/unit/resources/azure_power_bi_capacity_refreshable_test.rb index bd3828203..afdc4420a 100644 --- a/test/unit/resources/azure_power_bi_capacity_refreshable_test.rb +++ b/test/unit/resources/azure_power_bi_capacity_refreshable_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_power_bi_capacity_refreshable' +require_relative "helper" +require "azure_power_bi_capacity_refreshable" class AzurePowerBICapacityRefreshableConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzurePowerBICapacityRefreshable.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePowerBICapacityRefreshable.new(resource_provider: "some_type") } end def test_resource_group_name_alone_ok - assert_raises(ArgumentError) { AzurePowerBICapacityRefreshable.new(name: 'my-name', resource_group: 'test') } + assert_raises(ArgumentError) { AzurePowerBICapacityRefreshable.new(name: "my-name", resource_group: "test") } end end diff --git a/test/unit/resources/azure_power_bi_capacity_refreshables_test.rb b/test/unit/resources/azure_power_bi_capacity_refreshables_test.rb index 49b2f5096..d46daffa5 100644 --- a/test/unit/resources/azure_power_bi_capacity_refreshables_test.rb +++ b/test/unit/resources/azure_power_bi_capacity_refreshables_test.rb @@ -1,22 +1,22 @@ -require_relative 'helper' -require 'azure_power_bi_capacity_refreshables' +require_relative "helper" +require "azure_power_bi_capacity_refreshables" class AzurePowerBICapacityRefreshablesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzurePowerBICapacityRefreshables.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePowerBICapacityRefreshables.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzurePowerBICapacityRefreshables.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzurePowerBICapacityRefreshables.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzurePowerBICapacityRefreshables.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzurePowerBICapacityRefreshables.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzurePowerBICapacityRefreshables.new(name: 'some_name') } + assert_raises(ArgumentError) { AzurePowerBICapacityRefreshables.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_power_bi_capacity_workload_test.rb b/test/unit/resources/azure_power_bi_capacity_workload_test.rb index 9fa4c1e3c..ccde7fa1d 100644 --- a/test/unit/resources/azure_power_bi_capacity_workload_test.rb +++ b/test/unit/resources/azure_power_bi_capacity_workload_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_power_bi_capacity_workload' +require_relative "helper" +require "azure_power_bi_capacity_workload" class AzurePowerBICapacityWorkloadConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzurePowerBICapacityWorkload.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePowerBICapacityWorkload.new(resource_provider: "some_type") } end def test_resource_group_name_alone_ok - assert_raises(ArgumentError) { AzurePowerBICapacityWorkload.new(name: 'my-name', resource_group: 'test') } + assert_raises(ArgumentError) { AzurePowerBICapacityWorkload.new(name: "my-name", resource_group: "test") } end end diff --git a/test/unit/resources/azure_power_bi_capacity_workloads_test.rb b/test/unit/resources/azure_power_bi_capacity_workloads_test.rb index 74ce10cd8..87c43de2b 100644 --- a/test/unit/resources/azure_power_bi_capacity_workloads_test.rb +++ b/test/unit/resources/azure_power_bi_capacity_workloads_test.rb @@ -1,22 +1,22 @@ -require_relative 'helper' -require 'azure_power_bi_capacity_workloads' +require_relative "helper" +require "azure_power_bi_capacity_workloads" class AzurePowerBICapacityWorkloadsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzurePowerBICapacityWorkloads.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePowerBICapacityWorkloads.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzurePowerBICapacityWorkloads.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzurePowerBICapacityWorkloads.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzurePowerBICapacityWorkloads.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzurePowerBICapacityWorkloads.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzurePowerBICapacityWorkloads.new(name: 'some_name') } + assert_raises(ArgumentError) { AzurePowerBICapacityWorkloads.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_power_bi_dashboard_test.rb b/test/unit/resources/azure_power_bi_dashboard_test.rb index 8ef1c282d..baafbdb25 100644 --- a/test/unit/resources/azure_power_bi_dashboard_test.rb +++ b/test/unit/resources/azure_power_bi_dashboard_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_power_bi_dashboard' +require_relative "helper" +require "azure_power_bi_dashboard" class AzurePowerBIDashboardConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzurePowerBIDashboard.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePowerBIDashboard.new(resource_provider: "some_type") } end def test_resource_group_name_alone_ok - assert_raises(ArgumentError) { AzurePowerBIDashboard.new(name: 'my-name', resource_group: 'test') } + assert_raises(ArgumentError) { AzurePowerBIDashboard.new(name: "my-name", resource_group: "test") } end end diff --git a/test/unit/resources/azure_power_bi_dashboard_tile_test.rb b/test/unit/resources/azure_power_bi_dashboard_tile_test.rb index f42240426..5c002416b 100644 --- a/test/unit/resources/azure_power_bi_dashboard_tile_test.rb +++ b/test/unit/resources/azure_power_bi_dashboard_tile_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_power_bi_dashboard_tile' +require_relative "helper" +require "azure_power_bi_dashboard_tile" class AzurePowerBIDashboardTileConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzurePowerBIDashboardTile.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePowerBIDashboardTile.new(resource_provider: "some_type") } end def test_resource_group_name_alone_ok - assert_raises(ArgumentError) { AzurePowerBIDashboardTile.new(name: 'my-name', resource_group: 'test') } + assert_raises(ArgumentError) { AzurePowerBIDashboardTile.new(name: "my-name", resource_group: "test") } end end diff --git a/test/unit/resources/azure_power_bi_dashboard_tiles_test.rb b/test/unit/resources/azure_power_bi_dashboard_tiles_test.rb index d863615b7..d3cc0f07d 100644 --- a/test/unit/resources/azure_power_bi_dashboard_tiles_test.rb +++ b/test/unit/resources/azure_power_bi_dashboard_tiles_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_power_bi_dashboard_tiles' +require_relative "helper" +require "azure_power_bi_dashboard_tiles" class AzurePowerBIDashboardTilesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzurePowerBIDashboardTiles.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePowerBIDashboardTiles.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzurePowerBIDashboardTiles.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzurePowerBIDashboardTiles.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzurePowerBIDashboardTiles.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzurePowerBIDashboardTiles.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzurePowerBIDashboardTiles.new(name: 'some_name') } + assert_raises(ArgumentError) { AzurePowerBIDashboardTiles.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_power_bi_dashboards_test.rb b/test/unit/resources/azure_power_bi_dashboards_test.rb index 95fa96ff2..81230cc21 100644 --- a/test/unit/resources/azure_power_bi_dashboards_test.rb +++ b/test/unit/resources/azure_power_bi_dashboards_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_power_bi_dashboards' +require_relative "helper" +require "azure_power_bi_dashboards" class AzurePowerBIDashboardsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzurePowerBIDashboards.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePowerBIDashboards.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzurePowerBIDashboards.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzurePowerBIDashboards.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzurePowerBIDashboards.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzurePowerBIDashboards.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzurePowerBIDashboards.new(name: 'some_name') } + assert_raises(ArgumentError) { AzurePowerBIDashboards.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_power_bi_dataflow_storage_accounts_test.rb b/test/unit/resources/azure_power_bi_dataflow_storage_accounts_test.rb index ba0c4ab4f..20168f644 100644 --- a/test/unit/resources/azure_power_bi_dataflow_storage_accounts_test.rb +++ b/test/unit/resources/azure_power_bi_dataflow_storage_accounts_test.rb @@ -1,22 +1,22 @@ -require_relative 'helper' -require 'azure_power_bi_dataflow_storage_accounts' +require_relative "helper" +require "azure_power_bi_dataflow_storage_accounts" class AzurePowerBIDataflowStorageAccountsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzurePowerBIDataflowStorageAccounts.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePowerBIDataflowStorageAccounts.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzurePowerBIDataflowStorageAccounts.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzurePowerBIDataflowStorageAccounts.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzurePowerBIDataflowStorageAccounts.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzurePowerBIDataflowStorageAccounts.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzurePowerBIDataflowStorageAccounts.new(name: 'some_name') } + assert_raises(ArgumentError) { AzurePowerBIDataflowStorageAccounts.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_power_bi_dataflow_test.rb b/test/unit/resources/azure_power_bi_dataflow_test.rb index 29b71a067..b8b63602a 100644 --- a/test/unit/resources/azure_power_bi_dataflow_test.rb +++ b/test/unit/resources/azure_power_bi_dataflow_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_power_bi_dataflow' +require_relative "helper" +require "azure_power_bi_dataflow" class AzurePowerBIDataflowConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzurePowerBIDataflow.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePowerBIDataflow.new(resource_provider: "some_type") } end def test_resource_group_name_alone_ok - assert_raises(ArgumentError) { AzurePowerBIDataflow.new(name: 'my-name', resource_group: 'test') } + assert_raises(ArgumentError) { AzurePowerBIDataflow.new(name: "my-name", resource_group: "test") } end end diff --git a/test/unit/resources/azure_power_bi_dataflows_test.rb b/test/unit/resources/azure_power_bi_dataflows_test.rb index f7bcdcf33..782190782 100644 --- a/test/unit/resources/azure_power_bi_dataflows_test.rb +++ b/test/unit/resources/azure_power_bi_dataflows_test.rb @@ -1,22 +1,22 @@ -require_relative 'helper' -require 'azure_power_bi_dataflows' +require_relative "helper" +require "azure_power_bi_dataflows" class AzurePowerBIDataflowsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzurePowerBIDataflows.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePowerBIDataflows.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzurePowerBIDataflows.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzurePowerBIDataflows.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzurePowerBIDataflows.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzurePowerBIDataflows.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzurePowerBIDataflows.new(name: 'some_name') } + assert_raises(ArgumentError) { AzurePowerBIDataflows.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_power_bi_dataset_datasources_test.rb b/test/unit/resources/azure_power_bi_dataset_datasources_test.rb index 626c4ec32..a18612b41 100644 --- a/test/unit/resources/azure_power_bi_dataset_datasources_test.rb +++ b/test/unit/resources/azure_power_bi_dataset_datasources_test.rb @@ -1,22 +1,22 @@ -require_relative 'helper' -require 'azure_power_bi_dataset_datasources' +require_relative "helper" +require "azure_power_bi_dataset_datasources" class AzurePowerBIDatasetDatasourcesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzurePowerBIDatasetDatasources.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePowerBIDatasetDatasources.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzurePowerBIDatasetDatasources.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzurePowerBIDatasetDatasources.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzurePowerBIDatasetDatasources.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzurePowerBIDatasetDatasources.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzurePowerBIDatasetDatasources.new(name: 'some_name') } + assert_raises(ArgumentError) { AzurePowerBIDatasetDatasources.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_power_bi_dataset_test.rb b/test/unit/resources/azure_power_bi_dataset_test.rb index df2bbe356..6173a2f9d 100644 --- a/test/unit/resources/azure_power_bi_dataset_test.rb +++ b/test/unit/resources/azure_power_bi_dataset_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_power_bi_dataset' +require_relative "helper" +require "azure_power_bi_dataset" class AzurePowerBIDatasetConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzurePowerBIDataset.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePowerBIDataset.new(resource_provider: "some_type") } end def test_resource_group_name_alone_ok - assert_raises(ArgumentError) { AzurePowerBIDataset.new(name: 'my-name', resource_group: 'test') } + assert_raises(ArgumentError) { AzurePowerBIDataset.new(name: "my-name", resource_group: "test") } end end diff --git a/test/unit/resources/azure_power_bi_datasets_test.rb b/test/unit/resources/azure_power_bi_datasets_test.rb index c05b3b8a0..c96a57c5b 100644 --- a/test/unit/resources/azure_power_bi_datasets_test.rb +++ b/test/unit/resources/azure_power_bi_datasets_test.rb @@ -1,22 +1,22 @@ -require_relative 'helper' -require 'azure_power_bi_datasets' +require_relative "helper" +require "azure_power_bi_datasets" class AzurePowerBIDatasetsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzurePowerBIDatasets.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePowerBIDatasets.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzurePowerBIDatasets.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzurePowerBIDatasets.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzurePowerBIDatasets.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzurePowerBIDatasets.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzurePowerBIDatasets.new(name: 'some_name') } + assert_raises(ArgumentError) { AzurePowerBIDatasets.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_power_bi_embedded_capacities_test.rb b/test/unit/resources/azure_power_bi_embedded_capacities_test.rb index 43fcd9fc7..377e394b1 100644 --- a/test/unit/resources/azure_power_bi_embedded_capacities_test.rb +++ b/test/unit/resources/azure_power_bi_embedded_capacities_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_power_bi_embedded_capacities' +require_relative "helper" +require "azure_power_bi_embedded_capacities" class AzurePowerBiEmbeddedCapacitiesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzurePowerBiEmbeddedCapacities.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePowerBiEmbeddedCapacities.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzurePowerBiEmbeddedCapacities.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzurePowerBiEmbeddedCapacities.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzurePowerBiEmbeddedCapacities.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzurePowerBiEmbeddedCapacities.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzurePowerBiEmbeddedCapacities.new(name: 'some_name') } + assert_raises(ArgumentError) { AzurePowerBiEmbeddedCapacities.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_power_bi_embedded_capacity_test.rb b/test/unit/resources/azure_power_bi_embedded_capacity_test.rb index 06741a16f..02890f831 100644 --- a/test/unit/resources/azure_power_bi_embedded_capacity_test.rb +++ b/test/unit/resources/azure_power_bi_embedded_capacity_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_power_bi_embedded_capacity' +require_relative "helper" +require "azure_power_bi_embedded_capacity" class AzurePowerBiEmbeddedCapacityConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzurePowerBiEmbeddedCapacity.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePowerBiEmbeddedCapacity.new(resource_provider: "some_type") } end def test_resource_group_name_alone_ok - assert_raises(ArgumentError) { AzurePowerBiEmbeddedCapacity.new(resource_group: 'test') } + assert_raises(ArgumentError) { AzurePowerBiEmbeddedCapacity.new(resource_group: "test") } end end diff --git a/test/unit/resources/azure_power_bi_gateway_test.rb b/test/unit/resources/azure_power_bi_gateway_test.rb index 43c30cdf7..89660c390 100644 --- a/test/unit/resources/azure_power_bi_gateway_test.rb +++ b/test/unit/resources/azure_power_bi_gateway_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_power_bi_gateway' +require_relative "helper" +require "azure_power_bi_gateway" class AzurePowerBIGatewayConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzurePowerBIGateway.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePowerBIGateway.new(resource_provider: "some_type") } end def test_resource_group_name_alone_ok - assert_raises(ArgumentError) { AzurePowerBIGateway.new(name: 'my-name', resource_group: 'test') } + assert_raises(ArgumentError) { AzurePowerBIGateway.new(name: "my-name", resource_group: "test") } end end diff --git a/test/unit/resources/azure_power_bi_gateways_test.rb b/test/unit/resources/azure_power_bi_gateways_test.rb index ce911f31e..371b7bff6 100644 --- a/test/unit/resources/azure_power_bi_gateways_test.rb +++ b/test/unit/resources/azure_power_bi_gateways_test.rb @@ -1,23 +1,23 @@ -require_relative 'helper' +require_relative "helper" -require 'azure_power_bi_gateways' +require "azure_power_bi_gateways" class AzurePowerBIGatewaysConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzurePowerBIGateways.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePowerBIGateways.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzurePowerBIGateways.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzurePowerBIGateways.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzurePowerBIGateways.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzurePowerBIGateways.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzurePowerBIGateways.new(name: 'some_name') } + assert_raises(ArgumentError) { AzurePowerBIGateways.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_public_ip_test.rb b/test/unit/resources/azure_public_ip_test.rb index c3d45e775..29a491ac0 100644 --- a/test/unit/resources/azure_public_ip_test.rb +++ b/test/unit/resources/azure_public_ip_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_public_ip' +require_relative "helper" +require "azure_public_ip" class AzurePublicIpConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzurePublicIp.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzurePublicIp.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzurePublicIp.new(name: 'my-name') } + assert_raises(ArgumentError) { AzurePublicIp.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_redis_cache_test.rb b/test/unit/resources/azure_redis_cache_test.rb index 0c27b942f..d81609763 100644 --- a/test/unit/resources/azure_redis_cache_test.rb +++ b/test/unit/resources/azure_redis_cache_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_redis_cache' +require_relative "helper" +require "azure_redis_cache" class AzureRedisCacheConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -7,6 +7,6 @@ def test_empty_param_not_ok end def test_resource_provider_alone_not_ok - assert_raises(ArgumentError) { AzureRedisCache.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureRedisCache.new(resource_provider: "some_type") } end end diff --git a/test/unit/resources/azure_redis_caches_test.rb b/test/unit/resources/azure_redis_caches_test.rb index cf6ff1733..b9c78545b 100644 --- a/test/unit/resources/azure_redis_caches_test.rb +++ b/test/unit/resources/azure_redis_caches_test.rb @@ -1,12 +1,12 @@ -require_relative 'helper' -require 'azure_redis_caches' +require_relative "helper" +require "azure_redis_caches" class AzureRedisCachesConstructorTest < Minitest::Test def tag_value_not_ok - assert_raises(ArgumentError) { AzureRedisCaches.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureRedisCaches.new(tag_value: "some_tag_value") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureRedisCaches.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureRedisCaches.new(resource_id: "some_id") } end end diff --git a/test/unit/resources/azure_resource_group_test.rb b/test/unit/resources/azure_resource_group_test.rb index 8f06c2871..df195c57e 100644 --- a/test/unit/resources/azure_resource_group_test.rb +++ b/test/unit/resources/azure_resource_group_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_resource_group' +require_relative "helper" +require "azure_resource_group" class AzureResourceGroupConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,6 +8,6 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureResourceGroup.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureResourceGroup.new(resource_provider: "some_type") } end end diff --git a/test/unit/resources/azure_resource_groups_test.rb b/test/unit/resources/azure_resource_groups_test.rb index e711b8997..976911a30 100644 --- a/test/unit/resources/azure_resource_groups_test.rb +++ b/test/unit/resources/azure_resource_groups_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_resource_groups' +require_relative "helper" +require "azure_resource_groups" class AzureResourceGroupsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureResourceGroups.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureResourceGroups.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureResourceGroups.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureResourceGroups.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureResourceGroups.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureResourceGroups.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureResourceGroups.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureResourceGroups.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureResourceGroups.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureResourceGroups.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_resource_health_availability_status_test.rb b/test/unit/resources/azure_resource_health_availability_status_test.rb index b59b26f1c..24d0a3914 100644 --- a/test/unit/resources/azure_resource_health_availability_status_test.rb +++ b/test/unit/resources/azure_resource_health_availability_status_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_resource_health_availability_status' +require_relative "helper" +require "azure_resource_health_availability_status" class AzureResourceHealthAvailabilityStatusConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -7,6 +7,6 @@ def test_empty_param_not_ok end def test_resource_group_alone_not_ok - assert_raises(ArgumentError) { AzureResourceHealthAvailabilityStatus.new(resource_group: 'large_vms') } + assert_raises(ArgumentError) { AzureResourceHealthAvailabilityStatus.new(resource_group: "large_vms") } end end diff --git a/test/unit/resources/azure_resource_health_availability_statuses_test.rb b/test/unit/resources/azure_resource_health_availability_statuses_test.rb index bcce54130..13b943aa3 100644 --- a/test/unit/resources/azure_resource_health_availability_statuses_test.rb +++ b/test/unit/resources/azure_resource_health_availability_statuses_test.rb @@ -1,12 +1,12 @@ -require_relative 'helper' -require 'azure_resource_health_availability_statuses' +require_relative "helper" +require "azure_resource_health_availability_statuses" class AzureResourceHealthAvailabilityStatusesConstructorTest < Minitest::Test def tag_value_not_ok - assert_raises(ArgumentError) { AzureResourceHealthAvailabilityStatuses.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureResourceHealthAvailabilityStatuses.new(tag_value: "some_tag_value") } end def test_resource_id_alone_not_ok - assert_raises(ArgumentError) { AzureResourceHealthAvailabilityStatuses.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureResourceHealthAvailabilityStatuses.new(resource_id: "some_id") } end end diff --git a/test/unit/resources/azure_resource_health_emerging_issue_test.rb b/test/unit/resources/azure_resource_health_emerging_issue_test.rb index 08a4f2496..74b10910e 100644 --- a/test/unit/resources/azure_resource_health_emerging_issue_test.rb +++ b/test/unit/resources/azure_resource_health_emerging_issue_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_resource_health_emerging_issue' +require_relative "helper" +require "azure_resource_health_emerging_issue" class AzureResourceHealthEmergingIssueConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -7,6 +7,6 @@ def test_empty_param_not_ok end def test_resource_group_alone_not_ok - assert_raises(ArgumentError) { AzureResourceHealthEmergingIssue.new(resource_group: 'some_type') } + assert_raises(ArgumentError) { AzureResourceHealthEmergingIssue.new(resource_group: "some_type") } end end diff --git a/test/unit/resources/azure_resource_health_emerging_issues_test.rb b/test/unit/resources/azure_resource_health_emerging_issues_test.rb index 00f8c135c..fff9cb524 100644 --- a/test/unit/resources/azure_resource_health_emerging_issues_test.rb +++ b/test/unit/resources/azure_resource_health_emerging_issues_test.rb @@ -1,20 +1,20 @@ -require_relative 'helper' -require 'azure_resource_health_emerging_issues' +require_relative "helper" +require "azure_resource_health_emerging_issues" class AzureResourceHealthEmergingIssuesConstructorTest < Minitest::Test def test_resource_type_alone_not_ok - assert_raises(ArgumentError) { AzureResourceHealthEmergingIssues.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureResourceHealthEmergingIssues.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureResourceHealthEmergingIssues.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureResourceHealthEmergingIssues.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureResourceHealthEmergingIssues.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureResourceHealthEmergingIssues.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureResourceHealthEmergingIssues.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureResourceHealthEmergingIssues.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_resource_health_events_test.rb b/test/unit/resources/azure_resource_health_events_test.rb index 556b73826..41c8254db 100644 --- a/test/unit/resources/azure_resource_health_events_test.rb +++ b/test/unit/resources/azure_resource_health_events_test.rb @@ -1,20 +1,20 @@ -require_relative 'helper' -require 'azure_resource_health_events' +require_relative "helper" +require "azure_resource_health_events" class AzureResourceHealthEventsConstructorTest < Minitest::Test def test_resource_type_alone_not_ok - assert_raises(ArgumentError) { AzureResourceHealthEvents.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureResourceHealthEvents.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureResourceHealthEvents.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureResourceHealthEvents.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureResourceHealthEvents.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureResourceHealthEvents.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureResourceHealthEvents.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureResourceHealthEvents.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_role_definition_test.rb b/test/unit/resources/azure_role_definition_test.rb index 6d2a9ceef..ab473d0e6 100644 --- a/test/unit/resources/azure_role_definition_test.rb +++ b/test/unit/resources/azure_role_definition_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_role_definition' +require_relative "helper" +require "azure_role_definition" class AzureRoleDefinitionConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,11 +8,11 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureRoleDefinition.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureRoleDefinition.new(resource_provider: "some_type") } end # resource_group should not be allowed. def test_resource_group_not_ok - assert_raises(ArgumentError) { AzureRoleDefinition.new(resource_group: 'some_group') } + assert_raises(ArgumentError) { AzureRoleDefinition.new(resource_group: "some_group") } end end diff --git a/test/unit/resources/azure_role_definitions_test.rb b/test/unit/resources/azure_role_definitions_test.rb index a09183af3..70bd832e0 100644 --- a/test/unit/resources/azure_role_definitions_test.rb +++ b/test/unit/resources/azure_role_definitions_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_role_definitions' +require_relative "helper" +require "azure_role_definitions" class AzureRoleDefinitionsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureRoleDefinitions.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureRoleDefinitions.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureRoleDefinitions.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureRoleDefinitions.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureRoleDefinitions.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureRoleDefinitions.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureRoleDefinitions.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureRoleDefinitions.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureRoleDefinitions.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureRoleDefinitions.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_security_center_policies_test.rb b/test/unit/resources/azure_security_center_policies_test.rb index 861a44a7f..db0832a00 100644 --- a/test/unit/resources/azure_security_center_policies_test.rb +++ b/test/unit/resources/azure_security_center_policies_test.rb @@ -1,9 +1,9 @@ -require_relative 'helper' -require 'azure_security_center_policies' +require_relative "helper" +require "azure_security_center_policies" class AzureSecurityCenterPoliciesConstructorTest < Minitest::Test # Parameter not allowed. def test_parameter_not_ok - assert_raises(ArgumentError) { AzureSecurityCenterPolicies.new(any: 'some_value') } + assert_raises(ArgumentError) { AzureSecurityCenterPolicies.new(any: "some_value") } end end diff --git a/test/unit/resources/azure_security_center_policy_test.rb b/test/unit/resources/azure_security_center_policy_test.rb index 58e3e6ce9..af15bedf8 100644 --- a/test/unit/resources/azure_security_center_policy_test.rb +++ b/test/unit/resources/azure_security_center_policy_test.rb @@ -1,13 +1,13 @@ -require_relative 'helper' -require 'azure_security_center_policy' +require_relative "helper" +require "azure_security_center_policy" class AzureSecurityCenterPolicyConstructorTest < Minitest::Test # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureSecurityCenterPolicy.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureSecurityCenterPolicy.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureSecurityCenterPolicy.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureSecurityCenterPolicy.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_sentinel_alert_rule_template_test.rb b/test/unit/resources/azure_sentinel_alert_rule_template_test.rb index 020a49cd7..75382a6f2 100644 --- a/test/unit/resources/azure_sentinel_alert_rule_template_test.rb +++ b/test/unit/resources/azure_sentinel_alert_rule_template_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_sentinel_alert_rule_template' +require_relative "helper" +require "azure_sentinel_alert_rule_template" class AzureAlertRuleTemplateConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureSentinelAlertRuleTemplate.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureSentinelAlertRuleTemplate.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureSentinelAlertRuleTemplate.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureSentinelAlertRuleTemplate.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_sentinel_alert_rule_templates_test.rb b/test/unit/resources/azure_sentinel_alert_rule_templates_test.rb index d1b766791..9f73a8798 100644 --- a/test/unit/resources/azure_sentinel_alert_rule_templates_test.rb +++ b/test/unit/resources/azure_sentinel_alert_rule_templates_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_sentinel_alert_rule_templates' +require_relative "helper" +require "azure_sentinel_alert_rule_templates" class AzureAlertRuleTemplatesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureSentinelAlertRuleTemplate.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureSentinelAlertRuleTemplate.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureSentinelAlertRuleTemplate.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureSentinelAlertRuleTemplate.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureSentinelAlertRuleTemplate.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureSentinelAlertRuleTemplate.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureSentinelAlertRuleTemplate.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureSentinelAlertRuleTemplate.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureSentinelAlertRuleTemplate.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureSentinelAlertRuleTemplate.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_sentinel_alert_rule_test.rb b/test/unit/resources/azure_sentinel_alert_rule_test.rb index d2d318d77..5898ee010 100644 --- a/test/unit/resources/azure_sentinel_alert_rule_test.rb +++ b/test/unit/resources/azure_sentinel_alert_rule_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_sentinel_alert_rule' +require_relative "helper" +require "azure_sentinel_alert_rule" class AzureAlertRuleConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureSentinelAlertRule.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureSentinelAlertRule.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureSentinelAlertRule.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureSentinelAlertRule.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_sentinel_alert_rules_test.rb b/test/unit/resources/azure_sentinel_alert_rules_test.rb index 0afc4cbad..0f6f3c521 100644 --- a/test/unit/resources/azure_sentinel_alert_rules_test.rb +++ b/test/unit/resources/azure_sentinel_alert_rules_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_sentinel_alert_rules' +require_relative "helper" +require "azure_sentinel_alert_rules" class AzureAlertRulesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureSentinelAlertRules.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureSentinelAlertRules.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureSentinelAlertRules.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureSentinelAlertRules.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureSentinelAlertRules.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureSentinelAlertRules.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureSentinelAlertRules.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureSentinelAlertRules.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureSentinelAlertRules.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureSentinelAlertRules.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_sentinel_incidents_resource_test.rb b/test/unit/resources/azure_sentinel_incidents_resource_test.rb index eff95dc76..25f475851 100644 --- a/test/unit/resources/azure_sentinel_incidents_resource_test.rb +++ b/test/unit/resources/azure_sentinel_incidents_resource_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_sentinel_incidents_resource' +require_relative "helper" +require "azure_sentinel_incidents_resource" class AzureSentinelIncidentsResourceTestConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureSentinelIncidentsResource.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureSentinelIncidentsResource.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureSentinelIncidentsResource.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureSentinelIncidentsResource.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_sentinel_incidents_resources_test.rb b/test/unit/resources/azure_sentinel_incidents_resources_test.rb index 0f1e577e4..c89e3ad25 100644 --- a/test/unit/resources/azure_sentinel_incidents_resources_test.rb +++ b/test/unit/resources/azure_sentinel_incidents_resources_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_sentinel_incidents_resources' +require_relative "helper" +require "azure_sentinel_incidents_resources" class AzureSentinelIncidentsResourcesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureSentinelIncidentsResources.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureSentinelIncidentsResources.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureSentinelIncidentsResources.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureSentinelIncidentsResources.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureSentinelIncidentsResources.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureSentinelIncidentsResources.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureSentinelIncidentsResources.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureSentinelIncidentsResources.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureSentinelIncidentsResources.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureSentinelIncidentsResources.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_service_bus_namespace_test.rb b/test/unit/resources/azure_service_bus_namespace_test.rb index 81dd8fc29..5f29d659b 100644 --- a/test/unit/resources/azure_service_bus_namespace_test.rb +++ b/test/unit/resources/azure_service_bus_namespace_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_service_bus_namespace' +require_relative "helper" +require "azure_service_bus_namespace" class AzureServiceBusNamespaceConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureServiceBusNamespace.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureServiceBusNamespace.new(resource_provider: "some_type") } end def test_resource_group_name_alone_not_ok - assert_raises(ArgumentError) { AzureServiceBusNamespace.new(resource_group: 'test') } + assert_raises(ArgumentError) { AzureServiceBusNamespace.new(resource_group: "test") } end end diff --git a/test/unit/resources/azure_service_bus_namespaces_test.rb b/test/unit/resources/azure_service_bus_namespaces_test.rb index 4a50fd7a0..e1640ea89 100644 --- a/test/unit/resources/azure_service_bus_namespaces_test.rb +++ b/test/unit/resources/azure_service_bus_namespaces_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_service_bus_namespaces' +require_relative "helper" +require "azure_service_bus_namespaces" class AzureServiceBusNamespacesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureServiceBusNamespaces.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureServiceBusNamespaces.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureServiceBusNamespaces.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureServiceBusNamespaces.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureServiceBusNamespaces.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureServiceBusNamespaces.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureServiceBusNamespaces.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureServiceBusNamespaces.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_service_bus_regions_test.rb b/test/unit/resources/azure_service_bus_regions_test.rb index 4282f9bb5..8f89180d6 100644 --- a/test/unit/resources/azure_service_bus_regions_test.rb +++ b/test/unit/resources/azure_service_bus_regions_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_service_bus_regions' +require_relative "helper" +require "azure_service_bus_regions" class AzureServiceBusRegionsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureServiceBusRegions.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureServiceBusRegions.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureServiceBusRegions.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureServiceBusRegions.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureServiceBusRegions.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureServiceBusRegions.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureServiceBusRegions.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureServiceBusRegions.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_service_bus_subscription_rule_test.rb b/test/unit/resources/azure_service_bus_subscription_rule_test.rb index 38bae2f45..8954d6b77 100644 --- a/test/unit/resources/azure_service_bus_subscription_rule_test.rb +++ b/test/unit/resources/azure_service_bus_subscription_rule_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_service_bus_subscription_rule' +require_relative "helper" +require "azure_service_bus_subscription_rule" class AzureServiceBusSubscriptionRuleConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureServiceBusSubscriptionRule.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureServiceBusSubscriptionRule.new(resource_provider: "some_type") } end def test_resource_group_name_alone_not_ok - assert_raises(ArgumentError) { AzureServiceBusSubscriptionRule.new(resource_group: 'test') } + assert_raises(ArgumentError) { AzureServiceBusSubscriptionRule.new(resource_group: "test") } end end diff --git a/test/unit/resources/azure_service_bus_subscription_rules_test.rb b/test/unit/resources/azure_service_bus_subscription_rules_test.rb index a0267309a..6ed80804b 100644 --- a/test/unit/resources/azure_service_bus_subscription_rules_test.rb +++ b/test/unit/resources/azure_service_bus_subscription_rules_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_service_bus_subscription_rules' +require_relative "helper" +require "azure_service_bus_subscription_rules" class AzureServiceBusSubscriptionRulesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureServiceBusSubscriptionRules.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureServiceBusSubscriptionRules.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureServiceBusSubscriptionRules.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureServiceBusSubscriptionRules.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureServiceBusSubscriptionRules.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureServiceBusSubscriptionRules.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureServiceBusSubscriptionRules.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureServiceBusSubscriptionRules.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_service_bus_subscription_test.rb b/test/unit/resources/azure_service_bus_subscription_test.rb index ed03d8793..2429d2a94 100644 --- a/test/unit/resources/azure_service_bus_subscription_test.rb +++ b/test/unit/resources/azure_service_bus_subscription_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_service_bus_subscription' +require_relative "helper" +require "azure_service_bus_subscription" class AzureServiceBusSubscriptionConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureServiceBusSubscription.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureServiceBusSubscription.new(resource_provider: "some_type") } end def test_resource_group_name_alone_not_ok - assert_raises(ArgumentError) { AzureServiceBusSubscription.new(resource_group: 'test') } + assert_raises(ArgumentError) { AzureServiceBusSubscription.new(resource_group: "test") } end end diff --git a/test/unit/resources/azure_service_bus_subscriptions_test.rb b/test/unit/resources/azure_service_bus_subscriptions_test.rb index b5264eb14..c1125a64c 100644 --- a/test/unit/resources/azure_service_bus_subscriptions_test.rb +++ b/test/unit/resources/azure_service_bus_subscriptions_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_service_bus_subscriptions' +require_relative "helper" +require "azure_service_bus_subscriptions" class AzureServiceBusSubscriptionsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureServiceBusSubscriptions.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureServiceBusSubscriptions.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureServiceBusSubscriptions.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureServiceBusSubscriptions.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureServiceBusSubscriptions.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureServiceBusSubscriptions.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureServiceBusSubscriptions.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureServiceBusSubscriptions.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_service_bus_topic_test.rb b/test/unit/resources/azure_service_bus_topic_test.rb index ec363e3dc..6a0d833e2 100644 --- a/test/unit/resources/azure_service_bus_topic_test.rb +++ b/test/unit/resources/azure_service_bus_topic_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_service_bus_topic' +require_relative "helper" +require "azure_service_bus_topic" class AzureServiceBusTopicConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureServiceBusTopic.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureServiceBusTopic.new(resource_provider: "some_type") } end def test_resource_group_name_alone_not_ok - assert_raises(ArgumentError) { AzureServiceBusTopic.new(resource_group: 'test') } + assert_raises(ArgumentError) { AzureServiceBusTopic.new(resource_group: "test") } end end diff --git a/test/unit/resources/azure_service_bus_topics_test.rb b/test/unit/resources/azure_service_bus_topics_test.rb index 16ca7ff8c..27059f88d 100644 --- a/test/unit/resources/azure_service_bus_topics_test.rb +++ b/test/unit/resources/azure_service_bus_topics_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_service_bus_topics' +require_relative "helper" +require "azure_service_bus_topics" class AzureServiceBusTopicsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureServiceBusTopics.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureServiceBusTopics.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureServiceBusTopics.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureServiceBusTopics.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureServiceBusTopics.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureServiceBusTopics.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureServiceBusTopics.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureServiceBusTopics.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_service_fabric_mesh_application_test.rb b/test/unit/resources/azure_service_fabric_mesh_application_test.rb index f99024b8b..b2a6ba4ea 100644 --- a/test/unit/resources/azure_service_fabric_mesh_application_test.rb +++ b/test/unit/resources/azure_service_fabric_mesh_application_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_service_fabric_mesh_application' +require_relative "helper" +require "azure_service_fabric_mesh_application" class AzureServiceFabricMeshApplicationConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshApplication.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureServiceFabricMeshApplication.new(resource_provider: "some_type") } end def test_resource_group_name_alone_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshApplication.new(resource_group: 'test') } + assert_raises(ArgumentError) { AzureServiceFabricMeshApplication.new(resource_group: "test") } end end diff --git a/test/unit/resources/azure_service_fabric_mesh_applications_test.rb b/test/unit/resources/azure_service_fabric_mesh_applications_test.rb index b899094c8..0e30ec180 100644 --- a/test/unit/resources/azure_service_fabric_mesh_applications_test.rb +++ b/test/unit/resources/azure_service_fabric_mesh_applications_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_service_fabric_mesh_applications' +require_relative "helper" +require "azure_service_fabric_mesh_applications" class AzureServiceFabricMeshApplicationsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshApplications.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureServiceFabricMeshApplications.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshApplications.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureServiceFabricMeshApplications.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshApplications.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureServiceFabricMeshApplications.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshApplications.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureServiceFabricMeshApplications.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_service_fabric_mesh_network_test.rb b/test/unit/resources/azure_service_fabric_mesh_network_test.rb index 7b0e39bc6..254a02a8f 100644 --- a/test/unit/resources/azure_service_fabric_mesh_network_test.rb +++ b/test/unit/resources/azure_service_fabric_mesh_network_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_service_fabric_mesh_network' +require_relative "helper" +require "azure_service_fabric_mesh_network" class AzureServiceFabricMeshNetworkConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshNetwork.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureServiceFabricMeshNetwork.new(resource_provider: "some_type") } end def test_resource_group_name_alone_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshNetwork.new(resource_group: 'test') } + assert_raises(ArgumentError) { AzureServiceFabricMeshNetwork.new(resource_group: "test") } end end diff --git a/test/unit/resources/azure_service_fabric_mesh_networks_test.rb b/test/unit/resources/azure_service_fabric_mesh_networks_test.rb index 863b7166b..e19e02ee1 100644 --- a/test/unit/resources/azure_service_fabric_mesh_networks_test.rb +++ b/test/unit/resources/azure_service_fabric_mesh_networks_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_service_fabric_mesh_networks' +require_relative "helper" +require "azure_service_fabric_mesh_networks" class AzureServiceFabricMeshNetworksConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshNetworks.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureServiceFabricMeshNetworks.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshNetworks.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureServiceFabricMeshNetworks.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshNetworks.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureServiceFabricMeshNetworks.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshNetworks.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureServiceFabricMeshNetworks.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_service_fabric_mesh_replica_test.rb b/test/unit/resources/azure_service_fabric_mesh_replica_test.rb index 15ebcc2b7..ac782f755 100644 --- a/test/unit/resources/azure_service_fabric_mesh_replica_test.rb +++ b/test/unit/resources/azure_service_fabric_mesh_replica_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_service_fabric_mesh_replica' +require_relative "helper" +require "azure_service_fabric_mesh_replica" class AzureServiceFabricMeshReplicaConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshReplica.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureServiceFabricMeshReplica.new(resource_provider: "some_type") } end def test_resource_group_name_alone_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshReplica.new(resource_group: 'test') } + assert_raises(ArgumentError) { AzureServiceFabricMeshReplica.new(resource_group: "test") } end end diff --git a/test/unit/resources/azure_service_fabric_mesh_replicas_test.rb b/test/unit/resources/azure_service_fabric_mesh_replicas_test.rb index b8f83c506..d6d556664 100644 --- a/test/unit/resources/azure_service_fabric_mesh_replicas_test.rb +++ b/test/unit/resources/azure_service_fabric_mesh_replicas_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_service_fabric_mesh_replicas' +require_relative "helper" +require "azure_service_fabric_mesh_replicas" class AzureServiceFabricMeshReplicasConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshReplicas.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureServiceFabricMeshReplicas.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshReplicas.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureServiceFabricMeshReplicas.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshReplicas.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureServiceFabricMeshReplicas.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshReplicas.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureServiceFabricMeshReplicas.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_service_fabric_mesh_service_test.rb b/test/unit/resources/azure_service_fabric_mesh_service_test.rb index cd1a20b73..4379c03f4 100644 --- a/test/unit/resources/azure_service_fabric_mesh_service_test.rb +++ b/test/unit/resources/azure_service_fabric_mesh_service_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_service_fabric_mesh_service' +require_relative "helper" +require "azure_service_fabric_mesh_service" class AzureServiceFabricMeshServiceConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshService.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureServiceFabricMeshService.new(resource_provider: "some_type") } end def test_resource_group_name_alone_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshService.new(resource_group: 'test') } + assert_raises(ArgumentError) { AzureServiceFabricMeshService.new(resource_group: "test") } end end diff --git a/test/unit/resources/azure_service_fabric_mesh_services_test.rb b/test/unit/resources/azure_service_fabric_mesh_services_test.rb index 27918aa9a..a1634f674 100644 --- a/test/unit/resources/azure_service_fabric_mesh_services_test.rb +++ b/test/unit/resources/azure_service_fabric_mesh_services_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_service_fabric_mesh_services' +require_relative "helper" +require "azure_service_fabric_mesh_services" class AzureServiceFabricMeshServicesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshServices.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureServiceFabricMeshServices.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshServices.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureServiceFabricMeshServices.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshServices.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureServiceFabricMeshServices.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshServices.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureServiceFabricMeshServices.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_service_fabric_mesh_volume_test.rb b/test/unit/resources/azure_service_fabric_mesh_volume_test.rb index a9dee2c28..a90827a69 100644 --- a/test/unit/resources/azure_service_fabric_mesh_volume_test.rb +++ b/test/unit/resources/azure_service_fabric_mesh_volume_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_service_fabric_mesh_volume' +require_relative "helper" +require "azure_service_fabric_mesh_volume" class AzureServiceFabricMeshVolumeConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshVolume.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureServiceFabricMeshVolume.new(resource_provider: "some_type") } end def test_resource_group_name_alone_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshVolume.new(resource_group: 'test') } + assert_raises(ArgumentError) { AzureServiceFabricMeshVolume.new(resource_group: "test") } end end diff --git a/test/unit/resources/azure_service_fabric_mesh_volumes_test.rb b/test/unit/resources/azure_service_fabric_mesh_volumes_test.rb index f885571e8..2b483f577 100644 --- a/test/unit/resources/azure_service_fabric_mesh_volumes_test.rb +++ b/test/unit/resources/azure_service_fabric_mesh_volumes_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_service_fabric_mesh_volumes' +require_relative "helper" +require "azure_service_fabric_mesh_volumes" class AzureServiceFabricMeshVolumesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshVolumes.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureServiceFabricMeshVolumes.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshVolumes.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureServiceFabricMeshVolumes.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshVolumes.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureServiceFabricMeshVolumes.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureServiceFabricMeshVolumes.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureServiceFabricMeshVolumes.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_snapshot_test.rb b/test/unit/resources/azure_snapshot_test.rb index 9d327aa37..ee781fc3e 100644 --- a/test/unit/resources/azure_snapshot_test.rb +++ b/test/unit/resources/azure_snapshot_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_snapshot' +require_relative "helper" +require "azure_snapshot" class AzureSnapshotConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,6 +8,6 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureSnapshot.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureSnapshot.new(resource_provider: "some_type") } end end diff --git a/test/unit/resources/azure_snapshots_test.rb b/test/unit/resources/azure_snapshots_test.rb index 9d2c670af..918116144 100644 --- a/test/unit/resources/azure_snapshots_test.rb +++ b/test/unit/resources/azure_snapshots_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_snapshots' +require_relative "helper" +require "azure_snapshots" class AzureSnapshotsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureSnapshots.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureSnapshots.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureSnapshots.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureSnapshots.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureSnapshots.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureSnapshots.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureSnapshots.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureSnapshots.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureSnapshots.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureSnapshots.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_sql_database_server_vulnerability_assessment_test.rb b/test/unit/resources/azure_sql_database_server_vulnerability_assessment_test.rb index db7c1ab26..4ffcc2917 100644 --- a/test/unit/resources/azure_sql_database_server_vulnerability_assessment_test.rb +++ b/test/unit/resources/azure_sql_database_server_vulnerability_assessment_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_sql_database_server_vulnerability_assessment' +require_relative "helper" +require "azure_sql_database_server_vulnerability_assessment" class AzureSqlDatabaseServerVulnerabilityAssessmentConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -7,6 +7,6 @@ def test_empty_param_not_ok end def test_resource_group_name_alone_not_ok - assert_raises(ArgumentError) { AzureSqlDatabaseServerVulnerabilityAssessment.new(resource_group: 'test') } + assert_raises(ArgumentError) { AzureSqlDatabaseServerVulnerabilityAssessment.new(resource_group: "test") } end end diff --git a/test/unit/resources/azure_sql_database_server_vulnerability_assessments_test.rb b/test/unit/resources/azure_sql_database_server_vulnerability_assessments_test.rb index 4d18cfe30..773852f0a 100644 --- a/test/unit/resources/azure_sql_database_server_vulnerability_assessments_test.rb +++ b/test/unit/resources/azure_sql_database_server_vulnerability_assessments_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_sql_database_server_vulnerability_assessments' +require_relative "helper" +require "azure_sql_database_server_vulnerability_assessments" class AzureSqlDatabaseServerVulnerabilityAssessmentsConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -7,6 +7,6 @@ def test_empty_param_not_ok end def test_resource_group_not_ok - assert_raises(ArgumentError) { AzureSqlDatabaseServerVulnerabilityAssessments.new(resource_group: 'some_type') } + assert_raises(ArgumentError) { AzureSqlDatabaseServerVulnerabilityAssessments.new(resource_group: "some_type") } end end diff --git a/test/unit/resources/azure_sql_database_test.rb b/test/unit/resources/azure_sql_database_test.rb index d0c5196d9..63ab2a9f3 100644 --- a/test/unit/resources/azure_sql_database_test.rb +++ b/test/unit/resources/azure_sql_database_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_sql_database' +require_relative "helper" +require "azure_sql_database" class AzureSqlDatabaseConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,14 +8,14 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureSqlDatabase.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureSqlDatabase.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureSqlDatabase.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureSqlDatabase.new(name: "my-name") } end def test_server_name - assert_raises(ArgumentError) { AzureSqlDatabase.new(resource_group: 'my_group', name: 'my-name') } + assert_raises(ArgumentError) { AzureSqlDatabase.new(resource_group: "my_group", name: "my-name") } end end diff --git a/test/unit/resources/azure_sql_databases_test.rb b/test/unit/resources/azure_sql_databases_test.rb index a8ffc4a7e..20803b0c7 100644 --- a/test/unit/resources/azure_sql_databases_test.rb +++ b/test/unit/resources/azure_sql_databases_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_sql_databases' +require_relative "helper" +require "azure_sql_databases" class AzureSqlDatabasesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureSqlDatabases.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureSqlDatabases.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureSqlDatabases.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureSqlDatabases.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureSqlDatabases.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureSqlDatabases.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureSqlDatabases.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureSqlDatabases.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureSqlDatabases.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureSqlDatabases.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_sql_managed_instance_test.rb b/test/unit/resources/azure_sql_managed_instance_test.rb index e2994e893..d25b74feb 100644 --- a/test/unit/resources/azure_sql_managed_instance_test.rb +++ b/test/unit/resources/azure_sql_managed_instance_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_sql_managed_instance' +require_relative "helper" +require "azure_sql_managed_instance" class AzureSQLManagedInstanceConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureSQLManagedInstance.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureSQLManagedInstance.new(resource_provider: "some_type") } end def test_resource_group_name_alone_not_ok - assert_raises(ArgumentError) { AzureSQLManagedInstance.new(resource_group: 'test') } + assert_raises(ArgumentError) { AzureSQLManagedInstance.new(resource_group: "test") } end end diff --git a/test/unit/resources/azure_sql_managed_instances_test.rb b/test/unit/resources/azure_sql_managed_instances_test.rb index 9d452c628..54bd70453 100644 --- a/test/unit/resources/azure_sql_managed_instances_test.rb +++ b/test/unit/resources/azure_sql_managed_instances_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_sql_managed_instances' +require_relative "helper" +require "azure_sql_managed_instances" class AzureSQLManagedInstancesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureSQLManagedInstances.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureSQLManagedInstances.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureSQLManagedInstances.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureSQLManagedInstances.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureSQLManagedInstances.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureSQLManagedInstances.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureSQLManagedInstances.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureSQLManagedInstances.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_sql_server_test.rb b/test/unit/resources/azure_sql_server_test.rb index db2b0331d..8a753ea49 100644 --- a/test/unit/resources/azure_sql_server_test.rb +++ b/test/unit/resources/azure_sql_server_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_sql_server' +require_relative "helper" +require "azure_sql_server" class AzureSqlServerConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureSqlServer.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureSqlServer.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureSqlServer.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureSqlServer.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_sql_servers_test.rb b/test/unit/resources/azure_sql_servers_test.rb index 95718490f..ae882d88d 100644 --- a/test/unit/resources/azure_sql_servers_test.rb +++ b/test/unit/resources/azure_sql_servers_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_sql_servers' +require_relative "helper" +require "azure_sql_servers" class AzureSqlServersConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureSqlServers.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureSqlServers.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureSqlServers.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureSqlServers.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureSqlServers.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureSqlServers.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureSqlServers.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureSqlServers.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureSqlServers.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureSqlServers.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_sql_virtual_machine_group_availability_listener_test.rb b/test/unit/resources/azure_sql_virtual_machine_group_availability_listener_test.rb index dfd4902d8..648f62917 100644 --- a/test/unit/resources/azure_sql_virtual_machine_group_availability_listener_test.rb +++ b/test/unit/resources/azure_sql_virtual_machine_group_availability_listener_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_sql_virtual_machine_group_availability_listener' +require_relative "helper" +require "azure_sql_virtual_machine_group_availability_listener" class AzureSQLVirtualMachineGroupAvailabilityListenerConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureSQLVirtualMachineGroupAvailabilityListener.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureSQLVirtualMachineGroupAvailabilityListener.new(resource_provider: "some_type") } end def test_resource_group_name_alone_not_ok - assert_raises(ArgumentError) { AzureSQLVirtualMachineGroupAvailabilityListener.new(resource_group: 'test') } + assert_raises(ArgumentError) { AzureSQLVirtualMachineGroupAvailabilityListener.new(resource_group: "test") } end end diff --git a/test/unit/resources/azure_sql_virtual_machine_group_availability_listeners_test.rb b/test/unit/resources/azure_sql_virtual_machine_group_availability_listeners_test.rb index 5300f867b..82d30e0ac 100644 --- a/test/unit/resources/azure_sql_virtual_machine_group_availability_listeners_test.rb +++ b/test/unit/resources/azure_sql_virtual_machine_group_availability_listeners_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_sql_virtual_machine_group_availability_listeners' +require_relative "helper" +require "azure_sql_virtual_machine_group_availability_listeners" class AzureSQLVirtualMachineGroupAvailabilityListenersConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureSQLVirtualMachineGroupAvailabilityListeners.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureSQLVirtualMachineGroupAvailabilityListeners.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureSQLVirtualMachineGroupAvailabilityListeners.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureSQLVirtualMachineGroupAvailabilityListeners.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureSQLVirtualMachineGroupAvailabilityListeners.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureSQLVirtualMachineGroupAvailabilityListeners.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureSQLVirtualMachineGroupAvailabilityListeners.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureSQLVirtualMachineGroupAvailabilityListeners.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_sql_virtual_machine_group_test.rb b/test/unit/resources/azure_sql_virtual_machine_group_test.rb index afb605162..61ecbc639 100644 --- a/test/unit/resources/azure_sql_virtual_machine_group_test.rb +++ b/test/unit/resources/azure_sql_virtual_machine_group_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_sql_virtual_machine_group' +require_relative "helper" +require "azure_sql_virtual_machine_group" class AzureSQLVirtualMachineGroupConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureSQLVirtualMachineGroup.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureSQLVirtualMachineGroup.new(resource_provider: "some_type") } end def test_resource_group_name_alone_not_ok - assert_raises(ArgumentError) { AzureSQLVirtualMachineGroup.new(resource_group: 'test') } + assert_raises(ArgumentError) { AzureSQLVirtualMachineGroup.new(resource_group: "test") } end end diff --git a/test/unit/resources/azure_sql_virtual_machine_groups_test.rb b/test/unit/resources/azure_sql_virtual_machine_groups_test.rb index 8c6c00e12..65c49dd1f 100644 --- a/test/unit/resources/azure_sql_virtual_machine_groups_test.rb +++ b/test/unit/resources/azure_sql_virtual_machine_groups_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_sql_virtual_machine_groups' +require_relative "helper" +require "azure_sql_virtual_machine_groups" class AzureSQLVirtualMachineGroupsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureSQLVirtualMachineGroups.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureSQLVirtualMachineGroups.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureSQLVirtualMachineGroups.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureSQLVirtualMachineGroups.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureSQLVirtualMachineGroups.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureSQLVirtualMachineGroups.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureSQLVirtualMachineGroups.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureSQLVirtualMachineGroups.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_sql_virtual_machine_test.rb b/test/unit/resources/azure_sql_virtual_machine_test.rb index 6079222aa..8d96cd28f 100644 --- a/test/unit/resources/azure_sql_virtual_machine_test.rb +++ b/test/unit/resources/azure_sql_virtual_machine_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_sql_virtual_machine' +require_relative "helper" +require "azure_sql_virtual_machine" class AzureSQLVirtualMachineConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureSQLVirtualMachine.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureSQLVirtualMachine.new(resource_provider: "some_type") } end def test_resource_group_name_alone_not_ok - assert_raises(ArgumentError) { AzureSQLVirtualMachine.new(resource_group: 'test') } + assert_raises(ArgumentError) { AzureSQLVirtualMachine.new(resource_group: "test") } end end diff --git a/test/unit/resources/azure_sql_virtual_machines_test.rb b/test/unit/resources/azure_sql_virtual_machines_test.rb index 275d67d4a..f9fe6b732 100644 --- a/test/unit/resources/azure_sql_virtual_machines_test.rb +++ b/test/unit/resources/azure_sql_virtual_machines_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_sql_virtual_machines' +require_relative "helper" +require "azure_sql_virtual_machines" class AzureSQLVirtualMachinesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureSQLVirtualMachines.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureSQLVirtualMachines.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureSQLVirtualMachines.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureSQLVirtualMachines.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureSQLVirtualMachines.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureSQLVirtualMachines.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureSQLVirtualMachines.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureSQLVirtualMachines.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_storage_account_blob_container_test.rb b/test/unit/resources/azure_storage_account_blob_container_test.rb index 963a767c2..c7c718a20 100644 --- a/test/unit/resources/azure_storage_account_blob_container_test.rb +++ b/test/unit/resources/azure_storage_account_blob_container_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_storage_account_blob_container' +require_relative "helper" +require "azure_storage_account_blob_container" class AzureStorageAccountBlobContainerConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureStorageAccountBlobContainer.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureStorageAccountBlobContainer.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureStorageAccountBlobContainer.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureStorageAccountBlobContainer.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_storage_account_blob_containers_test.rb b/test/unit/resources/azure_storage_account_blob_containers_test.rb index bb4a91c65..636d2f10f 100644 --- a/test/unit/resources/azure_storage_account_blob_containers_test.rb +++ b/test/unit/resources/azure_storage_account_blob_containers_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_storage_account_blob_containers' +require_relative "helper" +require "azure_storage_account_blob_containers" class AzureStorageAccountBlobContainersConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureStorageAccountBlobContainers.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureStorageAccountBlobContainers.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureStorageAccountBlobContainers.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureStorageAccountBlobContainers.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureStorageAccountBlobContainers.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureStorageAccountBlobContainers.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureStorageAccountBlobContainers.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureStorageAccountBlobContainers.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureStorageAccountBlobContainers.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureStorageAccountBlobContainers.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_storage_account_test.rb b/test/unit/resources/azure_storage_account_test.rb index 8b0b271bf..49f6135d9 100644 --- a/test/unit/resources/azure_storage_account_test.rb +++ b/test/unit/resources/azure_storage_account_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_storage_account' +require_relative "helper" +require "azure_storage_account" class AzureStorageAccountConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureStorageAccount.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureStorageAccount.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureStorageAccount.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureStorageAccount.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_storage_accounts_test.rb b/test/unit/resources/azure_storage_accounts_test.rb index f79bd7f71..fb7ae7f6b 100644 --- a/test/unit/resources/azure_storage_accounts_test.rb +++ b/test/unit/resources/azure_storage_accounts_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_storage_accounts' +require_relative "helper" +require "azure_storage_accounts" class AzureStorageAccountsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureStorageAccounts.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureStorageAccounts.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureStorageAccounts.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureStorageAccounts.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureStorageAccounts.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureStorageAccounts.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureStorageAccounts.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureStorageAccounts.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureStorageAccounts.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureStorageAccounts.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_streaming_analytics_function.rb b/test/unit/resources/azure_streaming_analytics_function.rb index 7d80f5925..1e8dc258b 100644 --- a/test/unit/resources/azure_streaming_analytics_function.rb +++ b/test/unit/resources/azure_streaming_analytics_function.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_streaming_analytics_function' +require_relative "helper" +require "azure_streaming_analytics_function" class AzureStreamingFunctionConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureStreamingAnalyticsFunctions.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureStreamingAnalyticsFunctions.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureStreamingAnalyticsFunctions.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureStreamingAnalyticsFunctions.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_streaming_analytics_functions.rb b/test/unit/resources/azure_streaming_analytics_functions.rb index 2d97eec83..a8ceccbe4 100644 --- a/test/unit/resources/azure_streaming_analytics_functions.rb +++ b/test/unit/resources/azure_streaming_analytics_functions.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_streaming_analytics_functions' +require_relative "helper" +require "azure_streaming_analytics_functions" class AzureStreamingFunctionsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureStreamingAnalyticsFunctions.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureStreamingAnalyticsFunctions.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureStreamingAnalyticsFunctions.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureStreamingAnalyticsFunctions.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureStreamingAnalyticsFunctions.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureStreamingAnalyticsFunctions.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureStreamingAnalyticsFunctions.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureStreamingAnalyticsFunctions.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureStreamingAnalyticsFunctions.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureStreamingAnalyticsFunctions.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_subnet_test.rb b/test/unit/resources/azure_subnet_test.rb index d37f9f917..f1223ccb1 100644 --- a/test/unit/resources/azure_subnet_test.rb +++ b/test/unit/resources/azure_subnet_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_subnet' +require_relative "helper" +require "azure_subnet" class AzureSubnetConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,15 +8,15 @@ def test_empty_param_not_ok # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureSubnet.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureSubnet.new(resource_provider: "some_type") } end # resource_group, vnet and name should be provided together def test_missing_required_params_one - assert_raises(ArgumentError) { AzureSubnet.new(resource_group: 'some_r_g') } + assert_raises(ArgumentError) { AzureSubnet.new(resource_group: "some_r_g") } end def test_missing_required_params_two - assert_raises(ArgumentError) { AzureSubnet.new(resource_group: 'some_r_g', vnet: 'virtual_net_name') } + assert_raises(ArgumentError) { AzureSubnet.new(resource_group: "some_r_g", vnet: "virtual_net_name") } end end diff --git a/test/unit/resources/azure_subnets_test.rb b/test/unit/resources/azure_subnets_test.rb index 893e05819..6c0e81e91 100644 --- a/test/unit/resources/azure_subnets_test.rb +++ b/test/unit/resources/azure_subnets_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_subnets' +require_relative "helper" +require "azure_subnets" class AzureSubnetsConstructorTest < Minitest::Test # resource_provider should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureSubnets.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureSubnets.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureSubnets.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureSubnets.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureSubnets.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureSubnets.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureSubnets.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureSubnets.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureSubnets.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureSubnets.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_subscription_test.rb b/test/unit/resources/azure_subscription_test.rb index dd5021b78..029b1b588 100644 --- a/test/unit/resources/azure_subscription_test.rb +++ b/test/unit/resources/azure_subscription_test.rb @@ -1,13 +1,13 @@ -require_relative 'helper' -require 'azure_subscription' +require_relative "helper" +require "azure_subscription" class AzureSubscriptionConstructorTest < Minitest::Test # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureSubscription.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureSubscription.new(resource_provider: "some_type") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureSubscription.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureSubscription.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_subscriptions_test.rb b/test/unit/resources/azure_subscriptions_test.rb index ea8db31a4..0af21f6b1 100644 --- a/test/unit/resources/azure_subscriptions_test.rb +++ b/test/unit/resources/azure_subscriptions_test.rb @@ -1,9 +1,9 @@ -require_relative 'helper' -require 'azure_subscriptions' +require_relative "helper" +require "azure_subscriptions" class AzureSubscriptionsConstructorTest < Minitest::Test # Parameter not allowed. def test_parameter_not_ok - assert_raises(ArgumentError) { AzureSubscriptions.new(any: 'some_value') } + assert_raises(ArgumentError) { AzureSubscriptions.new(any: "some_value") } end end diff --git a/test/unit/resources/azure_synapse_notebook_test.rb b/test/unit/resources/azure_synapse_notebook_test.rb index 2f041e9fe..50aab04c6 100644 --- a/test/unit/resources/azure_synapse_notebook_test.rb +++ b/test/unit/resources/azure_synapse_notebook_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_synapse_notebook' +require_relative "helper" +require "azure_synapse_notebook" class AzureSynapseNotebookConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -7,10 +7,10 @@ def test_empty_param_not_ok end def test_endpoint_alone_not_ok - assert_raises(ArgumentError) { AzureSynapseNotebook.new(endpoint: 'https://analytics.dev.azuresynapse.net') } + assert_raises(ArgumentError) { AzureSynapseNotebook.new(endpoint: "https://analytics.dev.azuresynapse.net") } end def test_name_alone_not_ok - assert_raises(ArgumentError) { AzureSynapseNotebook.new(name: 'my-analytics-notebook') } + assert_raises(ArgumentError) { AzureSynapseNotebook.new(name: "my-analytics-notebook") } end end diff --git a/test/unit/resources/azure_synapse_notebooks_test.rb b/test/unit/resources/azure_synapse_notebooks_test.rb index c07bbb860..530fca64e 100644 --- a/test/unit/resources/azure_synapse_notebooks_test.rb +++ b/test/unit/resources/azure_synapse_notebooks_test.rb @@ -1,12 +1,12 @@ -require_relative 'helper' -require 'azure_synapse_notebooks' +require_relative "helper" +require "azure_synapse_notebooks" class AzureSynapseNotebooksConstructorTest < Minitest::Test def tag_value_not_ok - assert_raises(ArgumentError) { AzureSynapseNotebooks.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureSynapseNotebooks.new(tag_value: "some_tag_value") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureSynapseNotebooks.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureSynapseNotebooks.new(resource_id: "some_id") } end end diff --git a/test/unit/resources/azure_synapse_workspace_test.rb b/test/unit/resources/azure_synapse_workspace_test.rb index 363ed161d..8785837cf 100644 --- a/test/unit/resources/azure_synapse_workspace_test.rb +++ b/test/unit/resources/azure_synapse_workspace_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_synapse_workspace' +require_relative "helper" +require "azure_synapse_workspace" class AzureSynapseWorkspaceConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureSynapseWorkspace.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureSynapseWorkspace.new(resource_provider: "some_type") } end def test_resource_group_name_alone_not_ok - assert_raises(ArgumentError) { AzureSynapseWorkspace.new(resource_group: 'test') } + assert_raises(ArgumentError) { AzureSynapseWorkspace.new(resource_group: "test") } end end diff --git a/test/unit/resources/azure_synapse_workspaces_test.rb b/test/unit/resources/azure_synapse_workspaces_test.rb index ab3c80881..bb9748bfb 100644 --- a/test/unit/resources/azure_synapse_workspaces_test.rb +++ b/test/unit/resources/azure_synapse_workspaces_test.rb @@ -1,21 +1,21 @@ -require_relative 'helper' -require 'azure_synapse_workspaces' +require_relative "helper" +require "azure_synapse_workspaces" class AzureSynapseWorkspacesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureSynapseWorkspaces.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureSynapseWorkspaces.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureSynapseWorkspaces.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureSynapseWorkspaces.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureSynapseWorkspaces.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureSynapseWorkspaces.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureSynapseWorkspaces.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureSynapseWorkspaces.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_virtual_machine_disk_test.rb b/test/unit/resources/azure_virtual_machine_disk_test.rb index 6c77ea30a..2ee3089c1 100644 --- a/test/unit/resources/azure_virtual_machine_disk_test.rb +++ b/test/unit/resources/azure_virtual_machine_disk_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_virtual_machine_disk' +require_relative "helper" +require "azure_virtual_machine_disk" class AzureVirtualMachineDiskConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureVirtualMachineDisk.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureVirtualMachineDisk.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureVirtualMachineDisk.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureVirtualMachineDisk.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_virtual_machine_disks_test.rb b/test/unit/resources/azure_virtual_machine_disks_test.rb index 7bffec79c..e3f52e68e 100644 --- a/test/unit/resources/azure_virtual_machine_disks_test.rb +++ b/test/unit/resources/azure_virtual_machine_disks_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_virtual_machine_disks' +require_relative "helper" +require "azure_virtual_machine_disks" class AzureVirtualMachineDisksConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureVirtualMachineDisks.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureVirtualMachineDisks.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureVirtualMachineDisks.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureVirtualMachineDisks.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureVirtualMachineDisks.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureVirtualMachineDisks.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureVirtualMachineDisks.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureVirtualMachineDisks.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureVirtualMachineDisks.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureVirtualMachineDisks.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_virtual_machine_test.rb b/test/unit/resources/azure_virtual_machine_test.rb index a4c9b5aba..e545d6bd5 100644 --- a/test/unit/resources/azure_virtual_machine_test.rb +++ b/test/unit/resources/azure_virtual_machine_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_virtual_machine' +require_relative "helper" +require "azure_virtual_machine" class AzureVirtualMachineConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureVirtualMachine.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureVirtualMachine.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureVirtualMachine.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureVirtualMachine.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_virtual_machines_test.rb b/test/unit/resources/azure_virtual_machines_test.rb index 613708790..d963d23e5 100644 --- a/test/unit/resources/azure_virtual_machines_test.rb +++ b/test/unit/resources/azure_virtual_machines_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_virtual_machines' +require_relative "helper" +require "azure_virtual_machines" class AzureVirtualMachinesConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureVirtualMachines.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureVirtualMachines.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureVirtualMachines.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureVirtualMachines.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureVirtualMachines.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureVirtualMachines.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureVirtualMachines.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureVirtualMachines.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureVirtualMachines.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureVirtualMachines.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_virtual_network_gateway_connection_test.rb b/test/unit/resources/azure_virtual_network_gateway_connection_test.rb index 385c3e983..ef72d291e 100644 --- a/test/unit/resources/azure_virtual_network_gateway_connection_test.rb +++ b/test/unit/resources/azure_virtual_network_gateway_connection_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_virtual_network_gateway_connection' +require_relative "helper" +require "azure_virtual_network_gateway_connection" class AzureVirtualNetworkGatewayConnectionConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureVirtualNetworkGatewayConnection.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureVirtualNetworkGatewayConnection.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureVirtualNetworkGatewayConnection.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureVirtualNetworkGatewayConnection.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_virtual_network_gateway_connections_test.rb b/test/unit/resources/azure_virtual_network_gateway_connections_test.rb index b63286e0d..0a9cd8b1a 100644 --- a/test/unit/resources/azure_virtual_network_gateway_connections_test.rb +++ b/test/unit/resources/azure_virtual_network_gateway_connections_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_virtual_network_gateway_connections' +require_relative "helper" +require "azure_virtual_network_gateway_connections" class AzureVirtualNetworkGatewayConnectionsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureVirtualNetworkGatewayConnections.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureVirtualNetworkGatewayConnections.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureVirtualNetworkGatewayConnections.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureVirtualNetworkGatewayConnections.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureVirtualNetworkGatewayConnections.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureVirtualNetworkGatewayConnections.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureVirtualNetworkGatewayConnections.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureVirtualNetworkGatewayConnections.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureVirtualNetworkGatewayConnections.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureVirtualNetworkGatewayConnections.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_virtual_network_gateway_test.rb b/test/unit/resources/azure_virtual_network_gateway_test.rb index 7391d733d..7d577bed3 100644 --- a/test/unit/resources/azure_virtual_network_gateway_test.rb +++ b/test/unit/resources/azure_virtual_network_gateway_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_virtual_network_gateway' +require_relative "helper" +require "azure_virtual_network_gateway" class AzureVirtualNetworkGatewayConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureVirtualNetworkGateway.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureVirtualNetworkGateway.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureVirtualNetworkGateway.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureVirtualNetworkGateway.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_virtual_network_gateways.rb b/test/unit/resources/azure_virtual_network_gateways.rb index 61a644872..7ee9526ae 100644 --- a/test/unit/resources/azure_virtual_network_gateways.rb +++ b/test/unit/resources/azure_virtual_network_gateways.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_virtual_network_gateways' +require_relative "helper" +require "azure_virtual_network_gateways" class AzureVirtualNetworkGatewaysConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureVirtualNetworkGateways.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureVirtualNetworkGateways.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureVirtualNetworkGateways.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureVirtualNetworkGateways.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureVirtualNetworkGateways.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureVirtualNetworkGateways.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureVirtualNetworkGateways.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureVirtualNetworkGateways.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureVirtualNetworkGateways.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureVirtualNetworkGateways.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_virtual_network_peering_test.rb b/test/unit/resources/azure_virtual_network_peering_test.rb index 151e86d43..a51ada651 100644 --- a/test/unit/resources/azure_virtual_network_peering_test.rb +++ b/test/unit/resources/azure_virtual_network_peering_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_virtual_network_peering' +require_relative "helper" +require "azure_virtual_network_peering" class AzureVirtualNetworkPeeringConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,15 +8,15 @@ def test_empty_param_not_ok # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureVirtualNetworkPeering.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureVirtualNetworkPeering.new(resource_provider: "some_type") } end # resource_group, vnet and name should be provided together def test_missing_required_params_one - assert_raises(ArgumentError) { AzureVirtualNetworkPeering.new(resource_group: 'some_r_g') } + assert_raises(ArgumentError) { AzureVirtualNetworkPeering.new(resource_group: "some_r_g") } end def test_missing_required_params_two - assert_raises(ArgumentError) { AzureVirtualNetworkPeering.new(resource_group: 'some_r_g', vnet: 'virtual_net_name') } + assert_raises(ArgumentError) { AzureVirtualNetworkPeering.new(resource_group: "some_r_g", vnet: "virtual_net_name") } end end diff --git a/test/unit/resources/azure_virtual_network_peerings_test.rb b/test/unit/resources/azure_virtual_network_peerings_test.rb index 924bdd390..e5d85981f 100644 --- a/test/unit/resources/azure_virtual_network_peerings_test.rb +++ b/test/unit/resources/azure_virtual_network_peerings_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_virtual_network_peerings' +require_relative "helper" +require "azure_virtual_network_peerings" class AzureVirtualNetworkPeeringsConstructorTest < Minitest::Test # resource_provider should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureVirtualNetworkPeerings.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureVirtualNetworkPeerings.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureVirtualNetworkPeerings.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureVirtualNetworkPeerings.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureVirtualNetworkPeerings.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureVirtualNetworkPeerings.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureVirtualNetworkPeerings.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureVirtualNetworkPeerings.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureVirtualNetworkPeerings.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureVirtualNetworkPeerings.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_virtual_network_test.rb b/test/unit/resources/azure_virtual_network_test.rb index 63b021cca..59350acfc 100644 --- a/test/unit/resources/azure_virtual_network_test.rb +++ b/test/unit/resources/azure_virtual_network_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_virtual_network' +require_relative "helper" +require "azure_virtual_network" class AzureVirtualNetworkConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureVirtualNetwork.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureVirtualNetwork.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureVirtualNetwork.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureVirtualNetwork.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_virtual_networks_test.rb b/test/unit/resources/azure_virtual_networks_test.rb index 0e8e224c8..b2ad168dc 100644 --- a/test/unit/resources/azure_virtual_networks_test.rb +++ b/test/unit/resources/azure_virtual_networks_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_virtual_networks' +require_relative "helper" +require "azure_virtual_networks" class AzureVirtualNetworksConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureVirtualNetworks.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureVirtualNetworks.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureVirtualNetworks.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureVirtualNetworks.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureVirtualNetworks.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureVirtualNetworks.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureVirtualNetworks.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureVirtualNetworks.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureVirtualNetworks.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureVirtualNetworks.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_virtual_wan_test.rb b/test/unit/resources/azure_virtual_wan_test.rb index b5d7e7d35..56d9a9d59 100644 --- a/test/unit/resources/azure_virtual_wan_test.rb +++ b/test/unit/resources/azure_virtual_wan_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_virtual_wan' +require_relative "helper" +require "azure_virtual_wan" class AzureVirtualWanConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -7,6 +7,6 @@ def test_empty_param_not_ok end def test_resource_group_alone_not_ok - assert_raises(ArgumentError) { AzureVirtualWan.new(resource_group: 'some_type') } + assert_raises(ArgumentError) { AzureVirtualWan.new(resource_group: "some_type") } end end diff --git a/test/unit/resources/azure_virtual_wans_test.rb b/test/unit/resources/azure_virtual_wans_test.rb index 244bb3513..04cddd873 100644 --- a/test/unit/resources/azure_virtual_wans_test.rb +++ b/test/unit/resources/azure_virtual_wans_test.rb @@ -1,20 +1,20 @@ -require_relative 'helper' -require 'azure_virtual_wans' +require_relative "helper" +require "azure_virtual_wans" class AzureVirtualWansConstructorTest < Minitest::Test def test_resource_type_alone_not_ok - assert_raises(ArgumentError) { AzureVirtualWans.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureVirtualWans.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureVirtualWans.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureVirtualWans.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureVirtualWans.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureVirtualWans.new(tag_name: "some_tag_name") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureVirtualWans.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureVirtualWans.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_web_app_function_test.rb b/test/unit/resources/azure_web_app_function_test.rb index e5ddc5463..6c78e5826 100644 --- a/test/unit/resources/azure_web_app_function_test.rb +++ b/test/unit/resources/azure_web_app_function_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_web_app_function' +require_relative "helper" +require "azure_web_app_function" class AzureWebAppFunctionConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureWebAppFunction.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureWebAppFunction.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureWebAppFunction.new(resource_group: 'my-rg', name: 'my-name') } + assert_raises(ArgumentError) { AzureWebAppFunction.new(resource_group: "my-rg", name: "my-name") } end end diff --git a/test/unit/resources/azure_web_app_functions_test.rb b/test/unit/resources/azure_web_app_functions_test.rb index 8112e27aa..8788e750b 100644 --- a/test/unit/resources/azure_web_app_functions_test.rb +++ b/test/unit/resources/azure_web_app_functions_test.rb @@ -1,24 +1,24 @@ -require_relative 'helper' -require 'azure_web_app_functions' +require_relative "helper" +require "azure_web_app_functions" class AzureWebAppFunctionsTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureWebAppFunctions.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureWebAppFunctions.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureWebAppFunctions.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureWebAppFunctions.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureWebAppFunctions.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureWebAppFunctions.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureWebAppFunctions.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureWebAppFunctions.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureWebAppFunctions.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureWebAppFunctions.new(name: "some_name") } end end diff --git a/test/unit/resources/azure_webapp_test.rb b/test/unit/resources/azure_webapp_test.rb index 20cc244a8..507e9db2e 100644 --- a/test/unit/resources/azure_webapp_test.rb +++ b/test/unit/resources/azure_webapp_test.rb @@ -1,5 +1,5 @@ -require_relative 'helper' -require 'azure_webapp' +require_relative "helper" +require "azure_webapp" class AzureWebappConstructorTest < Minitest::Test def test_empty_param_not_ok @@ -8,10 +8,10 @@ def test_empty_param_not_ok # resource_provider should not be allowed. def test_resource_provider_not_ok - assert_raises(ArgumentError) { AzureWebapp.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureWebapp.new(resource_provider: "some_type") } end def test_resource_group - assert_raises(ArgumentError) { AzureWebapp.new(name: 'my-name') } + assert_raises(ArgumentError) { AzureWebapp.new(name: "my-name") } end end diff --git a/test/unit/resources/azure_webapps_test.rb b/test/unit/resources/azure_webapps_test.rb index b9a68a957..5424b1b34 100644 --- a/test/unit/resources/azure_webapps_test.rb +++ b/test/unit/resources/azure_webapps_test.rb @@ -1,25 +1,25 @@ -require_relative 'helper' -require 'azure_webapps' +require_relative "helper" +require "azure_webapps" class AzureWebappsConstructorTest < Minitest::Test # resource_type should not be allowed. def test_resource_type_not_ok - assert_raises(ArgumentError) { AzureWebapps.new(resource_provider: 'some_type') } + assert_raises(ArgumentError) { AzureWebapps.new(resource_provider: "some_type") } end def tag_value_not_ok - assert_raises(ArgumentError) { AzureWebapps.new(tag_value: 'some_tag_value') } + assert_raises(ArgumentError) { AzureWebapps.new(tag_value: "some_tag_value") } end def tag_name_not_ok - assert_raises(ArgumentError) { AzureWebapps.new(tag_name: 'some_tag_name') } + assert_raises(ArgumentError) { AzureWebapps.new(tag_name: "some_tag_name") } end def test_resource_id_not_ok - assert_raises(ArgumentError) { AzureWebapps.new(resource_id: 'some_id') } + assert_raises(ArgumentError) { AzureWebapps.new(resource_id: "some_id") } end def test_name_not_ok - assert_raises(ArgumentError) { AzureWebapps.new(name: 'some_name') } + assert_raises(ArgumentError) { AzureWebapps.new(name: "some_name") } end end diff --git a/test/unit/resources/helper.rb b/test/unit/resources/helper.rb index 862e9b44e..770fc243d 100644 --- a/test/unit/resources/helper.rb +++ b/test/unit/resources/helper.rb @@ -1,4 +1,4 @@ -require 'minitest/autorun' -require 'minitest/unit' -require 'minitest/pride' -require 'inspec' +require "minitest/autorun" +require "minitest/unit" +require "minitest/pride" +require "inspec" diff --git a/test/unit/test_helper.rb b/test/unit/test_helper.rb index edee0d35a..81905078a 100644 --- a/test/unit/test_helper.rb +++ b/test/unit/test_helper.rb @@ -5,16 +5,16 @@ # Do not add any other code to this code block. Simplecov # only until the next code block: -if ENV['CI_ENABLE_COVERAGE'] - require 'simplecov/no_defaults' - require 'helpers/simplecov_minitest' +if ENV["CI_ENABLE_COVERAGE"] + require "simplecov/no_defaults" + require "helpers/simplecov_minitest" SimpleCov.start do - add_filter '/test/' + add_filter "/test/" end end ## End Simplecov config -require 'minitest/autorun' -require 'minitest/unit' +require "minitest/autorun" +require "minitest/unit"