diff --git a/src/spectator.cr b/src/spectator.cr index e4613c2..a05a7e2 100644 --- a/src/spectator.cr +++ b/src/spectator.cr @@ -48,7 +48,7 @@ module Spectator # Provides a means to configure how Spectator will run and report tests. # A `ConfigBuilder` is yielded to allow changing the configuration. - # NOTE: The configuration set here can be overriden + # NOTE: The configuration set here can be overridden # with a `.spectator` file and command-line arguments. def configure(& : Config::Builder -> _) : Nil yield @@config_builder @@ -56,7 +56,7 @@ module Spectator # Random number generator for the test suite. # All randomly generated values should be pulled from this. - # This provides reproducable results even though random values are used. + # This provides re-producible results even though random values are used. # The seed for this random generator is controlled by `ConfigBuilder.seed=`. def random config.random diff --git a/src/spectator/abstract_expression.cr b/src/spectator/abstract_expression.cr index 7985c16..b58c1cc 100644 --- a/src/spectator/abstract_expression.cr +++ b/src/spectator/abstract_expression.cr @@ -8,7 +8,7 @@ module Spectator # or nil if one isn't available. # # This base class is provided so that all generic sub-classes can be stored as this one type. - # The value of the expression can be retrieved by downcasting to the expected type with `#cast`. + # The value of the expression can be retrieved by down-casting to the expected type with `#cast`. # # NOTE: This is intentionally a class and not a struct. # If it were a struct, changes made to the value held by an instance may not be kept when passing it around. diff --git a/src/spectator/block.cr b/src/spectator/block.cr index 215d098..3e861ff 100644 --- a/src/spectator/block.cr +++ b/src/spectator/block.cr @@ -4,7 +4,7 @@ require "./label" module Spectator # Represents a block from a test. # This is typically captured by an `expect` macro. - # It consists of a label and parameterless block. + # It consists of a label and parameter-less block. # The label should be a string recognizable by the user, # or nil if one isn't available. class Block(T) < Expression(T) diff --git a/src/spectator/dsl.cr b/src/spectator/dsl.cr index 51d6f38..95c4121 100644 --- a/src/spectator/dsl.cr +++ b/src/spectator/dsl.cr @@ -3,7 +3,7 @@ require "./dsl/*" module Spectator # Namespace containing methods representing the spec domain specific language. # - # Note: Documentation inside macros is kept to a minimuum to reduce generated code. + # Note: Documentation inside macros is kept to a minimum to reduce generated code. # This also helps keep error traces small. # Documentation only useful for debugging is included in generated code. module DSL diff --git a/src/spectator/dsl/builder.cr b/src/spectator/dsl/builder.cr index 38ad7fe..ed1c6a4 100644 --- a/src/spectator/dsl/builder.cr +++ b/src/spectator/dsl/builder.cr @@ -31,7 +31,7 @@ module Spectator::DSL end # Completes a previously defined example group and pops it off the group stack. - # Be sure to call `#start_group` and `#end_group` symmetically. + # Be sure to call `#start_group` and `#end_group` symmetrically. # # See `Spec::Builder#end_group` for usage details. def end_group(*args) diff --git a/src/spectator/dsl/concise.cr b/src/spectator/dsl/concise.cr index a7222ae..d9f4094 100644 --- a/src/spectator/dsl/concise.cr +++ b/src/spectator/dsl/concise.cr @@ -7,7 +7,7 @@ module Spectator::DSL module Concise # Defines an example and input values in a shorter syntax. # The only arguments given to this macro are one or more assignments. - # The names in the assigments will be available in the example code. + # The names in the assignments will be available in the example code. # # If the code block is omitted, then the example is skipped (marked as not implemented). # diff --git a/src/spectator/dsl/matchers.cr b/src/spectator/dsl/matchers.cr index 34adf26..862afc7 100644 --- a/src/spectator/dsl/matchers.cr +++ b/src/spectator/dsl/matchers.cr @@ -239,7 +239,7 @@ module Spectator::DSL # expect("foo").to match(/foo|bar/) # expect("BAR").to match(/foo|bar/i) # expect(1 + 2).to match(3) - # expect(5).to match(Int32) # Using `#be_a` instead is recommened here. + # expect(5).to match(Int32) # Using `#be_a` instead is recommended here. # expect({:foo, 5}).to match({Symbol, Int32}) # ``` macro match(expected) @@ -368,7 +368,7 @@ module Spectator::DSL # expect(pi).to be_close(3.14159265359, 0.0000001) # ``` # - # This is functionly equivalent to: + # This is functionally equivalent to: # ``` # be_within(expected).of(delta) # ``` @@ -400,7 +400,7 @@ module Spectator::DSL # Indicates that some value or set should start with another value. # This is typically used on a `String` or `Array` (any `Enumerable` works). # The *expected* argument can be a `String`, `Char`, or `Regex` - # when the actual type (being comapred against) is a `String`. + # when the actual type (being compared against) is a `String`. # For `Enumerable` types, only the first item is inspected. # It is compared with the === operator, # so that values, types, regular expressions, and others can be tested. @@ -423,7 +423,7 @@ module Spectator::DSL # Indicates that some value or set should end with another value. # This is typically used on a `String` or `Array` (any `Indexable` works). # The *expected* argument can be a `String`, `Char`, or `Regex` - # when the actual type (being comapred against) is a `String`. + # when the actual type (being compared against) is a `String`. # For `Indexable` types, only the last item is inspected. # It is compared with the === operator, # so that values, types, regular expressions, and others can be tested. @@ -446,8 +446,8 @@ module Spectator::DSL # Indicates that some value or set should contain another value. # This is typically used on a `String` or `Array` (any `Enumerable` works). # The *expected* argument can be a `String` or `Char` - # when the actual type (being comapred against) is a `String`. - # For `Enumerable` types, items are compared using the underying implementation. + # when the actual type (being compared against) is a `String`. + # For `Enumerable` types, items are compared using the underlying implementation. # In both cases, the `includes?` method is used. # # Examples: @@ -475,8 +475,8 @@ module Spectator::DSL # Indicates that some value or set should contain specific items. # This is typically used on a `String` or `Array` (any `Enumerable` works). # The *expected* argument can be a `String` or `Char` - # when the actual type (being comapred against) is a `String`. - # For `Enumerable` types, items are compared using the underying implementation. + # when the actual type (being compared against) is a `String`. + # For `Enumerable` types, items are compared using the underlying implementation. # In both cases, the `includes?` method is used. # # This is identical to `#contain`, but accepts an array (or enumerable type) instead of multiple arguments. @@ -522,7 +522,7 @@ module Spectator::DSL # This is similar to `#contain`, but uses a different method for matching. # Typically a `String` or `Array` (any `Enumerable` works) is checked against. # The *expected* argument can be a `String` or `Char` - # when the actual type (being comapred against) is a `String`. + # when the actual type (being compared against) is a `String`. # The `includes?` method is used for this case. # For `Enumerable` types, each item is inspected until one matches. # The === operator is used for this case, which allows for equality, type, regex, and other matches. @@ -557,7 +557,7 @@ module Spectator::DSL # This is similar to `#contain_elements`, but uses a different method for matching. # Typically a `String` or `Array` (any `Enumerable` works) is checked against. # The *expected* argument can be a `String` or `Char` - # when the actual type (being comapred against) is a `String`. + # when the actual type (being compared against) is a `String`. # The `includes?` method is used for this case. # For `Enumerable` types, each item is inspected until one matches. # The === operator is used for this case, which allows for equality, type, regex, and other matches. diff --git a/src/spectator/expectation.cr b/src/spectator/expectation.cr index cacde95..848630d 100644 --- a/src/spectator/expectation.cr +++ b/src/spectator/expectation.cr @@ -8,7 +8,7 @@ module Spectator # such as whether it was successful and a description of the operation. struct Expectation # Location of the expectation in source code. - # This can be nil if the location isn't capturable, + # This can be nil if the location can't be captured, # for instance using the *should* syntax or dynamically created expectations. getter! location : Location diff --git a/src/spectator/formatting/document_formatter.cr b/src/spectator/formatting/document_formatter.cr index fe6c1ce..882e618 100644 --- a/src/spectator/formatting/document_formatter.cr +++ b/src/spectator/formatting/document_formatter.cr @@ -9,7 +9,7 @@ module Spectator::Formatting class DocumentFormatter < Formatter include Summary - # Identation string. + # Indentation string. private INDENT = " " # String used for groups and examples that don't have a name. diff --git a/src/spectator/formatting/formatter.cr b/src/spectator/formatting/formatter.cr index 7c46e54..d1e6956 100644 --- a/src/spectator/formatting/formatter.cr +++ b/src/spectator/formatting/formatter.cr @@ -66,7 +66,7 @@ module Spectator::Formatting # The *notification* will be an `ExampleNotification` type of object. # # NOTE: Errors are normally considered failures, - # however `#example_error` is called instead if one occurs in an exmaple. + # however `#example_error` is called instead if one occurs in an example. def example_failed(_notification) end diff --git a/src/spectator/harness.cr b/src/spectator/harness.cr index 3e0962b..37c27f3 100644 --- a/src/spectator/harness.cr +++ b/src/spectator/harness.cr @@ -52,7 +52,7 @@ module Spectator end end - # Instanciates a new harness and yields it. + # Instantiates a new harness and yields it. # The `.current` harness is set to the new harness for the duration of the block. # `.current` is reset to the previous value (probably nil) afterwards, even if the block raises. # The result of the block is returned. diff --git a/src/spectator/label.cr b/src/spectator/label.cr index 2a86b34..9a09f26 100644 --- a/src/spectator/label.cr +++ b/src/spectator/label.cr @@ -1,6 +1,6 @@ module Spectator # Identifier used in the spec. - # Signficant to the user. + # Significant to the user. # When a label is a symbol, then it is referencing a type or method. # A label is nil when one can't be provided or captured. alias Label = String | Symbol | Nil diff --git a/src/spectator/matchers.cr b/src/spectator/matchers.cr index 96ee7f2..76f9035 100644 --- a/src/spectator/matchers.cr +++ b/src/spectator/matchers.cr @@ -2,7 +2,7 @@ require "./matchers/*" module Spectator # Evaluates conditions on values and objects - # to determine whether they satisify test criteria. + # to determine whether they satisfy test criteria. module Matchers end end diff --git a/src/spectator/matchers/array_matcher.cr b/src/spectator/matchers/array_matcher.cr index 6adf442..eea9353 100644 --- a/src/spectator/matchers/array_matcher.cr +++ b/src/spectator/matchers/array_matcher.cr @@ -83,7 +83,7 @@ module Spectator::Matchers # The first array is the missing elements (present in expected, missing in actual). # The second array array is the extra elements (not present in expected, present in actual). private def compare_arrays(expected_elements, actual_elements) - # Produce hashes where the array elements are the keys, and the values are the number of occurances. + # Produce hashes where the array elements are the keys, and the values are the number of occurrences. expected_hash = expected_elements.group_by(&.itself).map { |k, v| {k, v.size} }.to_h actual_hash = actual_elements.group_by(&.itself).map { |k, v| {k, v.size} }.to_h @@ -96,11 +96,11 @@ module Spectator::Matchers # Expects two hashes, with values as counts for keys. # Produces an array of differences with elements repeated if needed. private def hash_count_difference(first, second) - # Subtract the number of occurances from the other array. + # Subtract the number of occurrences from the other array. # A duplicate hash is used here because the original can't be modified, # since it there's a two-way comparison. # - # Then reject elements that have zero (or less) occurances. + # Then reject elements that have zero (or less) occurrences. # Lastly, expand to the correct number of elements. first.map do |element, count| if second_count = second[element]? diff --git a/src/spectator/matchers/attributes_matcher.cr b/src/spectator/matchers/attributes_matcher.cr index 0ecda5f..8ecd714 100644 --- a/src/spectator/matchers/attributes_matcher.cr +++ b/src/spectator/matchers/attributes_matcher.cr @@ -67,7 +67,7 @@ module Spectator::Matchers {% end %} end - # Checks if all attributes from the snapshot of them are satisified. + # Checks if all attributes from the snapshot of them are satisfied. private def match?(snapshot) # Test that every attribute has the expected value. {% for attribute in ExpectedType.keys %} diff --git a/src/spectator/matchers/case_matcher.cr b/src/spectator/matchers/case_matcher.cr index 00618be..7c59a54 100644 --- a/src/spectator/matchers/case_matcher.cr +++ b/src/spectator/matchers/case_matcher.cr @@ -11,7 +11,7 @@ module Spectator::Matchers "matches #{expected.label}" end - # Checks whether the matcher is satisifed with the expression given to it. + # Checks whether the matcher is satisfied with the expression given to it. private def match?(actual : Expression(T)) : Bool forall T expected.value === actual.value end @@ -22,7 +22,7 @@ module Spectator::Matchers actual.value === expected.value end - # Message displayed when the matcher isn't satisifed. + # Message displayed when the matcher isn't satisfied. # # This is only called when `#match?` returns false. # @@ -32,7 +32,7 @@ module Spectator::Matchers "#{actual.label} does not match #{expected.label}" end - # Message displayed when the matcher isn't satisifed and is negated. + # Message displayed when the matcher isn't satisfied and is negated. # This is essentially what would satisfy the matcher if it wasn't negated. # # This is only called when `#does_not_match?` returns false. diff --git a/src/spectator/matchers/collection_matcher.cr b/src/spectator/matchers/collection_matcher.cr index 277c5c3..2b7c028 100644 --- a/src/spectator/matchers/collection_matcher.cr +++ b/src/spectator/matchers/collection_matcher.cr @@ -12,12 +12,12 @@ module Spectator::Matchers "is in #{expected.label}" end - # Checks whether the matcher is satisifed with the expression given to it. + # Checks whether the matcher is satisfied with the expression given to it. private def match?(actual : Expression(T)) : Bool forall T expected.value.includes?(actual.value) end - # Message displayed when the matcher isn't satisifed. + # Message displayed when the matcher isn't satisfied. # # This is only called when `#match?` returns false. # @@ -27,7 +27,7 @@ module Spectator::Matchers "#{actual.label} is not in #{expected.label}" end - # Message displayed when the matcher isn't satisifed and is negated. + # Message displayed when the matcher isn't satisfied and is negated. # This is essentially what would satisfy the matcher if it wasn't negated. # # This is only called when `#does_not_match?` returns false. diff --git a/src/spectator/matchers/compiled_type_matcher.cr b/src/spectator/matchers/compiled_type_matcher.cr index 2b60e3b..d185aff 100644 --- a/src/spectator/matchers/compiled_type_matcher.cr +++ b/src/spectator/matchers/compiled_type_matcher.cr @@ -12,12 +12,12 @@ module Spectator::Matchers "compiles as #{Expected}" end - # Checks whether the matcher is satisifed with the expression given to it. + # Checks whether the matcher is satisfied with the expression given to it. private def match?(actual : Expression(T)) : Bool forall T Expected == typeof(actual.value) end - # Message displayed when the matcher isn't satisifed. + # Message displayed when the matcher isn't satisfied. # # This is only called when `#match?` returns false. # @@ -27,7 +27,7 @@ module Spectator::Matchers "#{actual.label} does not compile as #{Expected}" end - # Message displayed when the matcher isn't satisifed and is negated. + # Message displayed when the matcher isn't satisfied and is negated. # This is essentially what would satisfy the matcher if it wasn't negated. # # This is only called when `#does_not_match?` returns false. diff --git a/src/spectator/matchers/empty_matcher.cr b/src/spectator/matchers/empty_matcher.cr index bdfa80d..7ed61ed 100644 --- a/src/spectator/matchers/empty_matcher.cr +++ b/src/spectator/matchers/empty_matcher.cr @@ -11,7 +11,7 @@ module Spectator::Matchers "is empty" end - # Checks whether the matcher is satisifed with the expression given to it. + # Checks whether the matcher is satisfied with the expression given to it. private def match?(actual : Expression(T)) : Bool forall T actual_value = actual.value return unexpected(actual_value, actual.label) unless actual_value.responds_to?(:empty?) @@ -19,7 +19,7 @@ module Spectator::Matchers actual_value.empty? end - # Message displayed when the matcher isn't satisifed. + # Message displayed when the matcher isn't satisfied. # # This is only called when `#match?` returns false. # @@ -29,7 +29,7 @@ module Spectator::Matchers "#{actual.label} is not empty" end - # Message displayed when the matcher isn't satisifed and is negated. + # Message displayed when the matcher isn't satisfied and is negated. # This is essentially what would satisfy the matcher if it wasn't negated. # # This is only called when `#does_not_match?` returns false. diff --git a/src/spectator/matchers/equality_matcher.cr b/src/spectator/matchers/equality_matcher.cr index 62f9624..ebd725d 100644 --- a/src/spectator/matchers/equality_matcher.cr +++ b/src/spectator/matchers/equality_matcher.cr @@ -11,12 +11,12 @@ module Spectator::Matchers "equals #{expected.label}" end - # Checks whether the matcher is satisifed with the expression given to it. + # Checks whether the matcher is satisfied with the expression given to it. private def match?(actual : Expression(T)) : Bool forall T expected.value == actual.value end - # Message displayed when the matcher isn't satisifed. + # Message displayed when the matcher isn't satisfied. # # This is only called when `#match?` returns false. # @@ -26,7 +26,7 @@ module Spectator::Matchers "#{actual.label} does not equal #{expected.label}" end - # Message displayed when the matcher isn't satisifed and is negated. + # Message displayed when the matcher isn't satisfied and is negated. # This is essentially what would satisfy the matcher if it wasn't negated. # # This is only called when `#does_not_match?` returns false. diff --git a/src/spectator/matchers/greater_than_equal_matcher.cr b/src/spectator/matchers/greater_than_equal_matcher.cr index cfaf4f1..194591c 100644 --- a/src/spectator/matchers/greater_than_equal_matcher.cr +++ b/src/spectator/matchers/greater_than_equal_matcher.cr @@ -11,12 +11,12 @@ module Spectator::Matchers "greater than or equal to #{expected.label}" end - # Checks whether the matcher is satisifed with the expression given to it. + # Checks whether the matcher is satisfied with the expression given to it. private def match?(actual : Expression(T)) : Bool forall T actual.value >= expected.value end - # Message displayed when the matcher isn't satisifed. + # Message displayed when the matcher isn't satisfied. # # This is only called when `#match?` returns false. # @@ -26,7 +26,7 @@ module Spectator::Matchers "#{actual.label} is less than #{expected.label}" end - # Message displayed when the matcher isn't satisifed and is negated. + # Message displayed when the matcher isn't satisfied and is negated. # This is essentially what would satisfy the matcher if it wasn't negated. # # This is only called when `#does_not_match?` returns false. diff --git a/src/spectator/matchers/greater_than_matcher.cr b/src/spectator/matchers/greater_than_matcher.cr index 4aaf6c1..a2bcdc6 100644 --- a/src/spectator/matchers/greater_than_matcher.cr +++ b/src/spectator/matchers/greater_than_matcher.cr @@ -11,12 +11,12 @@ module Spectator::Matchers "greater than #{expected.label}" end - # Checks whether the matcher is satisifed with the expression given to it. + # Checks whether the matcher is satisfied with the expression given to it. private def match?(actual : Expression(T)) : Bool forall T actual.value > expected.value end - # Message displayed when the matcher isn't satisifed. + # Message displayed when the matcher isn't satisfied. # # This is only called when `#match?` returns false. # @@ -26,7 +26,7 @@ module Spectator::Matchers "#{actual.label} is less than or equal to #{expected.label}" end - # Message displayed when the matcher isn't satisifed and is negated. + # Message displayed when the matcher isn't satisfied and is negated. # This is essentially what would satisfy the matcher if it wasn't negated. # # This is only called when `#does_not_match?` returns false. diff --git a/src/spectator/matchers/have_key_matcher.cr b/src/spectator/matchers/have_key_matcher.cr index 57224d3..36c5395 100644 --- a/src/spectator/matchers/have_key_matcher.cr +++ b/src/spectator/matchers/have_key_matcher.cr @@ -11,7 +11,7 @@ module Spectator::Matchers "has key #{expected.label}" end - # Checks whether the matcher is satisifed with the expression given to it. + # Checks whether the matcher is satisfied with the expression given to it. private def match?(actual : Expression(T)) : Bool forall T actual_value = actual.value return unexpected(actual_value, actual.label) unless actual_value.responds_to?(:has_key?) @@ -19,7 +19,7 @@ module Spectator::Matchers actual_value.has_key?(expected.value) end - # Message displayed when the matcher isn't satisifed. + # Message displayed when the matcher isn't satisfied. # # This is only called when `#match?` returns false. # @@ -29,7 +29,7 @@ module Spectator::Matchers "#{actual.label} does not have key #{expected.label}" end - # Message displayed when the matcher isn't satisifed and is negated. + # Message displayed when the matcher isn't satisfied and is negated. # This is essentially what would satisfy the matcher if it wasn't negated. # # This is only called when `#does_not_match?` returns false. diff --git a/src/spectator/matchers/have_predicate_matcher.cr b/src/spectator/matchers/have_predicate_matcher.cr index df4d90e..12902bd 100644 --- a/src/spectator/matchers/have_predicate_matcher.cr +++ b/src/spectator/matchers/have_predicate_matcher.cr @@ -35,7 +35,7 @@ module Spectator::Matchers end end - # Message displayed when the matcher isn't satisifed. + # Message displayed when the matcher isn't satisfied. # # This is only called when `#match?` returns false. # @@ -45,7 +45,7 @@ module Spectator::Matchers "#{actual.label} does not have #{expected.label}" end - # Message displayed when the matcher isn't satisifed and is negated. + # Message displayed when the matcher isn't satisfied and is negated. # This is essentially what would satisfy the matcher if it wasn't negated. # # This is only called when `#does_not_match?` returns false. @@ -68,7 +68,7 @@ module Spectator::Matchers {% end %} end - # Checks if all predicate methods from the snapshot of them are satisified. + # Checks if all predicate methods from the snapshot of them are satisfied. private def match?(snapshot) : Bool # Test each predicate and immediately return false if one is false. {% for attribute in ExpectedType.keys %} diff --git a/src/spectator/matchers/have_value_matcher.cr b/src/spectator/matchers/have_value_matcher.cr index aa059d8..462fa15 100644 --- a/src/spectator/matchers/have_value_matcher.cr +++ b/src/spectator/matchers/have_value_matcher.cr @@ -11,7 +11,7 @@ module Spectator::Matchers "has value #{expected.label}" end - # Checks whether the matcher is satisifed with the expression given to it. + # Checks whether the matcher is satisfied with the expression given to it. private def match?(actual : Expression(T)) : Bool forall T actual_value = actual.value return unexpected(actual_value, actual.label) unless actual_value.responds_to?(:has_value?) @@ -19,7 +19,7 @@ module Spectator::Matchers actual_value.has_value?(expected.value) end - # Message displayed when the matcher isn't satisifed. + # Message displayed when the matcher isn't satisfied. # # This is only called when `#match?` returns false. # @@ -29,7 +29,7 @@ module Spectator::Matchers "#{actual.label} does not have value #{expected.label}" end - # Message displayed when the matcher isn't satisifed and is negated. + # Message displayed when the matcher isn't satisfied and is negated. # This is essentially what would satisfy the matcher if it wasn't negated. # # This is only called when `#does_not_match?` returns false. diff --git a/src/spectator/matchers/inequality_matcher.cr b/src/spectator/matchers/inequality_matcher.cr index 145f5a1..4ba68bc 100644 --- a/src/spectator/matchers/inequality_matcher.cr +++ b/src/spectator/matchers/inequality_matcher.cr @@ -11,12 +11,12 @@ module Spectator::Matchers "is not equal to #{expected.label}" end - # Checks whether the matcher is satisifed with the expression given to it. + # Checks whether the matcher is satisfied with the expression given to it. private def match?(actual : Expression(T)) : Bool forall T expected.value != actual.value end - # Message displayed when the matcher isn't satisifed. + # Message displayed when the matcher isn't satisfied. # # This is only called when `#match?` returns false. # @@ -26,7 +26,7 @@ module Spectator::Matchers "#{actual.label} is equal to #{expected.label}" end - # Message displayed when the matcher isn't satisifed and is negated. + # Message displayed when the matcher isn't satisfied and is negated. # This is essentially what would satisfy the matcher if it wasn't negated. # # This is only called when `#does_not_match?` returns false. diff --git a/src/spectator/matchers/instance_matcher.cr b/src/spectator/matchers/instance_matcher.cr index bd8f51f..2c8823f 100644 --- a/src/spectator/matchers/instance_matcher.cr +++ b/src/spectator/matchers/instance_matcher.cr @@ -10,12 +10,12 @@ module Spectator::Matchers "is an instance of #{Expected}" end - # Checks whether the matcher is satisifed with the expression given to it. + # Checks whether the matcher is satisfied with the expression given to it. private def match?(actual : Expression(T)) : Bool forall T actual.value.class == Expected end - # Message displayed when the matcher isn't satisifed. + # Message displayed when the matcher isn't satisfied. # # This is only called when `#match?` returns false. # @@ -25,7 +25,7 @@ module Spectator::Matchers "#{actual.label} is not an instance of #{Expected}" end - # Message displayed when the matcher isn't satisifed and is negated. + # Message displayed when the matcher isn't satisfied and is negated. # This is essentially what would satisfy the matcher if it wasn't negated. # # This is only called when `#does_not_match?` returns false. diff --git a/src/spectator/matchers/less_than_equal_matcher.cr b/src/spectator/matchers/less_than_equal_matcher.cr index 620afb3..4bd1f2c 100644 --- a/src/spectator/matchers/less_than_equal_matcher.cr +++ b/src/spectator/matchers/less_than_equal_matcher.cr @@ -11,12 +11,12 @@ module Spectator::Matchers "less than or equal to #{expected.label}" end - # Checks whether the matcher is satisifed with the expression given to it. + # Checks whether the matcher is satisfied with the expression given to it. private def match?(actual : Expression(T)) : Bool forall T actual.value <= expected.value end - # Message displayed when the matcher isn't satisifed. + # Message displayed when the matcher isn't satisfied. # # This is only called when `#match?` returns false. # @@ -26,7 +26,7 @@ module Spectator::Matchers "#{actual.label} is greater than #{expected.label}" end - # Message displayed when the matcher isn't satisifed and is negated. + # Message displayed when the matcher isn't satisfied and is negated. # This is essentially what would satisfy the matcher if it wasn't negated. # # This is only called when `#does_not_match?` returns false. diff --git a/src/spectator/matchers/less_than_matcher.cr b/src/spectator/matchers/less_than_matcher.cr index 05256b1..1a09ad8 100644 --- a/src/spectator/matchers/less_than_matcher.cr +++ b/src/spectator/matchers/less_than_matcher.cr @@ -11,12 +11,12 @@ module Spectator::Matchers "less than #{expected.label}" end - # Checks whether the matcher is satisifed with the expression given to it. + # Checks whether the matcher is satisfied with the expression given to it. private def match?(actual : Expression(T)) : Bool forall T actual.value < expected.value end - # Message displayed when the matcher isn't satisifed. + # Message displayed when the matcher isn't satisfied. # # This is only called when `#match?` returns false. # @@ -26,7 +26,7 @@ module Spectator::Matchers "#{actual.label} is greater than or equal to #{expected.label}" end - # Message displayed when the matcher isn't satisifed and is negated. + # Message displayed when the matcher isn't satisfied and is negated. # This is essentially what would satisfy the matcher if it wasn't negated. # # This is only called when `#does_not_match?` returns false. diff --git a/src/spectator/matchers/nil_matcher.cr b/src/spectator/matchers/nil_matcher.cr index 187f809..38b3d03 100644 --- a/src/spectator/matchers/nil_matcher.cr +++ b/src/spectator/matchers/nil_matcher.cr @@ -11,12 +11,12 @@ module Spectator::Matchers "is nil" end - # Checks whether the matcher is satisifed with the expression given to it. + # Checks whether the matcher is satisfied with the expression given to it. private def match?(actual : Expression(T)) : Bool forall T actual.value.nil? end - # Message displayed when the matcher isn't satisifed. + # Message displayed when the matcher isn't satisfied. # # This is only called when `#match?` returns false. # @@ -26,7 +26,7 @@ module Spectator::Matchers "#{actual.label} is not nil" end - # Message displayed when the matcher isn't satisifed and is negated. + # Message displayed when the matcher isn't satisfied and is negated. # This is essentially what would satisfy the matcher if it wasn't negated. # # This is only called when `#does_not_match?` returns false. diff --git a/src/spectator/matchers/pattern_matcher.cr b/src/spectator/matchers/pattern_matcher.cr index 572a8b4..4f8cab6 100644 --- a/src/spectator/matchers/pattern_matcher.cr +++ b/src/spectator/matchers/pattern_matcher.cr @@ -12,12 +12,12 @@ module Spectator::Matchers "matches #{expected.label}" end - # Checks whether the matcher is satisifed with the expression given to it. + # Checks whether the matcher is satisfied with the expression given to it. private def match?(actual : Expression(T)) : Bool forall T actual.value === expected.value end - # Message displayed when the matcher isn't satisifed. + # Message displayed when the matcher isn't satisfied. # # This is only called when `#match?` returns false. # @@ -27,7 +27,7 @@ module Spectator::Matchers "#{actual.label} does not match #{expected.label}" end - # Message displayed when the matcher isn't satisifed and is negated. + # Message displayed when the matcher isn't satisfied and is negated. # This is essentially what would satisfy the matcher if it wasn't negated. # # This is only called when `#does_not_match?` returns false. diff --git a/src/spectator/matchers/predicate_matcher.cr b/src/spectator/matchers/predicate_matcher.cr index ebf1d87..08bb2f6 100644 --- a/src/spectator/matchers/predicate_matcher.cr +++ b/src/spectator/matchers/predicate_matcher.cr @@ -41,7 +41,7 @@ module Spectator::Matchers end end - # Message displayed when the matcher isn't satisifed. + # Message displayed when the matcher isn't satisfied. # # This is only called when `#match?` returns false. # @@ -51,7 +51,7 @@ module Spectator::Matchers "#{actual.label} is not #{expected.label}" end - # Message displayed when the matcher isn't satisifed and is negated. + # Message displayed when the matcher isn't satisfied and is negated. # This is essentially what would satisfy the matcher if it wasn't negated. # # This is only called when `#does_not_match?` returns false. @@ -74,7 +74,7 @@ module Spectator::Matchers {% end %} end - # Checks if all predicate methods from the snapshot of them are satisified. + # Checks if all predicate methods from the snapshot of them are satisfied. private def match?(snapshot) # Test each predicate and immediately return false if one is false. {% for attribute in ExpectedType.keys %} diff --git a/src/spectator/matchers/range_matcher.cr b/src/spectator/matchers/range_matcher.cr index b4850f5..8c31810 100644 --- a/src/spectator/matchers/range_matcher.cr +++ b/src/spectator/matchers/range_matcher.cr @@ -27,12 +27,12 @@ module Spectator::Matchers RangeMatcher.new(expected) end - # Checks whether the matcher is satisifed with the expression given to it. + # Checks whether the matcher is satisfied with the expression given to it. private def match?(actual : Expression(T)) : Bool forall T expected.value.includes?(actual.value) end - # Message displayed when the matcher isn't satisifed. + # Message displayed when the matcher isn't satisfied. # # This is only called when `#match?` returns false. # @@ -42,7 +42,7 @@ module Spectator::Matchers "#{actual.label} is not in #{expected.label} (#{exclusivity})" end - # Message displayed when the matcher isn't satisifed and is negated. + # Message displayed when the matcher isn't satisfied and is negated. # This is essentially what would satisfy the matcher if it wasn't negated. # # This is only called when `#does_not_match?` returns false. diff --git a/src/spectator/matchers/reference_matcher.cr b/src/spectator/matchers/reference_matcher.cr index 2344527..5a3f330 100644 --- a/src/spectator/matchers/reference_matcher.cr +++ b/src/spectator/matchers/reference_matcher.cr @@ -11,7 +11,7 @@ module Spectator::Matchers "is #{expected.label}" end - # Checks whether the matcher is satisifed with the expression given to it. + # Checks whether the matcher is satisfied with the expression given to it. private def match?(actual : Expression(T)) : Bool forall T value = expected.value if value.nil? @@ -24,7 +24,7 @@ module Spectator::Matchers end end - # Message displayed when the matcher isn't satisifed. + # Message displayed when the matcher isn't satisfied. # # This is only called when `#match?` returns false. # @@ -34,7 +34,7 @@ module Spectator::Matchers "#{actual.label} is not #{expected.label}" end - # Message displayed when the matcher isn't satisifed and is negated. + # Message displayed when the matcher isn't satisfied and is negated. # This is essentially what would satisfy the matcher if it wasn't negated. # # This is only called when `#does_not_match?` returns false. diff --git a/src/spectator/matchers/regex_matcher.cr b/src/spectator/matchers/regex_matcher.cr index e8fad56..b9b2ce3 100644 --- a/src/spectator/matchers/regex_matcher.cr +++ b/src/spectator/matchers/regex_matcher.cr @@ -11,12 +11,12 @@ module Spectator::Matchers "matches #{expected.label}" end - # Checks whether the matcher is satisifed with the expression given to it. + # Checks whether the matcher is satisfied with the expression given to it. private def match?(actual : Expression(T)) : Bool forall T !!(actual.value =~ expected.value) end - # Message displayed when the matcher isn't satisifed. + # Message displayed when the matcher isn't satisfied. # # This is only called when `#match?` returns false. # @@ -26,7 +26,7 @@ module Spectator::Matchers "#{actual.label} does not match #{expected.label}" end - # Message displayed when the matcher isn't satisifed and is negated. + # Message displayed when the matcher isn't satisfied and is negated. # This is essentially what would satisfy the matcher if it wasn't negated. # # This is only called when `#does_not_match?` returns false. diff --git a/src/spectator/matchers/size_matcher.cr b/src/spectator/matchers/size_matcher.cr index ea51c89..74362a5 100644 --- a/src/spectator/matchers/size_matcher.cr +++ b/src/spectator/matchers/size_matcher.cr @@ -11,7 +11,7 @@ module Spectator::Matchers "has size #{expected.label}" end - # Checks whether the matcher is satisifed with the expression given to it. + # Checks whether the matcher is satisfied with the expression given to it. private def match?(actual : Expression(T)) : Bool forall T actual_value = actual.value return unexpected(actual_value, actual.label) unless actual_value.responds_to?(:size?) @@ -19,7 +19,7 @@ module Spectator::Matchers expected.value == actual_value.size end - # Message displayed when the matcher isn't satisifed. + # Message displayed when the matcher isn't satisfied. # # This is only called when `#match?` returns false. # @@ -29,7 +29,7 @@ module Spectator::Matchers "#{actual.label} does not have #{expected.label} elements" end - # Message displayed when the matcher isn't satisifed and is negated. + # Message displayed when the matcher isn't satisfied and is negated. # This is essentially what would satisfy the matcher if it wasn't negated. # # This is only called when `#does_not_match?` returns false. diff --git a/src/spectator/matchers/size_of_matcher.cr b/src/spectator/matchers/size_of_matcher.cr index ad06f99..f84aedf 100644 --- a/src/spectator/matchers/size_of_matcher.cr +++ b/src/spectator/matchers/size_of_matcher.cr @@ -11,7 +11,7 @@ module Spectator::Matchers "is the same size as #{expected.label}" end - # Checks whether the matcher is satisifed with the expression given to it. + # Checks whether the matcher is satisfied with the expression given to it. private def match?(actual : Expression(T)) : Bool forall T actual_value = actual.value return unexpected(actual_value, actual.label) unless actual_value.responds_to?(:size?) @@ -19,7 +19,7 @@ module Spectator::Matchers expected.value.size == actual_value.size end - # Message displayed when the matcher isn't satisifed. + # Message displayed when the matcher isn't satisfied. # # This is only called when `#match?` returns false. # @@ -29,7 +29,7 @@ module Spectator::Matchers "#{actual.label} is not the same size as #{expected.label}" end - # Message displayed when the matcher isn't satisifed and is negated. + # Message displayed when the matcher isn't satisfied and is negated. # This is essentially what would satisfy the matcher if it wasn't negated. # # This is only called when `#does_not_match?` returns false. diff --git a/src/spectator/matchers/standard_matcher.cr b/src/spectator/matchers/standard_matcher.cr index 43992ec..13dee4c 100644 --- a/src/spectator/matchers/standard_matcher.cr +++ b/src/spectator/matchers/standard_matcher.cr @@ -10,11 +10,11 @@ module Spectator::Matchers # that is suitable for most matchers. # Matchers based on this class need to define `#match?` and `#failure_message`. # If the matcher can be negated, - # the `#failure_message_when_negated` method needs to be overriden. + # the `#failure_message_when_negated` method needs to be overridden. # Additionally, the `#does_not_match?` method can be specified # if there's custom behavior for negated matches. # If the matcher operates on or has extra data that is useful for debug, - # then the `#values` and `#negated_values` methods can be overriden. + # then the `#values` and `#negated_values` methods can be overridden. # Finally, define a `#description` message that can be used for the one-liner "it" syntax. abstract struct StandardMatcher < Matcher # Actually performs the test against the expression (value or block). @@ -47,7 +47,7 @@ module Spectator::Matchers end end - # Message displayed when the matcher isn't satisifed. + # Message displayed when the matcher isn't satisfied. # # This is only called when `#match?` returns false. # @@ -55,7 +55,7 @@ module Spectator::Matchers # Actual values should be returned by `#values`. private abstract def failure_message(actual : Expression(T)) : String forall T - # Message displayed when the matcher isn't satisifed and is negated. + # Message displayed when the matcher isn't satisfied and is negated. # This is essentially what would satisfy the matcher if it wasn't negated. # # This is only called when `#does_not_match?` returns false. @@ -70,14 +70,14 @@ module Spectator::Matchers raise "Negation with #{self.class} is not supported." end - # Checks whether the matcher is satisifed with the expression given to it. + # Checks whether the matcher is satisfied with the expression given to it. private abstract def match?(actual : Expression(T)) : Bool forall T # If the expectation is negated, then this method is called instead of `#match?`. # # The default implementation of this method is to invert the result of `#match?`. # If the matcher requires custom handling of negated matches, - # then this method should be overriden. + # then this method should be overridden. # Remember to override `#failure_message_when_negated` as well. private def does_not_match?(actual : Expression(T)) : Bool forall T !match?(actual) diff --git a/src/spectator/matchers/truthy_matcher.cr b/src/spectator/matchers/truthy_matcher.cr index 6ee4714..b784fb7 100644 --- a/src/spectator/matchers/truthy_matcher.cr +++ b/src/spectator/matchers/truthy_matcher.cr @@ -102,12 +102,12 @@ module Spectator::Matchers RegexMatcher.new(expected) end - # Checks whether the matcher is satisifed with the expression given to it. + # Checks whether the matcher is satisfied with the expression given to it. private def match?(actual : Expression(T)) : Bool forall T @truthy == !!actual.value end - # Message displayed when the matcher isn't satisifed. + # Message displayed when the matcher isn't satisfied. # # This is only called when `#match?` returns false. # @@ -117,7 +117,7 @@ module Spectator::Matchers "#{actual.label} is #{negated_label}" end - # Message displayed when the matcher isn't satisifed and is negated. + # Message displayed when the matcher isn't satisfied and is negated. # This is essentially what would satisfy the matcher if it wasn't negated. # # This is only called when `#does_not_match?` returns false. diff --git a/src/spectator/matchers/type_matcher.cr b/src/spectator/matchers/type_matcher.cr index 10d11f4..65980bb 100644 --- a/src/spectator/matchers/type_matcher.cr +++ b/src/spectator/matchers/type_matcher.cr @@ -16,12 +16,12 @@ module Spectator::Matchers "is a #{Expected}" end - # Checks whether the matcher is satisifed with the expression given to it. + # Checks whether the matcher is satisfied with the expression given to it. private def match?(actual : Expression(T)) : Bool forall T actual.value.is_a?(Expected) end - # Message displayed when the matcher isn't satisifed. + # Message displayed when the matcher isn't satisfied. # # This is only called when `#match?` returns false. # @@ -31,7 +31,7 @@ module Spectator::Matchers "#{actual.label} is not a #{Expected}" end - # Message displayed when the matcher isn't satisifed and is negated. + # Message displayed when the matcher isn't satisfied and is negated. # This is essentially what would satisfy the matcher if it wasn't negated. # # This is only called when `#does_not_match?` returns false. diff --git a/src/spectator/matchers/value_matcher.cr b/src/spectator/matchers/value_matcher.cr index c7dffe9..760578b 100644 --- a/src/spectator/matchers/value_matcher.cr +++ b/src/spectator/matchers/value_matcher.cr @@ -6,11 +6,11 @@ module Spectator::Matchers # # Matchers based on this class need to define `#match?` and `#failure_message`. # If the matcher can be negated, - # the `#failure_message_when_negated` method needs to be overriden. + # the `#failure_message_when_negated` method needs to be overridden. # Additionally, the `#does_not_match?` method can be specified # if there's custom behavior for negated matches. # If the matcher operates on or has extra data that is useful for debug, - # then the `#values` and `#negated_values` methods can be overriden. + # then the `#values` and `#negated_values` methods can be overridden. # Finally, define a `#description` message that can be used for the one-liner "it" syntax. # # The failure messages should typically only contain the test expression labels. diff --git a/src/spectator/profile.cr b/src/spectator/profile.cr index 382b85a..79fed6c 100644 --- a/src/spectator/profile.cr +++ b/src/spectator/profile.cr @@ -2,7 +2,7 @@ require "json" require "./example" module Spectator - # Information about the runtimes of examples. + # Information about the runtime of examples. class Profile include Indexable(Example) diff --git a/src/spectator/should.cr b/src/spectator/should.cr index 71e5574..eb0733f 100644 --- a/src/spectator/should.cr +++ b/src/spectator/should.cr @@ -38,13 +38,13 @@ class Object ::Spectator::Harness.current.report(expectation) end - # Works the same as `#should` except that the condition check is postphoned. + # Works the same as `#should` except that the condition check is postponed. # The expectation is checked after the example finishes and all hooks have run. def should_eventually(matcher, message = nil) ::Spectator::Harness.current.defer { should(matcher, message) } end - # Works the same as `#should_not` except that the condition check is postphoned. + # Works the same as `#should_not` except that the condition check is postponed. # The expectation is checked after the example finishes and all hooks have run. def should_never(matcher, message = nil) ::Spectator::Harness.current.defer { should_not(matcher, message) } diff --git a/src/spectator/spec_builder.cr b/src/spectator/spec_builder.cr index 75afa8a..265b41d 100644 --- a/src/spectator/spec_builder.cr +++ b/src/spectator/spec_builder.cr @@ -100,7 +100,7 @@ module Spectator end # Completes a previously defined example group and pops it off the group stack. - # Be sure to call `#start_group` and `#end_group` symmetically. + # Be sure to call `#start_group` and `#end_group` symmetrically. def end_group : Nil Log.trace { "End group: #{current}" } raise "Can't pop root group" if root? @@ -164,14 +164,14 @@ module Spectator end # Registers a new "after_suite" hook. - # The hook will be prepended to the list. + # The hook will be pre-pended to the list. # A new hook will be created by passing args to `ExampleGroupHook.new`. def after_suite(*args, **kwargs) : Nil root.before_all(*args, **kwargs) end # Registers a new "after_suite" hook. - # The hook will be prepended to the list. + # The hook will be pre-pended to the list. # A new hook will be created by passing args to `ExampleGroupHook.new`. def after_suite(*args, **kwargs, &block) : Nil root.after_all(*args, **kwargs, &block)