From 403647c3e45412a41bcb8a55181362fab5e4a85b Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Mon, 30 Aug 2021 16:49:46 -0700 Subject: [PATCH] Fix typos identified by cspell Just a pile of misc typos Signed-off-by: Tim Smith --- dev-docs/compliance.md | 2 +- dev-docs/filtertable-usage.md | 4 ++-- .../resources/aws_organizations_member.md | 2 +- .../inspec/resources/aws_sns_subscription.md | 2 +- .../azurerm_monitor_activity_log_alert.md | 2 +- .../azurerm_network_security_group.md | 6 +++--- lib/inspec/resources/registry_key.rb | 2 +- lib/inspec/resources/wmi.rb | 2 +- .../inspec-plugin-manager-cli/cli_command.rb | 4 ++-- .../test/functional/install_test.rb | 10 +++++----- .../test/functional/update_test.rb | 2 +- lib/resources/aws/aws_iam_access_key.rb | 2 +- lib/resources/azure/azure_backend.rb | 6 +++--- lib/resources/azure/azure_virtual_machine.rb | 2 +- .../azure/azure_virtual_machine_data_disk.rb | 4 ++-- .../exception-in-control/controls/01-file.rb | 6 +++--- .../controls/02-sshd_config.rb | 6 +++--- test/functional/inspec_exec_test.rb | 2 +- .../verify/controls/aws_cloudtrail_trail.rb | 2 +- .../aws/default/verify/controls/aws_kms_key.rb | 2 +- .../policies/default/controls/user_spec.rb | 2 +- .../find_files/libraries/find_files.rb | 2 +- test/unit/plugin/v2/api_input_test.rb | 2 +- test/unit/plugin/v2/installer_test.rb | 4 ++-- .../resources/aws_cloudtrail_trail_test.rb | 16 ++++++++-------- test/unit/resources/aws_iam_policy_test.rb | 18 +++++++++--------- test/unit/resources/aws_kms_key_test.rb | 18 +++++++++--------- test/unit/resources/command_test.rb | 4 ++-- .../resources/etc_hosts_allow_deny_test.rb | 2 +- test/unit/resources/json_test.rb | 4 ++-- test/unit/resources/port_test.rb | 4 ++-- test/unit/resources/postgres_hba_conf_test.rb | 2 +- test/unit/resources/x509_certificate_test.rb | 4 ++-- test/unit/runner_test.rb | 2 +- test/unit/utils/nginx_parser_test.rb | 8 ++++---- 35 files changed, 81 insertions(+), 81 deletions(-) diff --git a/dev-docs/compliance.md b/dev-docs/compliance.md index 808f0889b..722449a6d 100644 --- a/dev-docs/compliance.md +++ b/dev-docs/compliance.md @@ -55,7 +55,7 @@ Actual HTTP communication is handled by `InspecPlugins::Compliance::HTTP`, again #### lib/http.rb -This is probably unneccesary. It is a wrapper around Net:HTTP. Instead, we should probably be using a REST API wrapper or something similar. +This is probably unnecessary. It is a wrapper around Net:HTTP. Instead, we should probably be using a REST API wrapper or something similar. #### lib/support.rb diff --git a/dev-docs/filtertable-usage.md b/dev-docs/filtertable-usage.md index efd39e49c..347275fe7 100644 --- a/dev-docs/filtertable-usage.md +++ b/dev-docs/filtertable-usage.md @@ -40,7 +40,7 @@ class Thing < Inspec.resource(1) filter_table_config.install_filter_methods_on_resource(self, :fetch_data) def fetch_data - # This method should return an array of hashes - the raw data. We'll hardcode it here. + # This method should return an array of hashes - the raw data. We'll hard code it here. [ { thing_id: 1, color: :red }, { thing_id: 2, color: :blue, tackiness: 'very' }, @@ -301,7 +301,7 @@ This method behaves just like `thing_ids`, except that it returns the values of You also get this for `thing_ids`. This is unrelated to `style: :simple` for `colors`. -People definitely use this in the wild. It reads badly to me; I think this is a legacy usage that we should consider deprecating. To me, this seems to imply that there is a sub-resource (here, colors) we are auditing. At least two core resouces (`xinetd_conf` and `users`) advocate this as their primary use. +People definitely use this in the wild. It reads badly to me; I think this is a legacy usage that we should consider deprecating. To me, this seems to imply that there is a sub-resource (here, colors) we are auditing. At least two core resources (`xinetd_conf` and `users`) advocate this as their primary use. ```ruby # Filter on colors diff --git a/docs-chef-io/content/inspec/resources/aws_organizations_member.md b/docs-chef-io/content/inspec/resources/aws_organizations_member.md index 23920cc89..8e5f0cd97 100644 --- a/docs-chef-io/content/inspec/resources/aws_organizations_member.md +++ b/docs-chef-io/content/inspec/resources/aws_organizations_member.md @@ -50,7 +50,7 @@ _**If the current Account is the Master Account, the following properties are al | ------------- | ------------------------------------------------------ | | account_id | The ID of the current Account. | | account_arn | The ARN of the current Account. | -| account_name | The Name of the current Acccount. | +| account_name | The Name of the current Account. | | account_email | The Email address associated with the current Account. | ## Examples diff --git a/docs-chef-io/content/inspec/resources/aws_sns_subscription.md b/docs-chef-io/content/inspec/resources/aws_sns_subscription.md index 9c7e79f77..f2f400730 100644 --- a/docs-chef-io/content/inspec/resources/aws_sns_subscription.md +++ b/docs-chef-io/content/inspec/resources/aws_sns_subscription.md @@ -52,7 +52,7 @@ See also the [AWS documentation on SNS](https://docs.aws.amazon.com/sns/latest/d its('endpoint') { should cmp '+16105551234' } # If protocol is 'email' or 'email-json', endpoint should be an email address its('endpoint') { should cmp 'myemail@example.com' } - # If protocal is 'http', endpoint should be a URL beginning with 'https://' + # If protocol is 'http', endpoint should be a URL beginning with 'https://' its('endpoint') { should cmp 'https://www.exampleurl.com' } # If the protocol is 'lambda', its endpoint should be the ARN of a AWS Lambda function its('endpoint') { should cmp 'rn:aws:lambda:us-east-1:account-id:function:myfunction' } diff --git a/docs-chef-io/content/inspec/resources/azurerm_monitor_activity_log_alert.md b/docs-chef-io/content/inspec/resources/azurerm_monitor_activity_log_alert.md index 69e9f5853..511057bf9 100644 --- a/docs-chef-io/content/inspec/resources/azurerm_monitor_activity_log_alert.md +++ b/docs-chef-io/content/inspec/resources/azurerm_monitor_activity_log_alert.md @@ -69,7 +69,7 @@ name and resource group. ## Parameter Examples -The resource group as well as the Activty Log Alert +The resource group as well as the Activity Log Alert name. describe azurerm_monitor_activity_log_alert(resource_group: 'example', name: 'AlertName') do diff --git a/docs-chef-io/content/inspec/resources/azurerm_network_security_group.md b/docs-chef-io/content/inspec/resources/azurerm_network_security_group.md index 26d684e4f..e273ffb52 100644 --- a/docs-chef-io/content/inspec/resources/azurerm_network_security_group.md +++ b/docs-chef-io/content/inspec/resources/azurerm_network_security_group.md @@ -99,21 +99,21 @@ The default_security_rules property contains the set of Default Security Rules. ### allow_ssh_from_internet -The allow_ssh_from_internet property contains a boolean value determined by analysing +The allow_ssh_from_internet property contains a boolean value determined by analyzing the Security Rules and Default Security Rules for unrestricted SSH access. it { should_not allow_ssh_from_internet } ### allow_rdp_from_internet -The allow_rdp_from_internet property contains a boolean value determined by analysing +The allow_rdp_from_internet property contains a boolean value determined by analyzing the Security Rules and Default Security Rules for unrestricted RDP access. it { should_not allow_rdp_from_internet } ### allow\port_from_internet -The allow_port_from_internet property contains a boolean value determined by analysing +The allow_port_from_internet property contains a boolean value determined by analyzing the Security Rules and Default Security Rules for unrestricted access to a specified port. it { should_not allow_port_from_internet('443') } diff --git a/lib/inspec/resources/registry_key.rb b/lib/inspec/resources/registry_key.rb index 803009598..6e09fdb9c 100644 --- a/lib/inspec/resources/registry_key.rb +++ b/lib/inspec/resources/registry_key.rb @@ -105,7 +105,7 @@ module Inspec::Resources children_keys(@options[:path], filter) end - # returns nil, if not existant or value + # returns nil, if not existent or value def method_missing(*keys) # allow the use of array syntax in an `its` block so that users # can use it to query for keys with . characters in them diff --git a/lib/inspec/resources/wmi.rb b/lib/inspec/resources/wmi.rb index 056ccb1e0..523bc2180 100644 --- a/lib/inspec/resources/wmi.rb +++ b/lib/inspec/resources/wmi.rb @@ -36,7 +36,7 @@ module Inspec::Resources end end - # returns nil, if not existant or value + # returns nil, if not existent or value def method_missing(*keys) # catch behavior of rspec its implementation # @see https://github.com/rspec/rspec-its/blob/v1.2.0/lib/rspec/its.rb#L110 diff --git a/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli/cli_command.rb b/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli/cli_command.rb index 7b26ef355..aec668c2e 100644 --- a/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli/cli_command.rb +++ b/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli/cli_command.rb @@ -434,7 +434,7 @@ module InspecPlugins "version #{options[:version]} found on #{source_host} - " \ "installation failed.\n") else - ui.red("Unknown error occured - installation failed.\n") + ui.red("Unknown error occurred - installation failed.\n") end ui.exit Inspec::UI::EXIT_USAGE_ERROR end @@ -458,7 +458,7 @@ module InspecPlugins end end - # Check for latest version (and implicitly, existance) + # Check for latest version (and implicitly, existence) latest_version = installer.search(plugin_name, exact: true, scope: :latest) latest_version = latest_version[plugin_name]&.last diff --git a/lib/plugins/inspec-plugin-manager-cli/test/functional/install_test.rb b/lib/plugins/inspec-plugin-manager-cli/test/functional/install_test.rb index 60e6b9965..d373a7392 100644 --- a/lib/plugins/inspec-plugin-manager-cli/test/functional/install_test.rb +++ b/lib/plugins/inspec-plugin-manager-cli/test/functional/install_test.rb @@ -8,7 +8,7 @@ class PluginManagerCliInstall < Minitest::Test include PluginManagerHelpers ruby_abi_version = (Gem.ruby_version.segments[0, 2] << 0).join(".") - # Test multiple hueristics of the path-mode install. + # Test multiple heuristics of the path-mode install. # These are all positive tests; they should resolve the entry point to the same path in each case. { "is_perfect" => { @@ -66,7 +66,7 @@ class PluginManagerCliInstall < Minitest::Test end end - def test_fail_install_from_nonexistant_path + def test_fail_install_from_nonexistent_path bad_path = File.join(project_fixtures_path, "none", "such", "inspec-test-fixture-nonesuch.rb") install_result = run_inspec_process_with_this_plugin("plugin install #{bad_path}") @@ -166,7 +166,7 @@ class PluginManagerCliInstall < Minitest::Test assert_exit_code 0, install_result end - def test_fail_install_from_nonexistant_gemfile + def test_fail_install_from_nonexistent_gemfile bad_path = File.join(project_fixtures_path, "none", "such", "inspec-test-fixture-nonesuch-0.3.0.gem") install_result = run_inspec_process_with_this_plugin("plugin install #{bad_path}") @@ -195,7 +195,7 @@ class PluginManagerCliInstall < Minitest::Test assert_exit_code 0, install_result end - def test_fail_install_from_nonexistant_remote_rubygem + def test_fail_install_from_nonexistent_remote_rubygem install_result = run_inspec_process_with_this_plugin("plugin install inspec-test-fixture-nonesuch") assert_match(/No such plugin gem .+ could be found on rubygems.org - installation failed./, install_result.stdout) @@ -224,7 +224,7 @@ class PluginManagerCliInstall < Minitest::Test assert_exit_code 0, install_result end - def test_fail_install_from_nonexistant_rubygem_version + def test_fail_install_from_nonexistent_rubygem_version install_result = run_inspec_process_with_this_plugin("plugin install inspec-test-fixture -v 99.99.99") fail_message = install_result.stdout.split("\n").grep(/failed/).last diff --git a/lib/plugins/inspec-plugin-manager-cli/test/functional/update_test.rb b/lib/plugins/inspec-plugin-manager-cli/test/functional/update_test.rb index 48ebbbbdd..c913c81c2 100644 --- a/lib/plugins/inspec-plugin-manager-cli/test/functional/update_test.rb +++ b/lib/plugins/inspec-plugin-manager-cli/test/functional/update_test.rb @@ -49,7 +49,7 @@ class PluginManagerCliUpdate < Minitest::Test assert_exit_code 0, update_result end - def test_fail_update_from_nonexistant_gem + def test_fail_update_from_nonexistent_gem update_result = run_inspec_process_with_this_plugin("plugin update inspec-test-fixture-nonesuch") assert_match(/No such plugin installed:.+ - update failed/, update_result.stdout) diff --git a/lib/resources/aws/aws_iam_access_key.rb b/lib/resources/aws/aws_iam_access_key.rb index 4de346780..52e810208 100644 --- a/lib/resources/aws/aws_iam_access_key.rb +++ b/lib/resources/aws/aws_iam_access_key.rb @@ -86,7 +86,7 @@ class AwsIamAccessKey < Inspec.resource(1) end if access_keys.count > 1 - raise "More than one access key matched for aws_iam_access_key. Use more specific paramaters, such as access_key_id." + raise "More than one access key matched for aws_iam_access_key. Use more specific parameters, such as access_key_id." end @exists = true diff --git a/lib/resources/azure/azure_backend.rb b/lib/resources/azure/azure_backend.rb index d6ebf329d..27eaf2b6b 100644 --- a/lib/resources/azure/azure_backend.rb +++ b/lib/resources/azure/azure_backend.rb @@ -6,7 +6,7 @@ module Inspec::Resources class AzureResourceBase < Inspec.resource(1) attr_reader :opts, :client, :azure - # Constructor that retreives the specified resource + # Constructor that retrieves the specified resource # # The opts hash should contain the following # :group_name - name of the resource group in which to look for items @@ -275,7 +275,7 @@ end # Class object to maintain a count of the Azure Resource types that are found # when a less specific test is carried out. For example if all the resoures of a resource -# group are called for, there will be variaous types and number of those types. +# group are called for, there will be various types and number of those types. # # Each type is namespaced, so for example a virtual machine has the type 'Microsoft.Compute/virtualMachines' # This is broken down into the 'Microsoft' class with the type 'Compute/virtualMachines' @@ -310,7 +310,7 @@ class AzureResourceTypeCounts end # Class object that is created for each element that is returned by Azure. -# This is what is interogated by Inspec. If they are nested hashes, then this results +# This is what is interrogated by InSpec. If they are nested hashes, then this results # in nested AzureResourceProbe objects. # # For example, if the following was seen in an Azure Resource diff --git a/lib/resources/azure/azure_virtual_machine.rb b/lib/resources/azure/azure_virtual_machine.rb index 8b2a97d66..90ca23855 100644 --- a/lib/resources/azure/azure_virtual_machine.rb +++ b/lib/resources/azure/azure_virtual_machine.rb @@ -127,7 +127,7 @@ module Inspec::Resources password_authentication? end - # Deteremine if the machine allows password authentication + # Determine if the machine allows password authentication # # @return boolean def password_authentication? diff --git a/lib/resources/azure/azure_virtual_machine_data_disk.rb b/lib/resources/azure/azure_virtual_machine_data_disk.rb index 9dfacf666..1559c1818 100644 --- a/lib/resources/azure/azure_virtual_machine_data_disk.rb +++ b/lib/resources/azure/azure_virtual_machine_data_disk.rb @@ -85,7 +85,7 @@ module Inspec::Resources # return hashtable def parse_datadisk(disk, index) # Configure parsed hashtable to hold the information - # Initialise this with common attributes from the different types of disk + # Initialize this with common attributes from the different types of disk parsed = { disk: index, number: index + 1, @@ -115,7 +115,7 @@ module Inspec::Resources parsed[:storage_account_type] = disk.managedDisk.storageAccountType parsed[:id] = disk.managedDisk.id - # Break up the ID string so that the following information can get retreived + # Break up the ID string so that the following information can get retrieved # - subscription_id # - resource_group id_parts = parsed[:id].split(%r{/}).reject(&:empty?) diff --git a/test/fixtures/profiles/exception-in-control/controls/01-file.rb b/test/fixtures/profiles/exception-in-control/controls/01-file.rb index 6383196a5..7e47003b9 100644 --- a/test/fixtures/profiles/exception-in-control/controls/01-file.rb +++ b/test/fixtures/profiles/exception-in-control/controls/01-file.rb @@ -1,13 +1,13 @@ title 'Test case 1 for exceptions in the file resource' -control 'c01 using file resource on nonexistant file with no property access' do +control 'c01 using file resource on nonexistent file with no property access' do f = file('/i/do/not/exist') describe 'Test block' do it { should include 'Test'} end end -control 'c02 using file resource on nonexistant file with contents access in test block' do +control 'c02 using file resource on nonexistent file with contents access in test block' do f = file('/i/do/not/exist') describe 'Test block' do subject { f.content } @@ -15,7 +15,7 @@ control 'c02 using file resource on nonexistant file with contents access in tes end end -control 'c03 using file resource on nonexistant file with contents access control block' do +control 'c03 using file resource on nonexistent file with contents access control block' do f = file('/i/do/not/exist') c = f.content describe 'Test block' do diff --git a/test/fixtures/profiles/exception-in-control/controls/02-sshd_config.rb b/test/fixtures/profiles/exception-in-control/controls/02-sshd_config.rb index 5e0660215..34fdd64ff 100644 --- a/test/fixtures/profiles/exception-in-control/controls/02-sshd_config.rb +++ b/test/fixtures/profiles/exception-in-control/controls/02-sshd_config.rb @@ -1,6 +1,6 @@ title 'Test case 2 for exceptions in the sshd_config resource' -control 'sshd01 using sshd_config resource nonexistant path with no property access' do +control 'sshd01 using sshd_config resource nonexistent path with no property access' do s = sshd_config('/i/do/not/exist') describe 'Test block' do it { should include 'Test'} @@ -8,7 +8,7 @@ control 'sshd01 using sshd_config resource nonexistant path with no property acc end # sshd02 throws exception but is caught and fails the resource -control 'sshd02 sshd_config resource nonexistant path with contents access in test block' do +control 'sshd02 sshd_config resource nonexistent path with contents access in test block' do s = sshd_config('/i/do/not/exist') describe 'Test block' do subject { s } @@ -35,7 +35,7 @@ end # sshd05 throws exception which is not caught, and aborts inspec with stacktrace # Defective on 2.1.54 -control 'sshd05 sshd_config resource nonexistant path with contents access control block' do +control 'sshd05 sshd_config resource nonexistent path with contents access control block' do s = sshd_config('/i/do/not/exist') # Next line triggers compile-time exception c = s.Protocol diff --git a/test/functional/inspec_exec_test.rb b/test/functional/inspec_exec_test.rb index b64fac272..42d7a9654 100644 --- a/test/functional/inspec_exec_test.rb +++ b/test/functional/inspec_exec_test.rb @@ -916,7 +916,7 @@ Test Summary: 2 successful, 0 failures, 0 skipped\n" end end - describe "when --config points to a nonexistant location" do + describe "when --config points to a nonexistent location" do let(:cli_args) { "--config " + "no/such/path" } it "should issue an error with the file path" do _(stderr).wont_match looks_like_a_stacktrace diff --git a/test/integration/aws/default/verify/controls/aws_cloudtrail_trail.rb b/test/integration/aws/default/verify/controls/aws_cloudtrail_trail.rb index e3e46e410..2394d428b 100644 --- a/test/integration/aws/default/verify/controls/aws_cloudtrail_trail.rb +++ b/test/integration/aws/default/verify/controls/aws_cloudtrail_trail.rb @@ -26,7 +26,7 @@ control "aws_cloudtrail_trail recall" do it { should exist } end - describe aws_cloudtrail_trail('non-existant-trail') do + describe aws_cloudtrail_trail('non-existent-trail') do it { should_not exist } end end diff --git a/test/integration/aws/default/verify/controls/aws_kms_key.rb b/test/integration/aws/default/verify/controls/aws_kms_key.rb index d08434664..936aab44a 100644 --- a/test/integration/aws/default/verify/controls/aws_kms_key.rb +++ b/test/integration/aws/default/verify/controls/aws_kms_key.rb @@ -19,7 +19,7 @@ control "aws_kms_key recall" do describe aws_kms_key(key_id: fixtures['kms_key_enabled_key_id']) do it { should exist } end - describe aws_kms_key('non-existant-key') do + describe aws_kms_key('non-existent-key') do it { should_not exist } end end diff --git a/test/kitchen/policies/default/controls/user_spec.rb b/test/kitchen/policies/default/controls/user_spec.rb index 99d454f46..15ab67477 100644 --- a/test/kitchen/policies/default/controls/user_spec.rb +++ b/test/kitchen/policies/default/controls/user_spec.rb @@ -146,7 +146,7 @@ describe users.where(username: userinfo[:username]) do end end -# catch case where user is not existant +# catch case where user is not existent describe user('not_available') do it { should_not exist } its ('uid') { should eq nil} diff --git a/test/kitchen/policies/find_files/libraries/find_files.rb b/test/kitchen/policies/find_files/libraries/find_files.rb index c69adc7ed..353c17e3b 100644 --- a/test/kitchen/policies/find_files/libraries/find_files.rb +++ b/test/kitchen/policies/find_files/libraries/find_files.rb @@ -3,7 +3,7 @@ class TestFindFiles < Inspec.resource(1) name "test_find_files" desc " - Resource used for testing the funcitonality of Utils::FindFiles + Resource used for testing the functionality of Utils::FindFiles " example " diff --git a/test/unit/plugin/v2/api_input_test.rb b/test/unit/plugin/v2/api_input_test.rb index 24d4a2abb..3128d9f9d 100644 --- a/test/unit/plugin/v2/api_input_test.rb +++ b/test/unit/plugin/v2/api_input_test.rb @@ -4,7 +4,7 @@ require "inspec/plugin/v2" describe "Input plugin type" do describe "when registering the plugin type superclass" do - it "returns the superclass when calling the global defintion method" do + it "returns the superclass when calling the global definition method" do klass = Inspec.plugin(2, :input) _(klass).must_be_kind_of Class _(klass).must_equal Inspec::Plugin::V2::PluginType::Input diff --git a/test/unit/plugin/v2/installer_test.rb b/test/unit/plugin/v2/installer_test.rb index 8f110a928..3db13b6fa 100644 --- a/test/unit/plugin/v2/installer_test.rb +++ b/test/unit/plugin/v2/installer_test.rb @@ -155,7 +155,7 @@ class PluginInstallerInstallationTests < Minitest::Test def test_install_a_gem_from_missing_local_file gem_file = File.join(@plugin_fixture_pkg_path, "inspec-test-fixture-nonesuch-0.0.0.gem") - refute File.exist?(gem_file), "The nonexistant gem should not exist prior to install attempt" + refute File.exist?(gem_file), "The non-existent gem should not exist prior to install attempt" ex = assert_raises(Inspec::Plugin::V2::InstallError) { @installer.install("inspec-test-fixture-nonesuch", gem_file: gem_file) } assert_includes ex.message, "Could not find local gem file" end @@ -396,7 +396,7 @@ end class PluginInstallerUninstallTests < Minitest::Test include InstallerTestHelpers - def test_uninstalling_a_nonexistant_plugin_is_an_error + def test_uninstalling_a_nonexistent_plugin_is_an_error # Try a mythical one ex = assert_raises(Inspec::Plugin::V2::UnInstallError) do @installer.uninstall("inspec-test-fixture-nonesuch") diff --git a/test/unit/resources/aws_cloudtrail_trail_test.rb b/test/unit/resources/aws_cloudtrail_trail_test.rb index 207c42a83..65f49f715 100644 --- a/test/unit/resources/aws_cloudtrail_trail_test.rb +++ b/test/unit/resources/aws_cloudtrail_trail_test.rb @@ -51,7 +51,7 @@ class AwsCloudTrailTrailRecallTest < Minitest::Test end def test_search_miss_is_not_an_exception - refute AwsCloudTrailTrail.new(trail_name: "non-existant").exists? + refute AwsCloudTrailTrail.new(trail_name: "non-existent").exists? end end @@ -66,37 +66,37 @@ class AwsCloudTrailTrailPropertiesTest < Minitest::Test def test_property_s3_bucket_name assert_equal("aws-s3-bucket-test-trail-1", AwsCloudTrailTrail.new("test-trail-1").s3_bucket_name) - assert_nil(AwsCloudTrailTrail.new(trail_name: "non-existant").s3_bucket_name) + assert_nil(AwsCloudTrailTrail.new(trail_name: "non-existent").s3_bucket_name) end def test_property_trail_arn assert_equal("arn:aws:cloudtrail:us-east-1::trail/test-trail-1", AwsCloudTrailTrail.new("test-trail-1").trail_arn) - assert_nil(AwsCloudTrailTrail.new(trail_name: "non-existant").trail_arn) + assert_nil(AwsCloudTrailTrail.new(trail_name: "non-existent").trail_arn) end def test_property_cloud_watch_logs_role_arn assert_equal("arn:aws:iam:::role/CloudTrail_CloudWatchLogs_Role", AwsCloudTrailTrail.new("test-trail-1").cloud_watch_logs_role_arn) - assert_nil(AwsCloudTrailTrail.new(trail_name: "non-existant").cloud_watch_logs_role_arn) + assert_nil(AwsCloudTrailTrail.new(trail_name: "non-existent").cloud_watch_logs_role_arn) end def test_property_cloud_watch_logs_log_group_arn assert_equal("arn:aws:logs:us-east-1::log-group:test:*", AwsCloudTrailTrail.new("test-trail-1").cloud_watch_logs_log_group_arn) - assert_nil(AwsCloudTrailTrail.new(trail_name: "non-existant").cloud_watch_logs_log_group_arn) + assert_nil(AwsCloudTrailTrail.new(trail_name: "non-existent").cloud_watch_logs_log_group_arn) end def test_property_kms_key_id assert_equal("arn:aws:kms:us-east-1::key/88197884-041f-4f8e-a801-cf120e4845a8", AwsCloudTrailTrail.new("test-trail-1").kms_key_id) - assert_nil(AwsCloudTrailTrail.new(trail_name: "non-existant").kms_key_id) + assert_nil(AwsCloudTrailTrail.new(trail_name: "non-existent").kms_key_id) end def test_property_home_region assert_equal("us-east-1", AwsCloudTrailTrail.new("test-trail-1").home_region) - assert_nil(AwsCloudTrailTrail.new(trail_name: "non-existant").home_region) + assert_nil(AwsCloudTrailTrail.new(trail_name: "non-existent").home_region) end def test_property_delivered_logs_days_ago assert_equal(0, AwsCloudTrailTrail.new("test-trail-1").delivered_logs_days_ago) - assert_nil(AwsCloudTrailTrail.new(trail_name: "non-existant").delivered_logs_days_ago) + assert_nil(AwsCloudTrailTrail.new(trail_name: "non-existent").delivered_logs_days_ago) end end diff --git a/test/unit/resources/aws_iam_policy_test.rb b/test/unit/resources/aws_iam_policy_test.rb index fa507f80d..622c6bfcb 100644 --- a/test/unit/resources/aws_iam_policy_test.rb +++ b/test/unit/resources/aws_iam_policy_test.rb @@ -51,7 +51,7 @@ class AwsIamPolicyRecallTest < Minitest::Test end def test_search_miss_is_not_an_exception - refute AwsIamPolicy.new(policy_name: "non-existant").exists? + refute AwsIamPolicy.new(policy_name: "non-existent").exists? end end @@ -66,32 +66,32 @@ class AwsIamPolicyPropertiesTest < Minitest::Test def test_property_arn assert_equal("arn:aws:iam::aws:policy/test-policy-1", AwsIamPolicy.new("test-policy-1").arn) - assert_nil(AwsIamPolicy.new(policy_name: "non-existant").arn) + assert_nil(AwsIamPolicy.new(policy_name: "non-existent").arn) end def test_property_default_version_id assert_equal("v1", AwsIamPolicy.new("test-policy-1").default_version_id) - assert_nil(AwsIamPolicy.new(policy_name: "non-existant").default_version_id) + assert_nil(AwsIamPolicy.new(policy_name: "non-existent").default_version_id) end def test_property_attachment_count assert_equal(3, AwsIamPolicy.new("test-policy-1").attachment_count) - assert_nil(AwsIamPolicy.new(policy_name: "non-existant").attachment_count) + assert_nil(AwsIamPolicy.new(policy_name: "non-existent").attachment_count) end def test_property_attached_users assert_equal(["test-user"], AwsIamPolicy.new("test-policy-1").attached_users) - assert_nil(AwsIamPolicy.new(policy_name: "non-existant").attached_users) + assert_nil(AwsIamPolicy.new(policy_name: "non-existent").attached_users) end def test_property_attached_groups assert_equal(["test-group"], AwsIamPolicy.new("test-policy-1").attached_groups) - assert_nil(AwsIamPolicy.new(policy_name: "non-existant").attached_groups) + assert_nil(AwsIamPolicy.new(policy_name: "non-existent").attached_groups) end def test_property_attached_roles assert_equal(["test-role"], AwsIamPolicy.new("test-policy-1").attached_roles) - assert_nil(AwsIamPolicy.new(policy_name: "non-existant").attached_roles) + assert_nil(AwsIamPolicy.new(policy_name: "non-existent").attached_roles) end def test_property_policy @@ -99,11 +99,11 @@ class AwsIamPolicyPropertiesTest < Minitest::Test assert_kind_of(Hash, policy) assert(policy.key?("Statement"), "test-policy-1 should have a Statement key when unpacked") assert_equal(1, policy["Statement"].count, "test-policy-1 should have 1 statements when unpacked") - assert_nil(AwsIamPolicy.new("non-existant").policy) + assert_nil(AwsIamPolicy.new("non-existent").policy) end def test_property_statement_count - assert_nil(AwsIamPolicy.new("non-existant").statement_count) + assert_nil(AwsIamPolicy.new("non-existent").statement_count) assert_equal(1, AwsIamPolicy.new("test-policy-1").statement_count) assert_equal(2, AwsIamPolicy.new("test-policy-2").statement_count) assert_equal(1, AwsIamPolicy.new("test-policy-3").statement_count) diff --git a/test/unit/resources/aws_kms_key_test.rb b/test/unit/resources/aws_kms_key_test.rb index 6365504a8..131589f1d 100644 --- a/test/unit/resources/aws_kms_key_test.rb +++ b/test/unit/resources/aws_kms_key_test.rb @@ -52,7 +52,7 @@ class AwsKmsKeyRecallTest < Minitest::Test end def test_search_miss_is_not_an_exception - refute AwsKmsKey.new(key_id: "non-existant").exists? + refute AwsKmsKey.new(key_id: "non-existent").exists? end end @@ -71,42 +71,42 @@ class AwsKmsKeyPropertiesTest < Minitest::Test def test_property_arn assert_equal("arn:aws:kms:us-east-1::key/7a6950aa-c8e6-4e51-8afc-111111111111", AwsKmsKey.new("arn:aws:kms:us-east-1::key/7a6950aa-c8e6-4e51-8afc-111111111111").arn) - assert_nil(AwsKmsKey.new(key_id: "non-existant").arn) + assert_nil(AwsKmsKey.new(key_id: "non-existent").arn) end def test_property_creation_date assert_equal(TIME_NOW - 10 * 24 * 3600, AwsKmsKey.new("arn:aws:kms:us-east-1::key/7a6950aa-c8e6-4e51-8afc-111111111111").creation_date) - assert_nil(AwsKmsKey.new(key_id: "non-existant").creation_date) + assert_nil(AwsKmsKey.new(key_id: "non-existent").creation_date) end def test_property_key_usage assert_equal("ENCRYPT_DECRYPT", AwsKmsKey.new("arn:aws:kms:us-east-1::key/7a6950aa-c8e6-4e51-8afc-111111111111").key_usage) - assert_nil(AwsKmsKey.new(key_id: "non-existant").key_usage) + assert_nil(AwsKmsKey.new(key_id: "non-existent").key_usage) end def test_property_key_state assert_equal("Enabled", AwsKmsKey.new("arn:aws:kms:us-east-1::key/7a6950aa-c8e6-4e51-8afc-111111111111").key_state) - assert_nil(AwsKmsKey.new(key_id: "non-existant").key_state) + assert_nil(AwsKmsKey.new(key_id: "non-existent").key_state) end def test_property_description assert_equal("test-key-1-desc", AwsKmsKey.new("arn:aws:kms:us-east-1::key/7a6950aa-c8e6-4e51-8afc-111111111111").description) - assert_nil(AwsKmsKey.new(key_id: "non-existant").description) + assert_nil(AwsKmsKey.new(key_id: "non-existent").description) end def test_property_deletion_time assert_equal(TIME_NOW + 10 * 24 * 3600, AwsKmsKey.new("arn:aws:kms:us-east-1::key/7a6950aa-c8e6-4e51-8afc-111111111111").deletion_time) - assert_nil(AwsKmsKey.new(key_id: "non-existant").deletion_time) + assert_nil(AwsKmsKey.new(key_id: "non-existent").deletion_time) end def test_property_invalidation_time assert_nil(AwsKmsKey.new("arn:aws:kms:us-east-1::key/7a6950aa-c8e6-4e51-8afc-111111111111").invalidation_time) - assert_nil(AwsKmsKey.new(key_id: "non-existant").invalidation_time) + assert_nil(AwsKmsKey.new(key_id: "non-existent").invalidation_time) end def test_property_created_days_ago assert_equal(10, AwsKmsKey.new("arn:aws:kms:us-east-1::key/7a6950aa-c8e6-4e51-8afc-111111111111").created_days_ago) - assert_nil(AwsKmsKey.new(key_id: "non-existant").created_days_ago) + assert_nil(AwsKmsKey.new(key_id: "non-existent").created_days_ago) end end diff --git a/test/unit/resources/command_test.rb b/test/unit/resources/command_test.rb index 822867d22..97ae0cf0d 100644 --- a/test/unit/resources/command_test.rb +++ b/test/unit/resources/command_test.rb @@ -40,13 +40,13 @@ describe Inspec::Resources::Cmd do _(result.resource_exception_message).must_match(/must be a regular expression/) end - it "redacts output if `redact_regex` is passed with caputure groups" do + it "redacts output if `redact_regex` is passed with capture groups" do cmd = "command_with_password -p supersecret -d no_redact" expected_to_s = "Command: `command_with_password -p REDACTED -d no_redact`" _(resource(cmd, redact_regex: /(-p ).*( -d)/).to_s).must_equal(expected_to_s) end - it "redacts output if `redact_regex` is passed without a caputure group" do + it "redacts output if `redact_regex` is passed without a capture group" do cmd = "command_with_password -p supersecret -d no_redact" expected_to_s = "Command: `command_with_password REDACTED no_redact`" _(resource(cmd, redact_regex: /-p .* -d/).to_s).must_equal(expected_to_s) diff --git a/test/unit/resources/etc_hosts_allow_deny_test.rb b/test/unit/resources/etc_hosts_allow_deny_test.rb index c603c444f..6f78c4c68 100644 --- a/test/unit/resources/etc_hosts_allow_deny_test.rb +++ b/test/unit/resources/etc_hosts_allow_deny_test.rb @@ -53,7 +53,7 @@ describe "Inspec::Resources::EtcHostsAllow" do end describe "Inspec::Resources::EtcHostsDeny" do - describe "EtcHostsDeny Paramaters" do + describe "EtcHostsDeny Parameters" do resource = load_resource("etc_hosts_deny") it "Verify etc_hosts_deny filtering by `daemon`" do entries = resource.where { daemon == "ALL" } diff --git a/test/unit/resources/json_test.rb b/test/unit/resources/json_test.rb index 86306f85a..10b0ad63d 100644 --- a/test/unit/resources/json_test.rb +++ b/test/unit/resources/json_test.rb @@ -22,11 +22,11 @@ describe "Inspec::Resources::JSON" do _(resource.send("run_list")).must_equal %w{a b} end - it "doesnt resolve dot-notation names" do + it "doesn't resolve dot-notation names" do _(resource.send("x.y.z")).must_be_nil end - it "doesnt resolve symbol-notation names" do + it "doesn't resolve symbol-notation names" do _(resource.send(:'x.y.z')).must_be_nil end diff --git a/test/unit/resources/port_test.rb b/test/unit/resources/port_test.rb index 72d4431a7..a0614ff6f 100644 --- a/test/unit/resources/port_test.rb +++ b/test/unit/resources/port_test.rb @@ -129,7 +129,7 @@ describe "Inspec::Resources::Port" do _(resource.protocols("udp").entries.length).must_equal 15 end - it "verify port on Windows 2008 (unpriviledged)" do + it "verify port on Windows 2008 (unprivileged)" do ml = MockLoader.new(:windows) # kill windows 2012 shell commands ml.backend.backend.commands @@ -144,7 +144,7 @@ describe "Inspec::Resources::Port" do _(resource.addresses).must_equal %w{0.0.0.0 ::} end - it "verify port list on Windows 2008 (unpriviledged)" do + it "verify port list on Windows 2008 (unprivileged)" do ml = MockLoader.new(:windows) # kill windows 2012 shell commands ml.backend.backend.commands diff --git a/test/unit/resources/postgres_hba_conf_test.rb b/test/unit/resources/postgres_hba_conf_test.rb index 6bc9ebc52..c23918263 100644 --- a/test/unit/resources/postgres_hba_conf_test.rb +++ b/test/unit/resources/postgres_hba_conf_test.rb @@ -5,7 +5,7 @@ require "inspec/resource" require "inspec/resources/postgres_hba_conf" describe "Inspec::Resources::PGHbaConf" do - describe "PGHbaConf Paramaters" do + describe "PGHbaConf Parameters" do resource = load_resource("postgres_hba_conf", "/test/path/to/postgres/pg_hba.conf") it "Verify postgres_hba_conf filtering by `type`" do diff --git a/test/unit/resources/x509_certificate_test.rb b/test/unit/resources/x509_certificate_test.rb index 945c1b6eb..1b9ab3f25 100644 --- a/test/unit/resources/x509_certificate_test.rb +++ b/test/unit/resources/x509_certificate_test.rb @@ -25,7 +25,7 @@ describe "Inspec::Resources::X509Certificate" do end # TODO: Regenerate certificate using `InSpec` not `Inspec` - it "verify subject distingushed name" do + it "verify subject distinguished name" do _(resource_cert.send("subject_dn")).must_match "Inspec Test Certificate" end @@ -40,7 +40,7 @@ describe "Inspec::Resources::X509Certificate" do end # TODO: Regenerate certificate using `InSpec` not `Inspec` - it "verify issue distingushed name" do + it "verify issue distinguished name" do _(resource_cert.send("issuer_dn")).must_match "Inspec Test CA" end diff --git a/test/unit/runner_test.rb b/test/unit/runner_test.rb index 5023cb284..d3046a2d2 100644 --- a/test/unit/runner_test.rb +++ b/test/unit/runner_test.rb @@ -59,7 +59,7 @@ describe Inspec::Runner do _(config["reporter"]).must_equal expected end - it "delets format if set to a rspec format" do + it "deletes format if set to a rspec format" do opts = { command_runner: :generic, backend_cache: true, "reporter" => ["progress"] } runner = Inspec::Runner.new(opts) config = runner.instance_variable_get(:"@conf") diff --git a/test/unit/utils/nginx_parser_test.rb b/test/unit/utils/nginx_parser_test.rb index 8adb3264c..595ca917a 100644 --- a/test/unit/utils/nginx_parser_test.rb +++ b/test/unit/utils/nginx_parser_test.rb @@ -38,25 +38,25 @@ describe NginxParser do _(result[0][:assignment][:args][0][:value]).must_equal "/a/b/c/*.conf" end - it "parses an assignemnt with single quote in a double quoted value" do + it "parses an assignment with single quote in a double quoted value" do result = parse('include "/a/\'b/*.conf";') _(result[0][:assignment][:identifier]).must_equal "include" _(result[0][:assignment][:args][0][:value]).must_equal "/a/'b/*.conf" end - it "parses an assignemnt with double quote in a single quoted value" do + it "parses an assignment with double quote in a single quoted value" do result = parse("include '/a/\"b/*.conf';") _(result[0][:assignment][:identifier]).must_equal "include" _(result[0][:assignment][:args][0][:value]).must_equal "/a/\"b/*.conf" end - it "parses an assignemnt with single quote in a single quoted value" do + it "parses an assignment with single quote in a single quoted value" do result = parse("include '/a/\\\'b/*.conf';") _(result[0][:assignment][:identifier]).must_equal "include" _(result[0][:assignment][:args][0][:value]).must_equal "/a/\\\'b/*.conf" end - it "parses an assignemnt with double quote in a double quoted value" do + it "parses an assignment with double quote in a double quoted value" do result = parse('include "/a/\"b/*.conf";') _(result[0][:assignment][:identifier]).must_equal "include" _(result[0][:assignment][:args][0][:value]).must_equal '/a/\"b/*.conf'