From 55beb7d94ed9837799872986784407beb1687f3d Mon Sep 17 00:00:00 2001 From: Evgeny Kulikov Date: Fri, 17 Jan 2025 19:38:43 +0200 Subject: [PATCH] Fix typos (#5938) * Fix typos in code comments * Fix typos in changelog * Fix typos in test descriptions * Fix typo in a test helper method name --- .evergreen/config.yml | 2 +- CHANGELOG.md | 16 ++++++++-------- .../association/embedded/embeds_many/proxy.rb | 2 +- .../referenced/has_many/enumerable.rb | 2 +- .../association/referenced/has_many/proxy.rb | 6 +++--- lib/mongoid/atomic/modifiers.rb | 2 +- lib/mongoid/attributes.rb | 2 +- lib/mongoid/config.rb | 2 +- lib/mongoid/contextual/aggregable/memory.rb | 2 +- lib/mongoid/contextual/mongo.rb | 4 ++-- lib/mongoid/criteria.rb | 14 +++++++------- lib/mongoid/criteria/queryable/expandable.rb | 2 +- lib/mongoid/criteria/scopable.rb | 2 +- lib/mongoid/errors/unregistered_class.rb | 2 +- lib/mongoid/factory.rb | 4 ++-- lib/mongoid/fields.rb | 2 +- lib/mongoid/findable.rb | 2 +- lib/mongoid/matcher.rb | 2 +- lib/mongoid/persistence_context.rb | 4 ++-- lib/mongoid/railtie.rb | 2 +- lib/mongoid/stateful.rb | 2 +- lib/mongoid/threaded.rb | 2 +- .../mongoid/config/templates/mongoid.yml | 4 ++-- perf/benchmark_ips.rb | 2 +- spec/integration/associations/belongs_to_spec.rb | 2 +- .../embedded/embeds_many/proxy_spec.rb | 4 ++-- .../embedded/embeds_one/proxy_spec.rb | 2 +- spec/mongoid/association/nested/one_spec.rb | 2 +- .../referenced/has_many/enumerable_spec.rb | 2 +- spec/mongoid/association/syncable_spec.rb | 2 +- spec/mongoid/atomic_spec.rb | 2 +- spec/mongoid/attributes/nested_spec.rb | 2 +- spec/mongoid/attributes_spec.rb | 6 +++--- spec/mongoid/clients/transactions_spec.rb | 2 +- spec/mongoid/contextual/map_reduce_spec.rb | 2 +- spec/mongoid/contextual/mongo_spec.rb | 8 ++++---- spec/mongoid/criteria/includable_spec.rb | 8 ++++---- spec/mongoid/document_spec.rb | 2 +- spec/mongoid/extensions/string_spec.rb | 2 +- spec/mongoid/fields/foreign_key_spec.rb | 2 +- spec/mongoid/fields_spec.rb | 4 ++-- spec/mongoid/findable_spec.rb | 2 +- spec/mongoid/reloadable_spec.rb | 2 +- spec/mongoid/search_indexable_spec.rb | 6 +++--- spec/mongoid/touchable_spec.rb | 2 +- spec/mongoid/validatable/uniqueness_spec.rb | 4 ++-- 46 files changed, 78 insertions(+), 78 deletions(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index c9baba8328..7279f2a005 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -39,7 +39,7 @@ functions: git submodule update --init --recursive "create expansions": - # Make an evergreen exapanstion file with dynamic values + # Make an evergreen expansion file with dynamic values - command: shell.exec params: working_dir: "src" diff --git a/CHANGELOG.md b/CHANGELOG.md index b726e364f9..a2b89e911b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -105,7 +105,7 @@ For instructions on upgrading to newer versions, visit * \#4005 Fixed inclusion of mongoid with Rails components that don't have the Rails environment. -* \#3993 Fixes issue where `dup`/`clone` fails for embedded documents that use store_as without using Mongoid::Atributes::Dynamic +* \#3993 Fixes issue where `dup`/`clone` fails for embedded documents that use store_as without using Mongoid::Attributes::Dynamic * \#3991 Fixed embedded documents not flagging as changed after calling #changed? and modifying the child elements. @@ -798,7 +798,7 @@ child elements. Band.where(name: "Placebo").unset(:members, :origin) * \#2669 Passing a block to `Criteria#new` now properly sends the - block through to the model's contructor. (Arthur Neves) + block through to the model's constructor. (Arthur Neves) * \#2667 `exists?` no longer hits the database in cases where we have the necessary information in memory. @@ -1200,7 +1200,7 @@ child elements. * \#2571 Remove blank error message from locales. (Jordan Elver) -* \#2568 Fix uniqueness validation for lacalized fields when a scope is also +* \#2568 Fix uniqueness validation for localized fields when a scope is also provided. * \#2552 Ensure `InvalidPath` errors are raised when embedded documents try to @@ -1609,7 +1609,7 @@ child elements. Band.first.touch - Update a specific time field along with the udpated_at. + Update a specific time field along with the updated_at. Band.first.touch(:founded) @@ -1728,7 +1728,7 @@ child elements. # { "name" => "foo", "my_preferences" => [{ "value" => "ok" }]} * \#1806 `Model.find_or_create_by` and `Model.find_or_initialize_by` can now - take documents as paramters for belongs_to relations. + take documents as parameters for belongs_to relations. person = Person.first Game.find_or_create_by(person: person) @@ -2506,7 +2506,7 @@ child elements. * \#2038 Allow inverse relations to be determined by foreign keys alone if defined on both sides, not just an inverse_of declaration. -* \#2023 Allow serilialization of dynamic types that conflict with core +* \#2023 Allow serialization of dynamic types that conflict with core Ruby methods to still be serialized. * \#2008 Presence validation should hit the db to check validity if the @@ -2611,7 +2611,7 @@ child elements. had the foreign key link persisted. * \#1820 Destroying embedded documents in an embeds_many should also - removed the document from the underlying _uncoped target and reindex + removed the document from the underlying _unscoped target and reindex the relation. * \#1814 Don't cascade callbacks on after_initialize. @@ -3059,7 +3059,7 @@ child elements. key without error. * \#1350, \#1351 Fixed errors in the string conversions of double quotes and - tilde when paramterizing keys. + tilde when parametrizing keys. * \#1349 Mongoid documents should not blow up when including Enumerable. (Jonas Nicklas) diff --git a/lib/mongoid/association/embedded/embeds_many/proxy.rb b/lib/mongoid/association/embedded/embeds_many/proxy.rb index a2d14a035e..472ba226e8 100644 --- a/lib/mongoid/association/embedded/embeds_many/proxy.rb +++ b/lib/mongoid/association/embedded/embeds_many/proxy.rb @@ -484,7 +484,7 @@ def integrate(document) # # @return [ Criteria | Object ] A Criteria or return value from the target. # - # TODO: make sure we are consistingly using respond_to_missing + # TODO: make sure we are consistently using respond_to_missing # anywhere we define method_missing. # rubocop:disable Style/MissingRespondToMissing ruby2_keywords def method_missing(name, *args, &block) diff --git a/lib/mongoid/association/referenced/has_many/enumerable.rb b/lib/mongoid/association/referenced/has_many/enumerable.rb index b388e404be..d024e3820e 100644 --- a/lib/mongoid/association/referenced/has_many/enumerable.rb +++ b/lib/mongoid/association/referenced/has_many/enumerable.rb @@ -253,7 +253,7 @@ def first(limit = nil) # Initialize the new enumerable either with a criteria or an array. # # @example Initialize the enumerable with a criteria. - # Enumberable.new(Post.where(:person_id => id)) + # Enumerable.new(Post.where(:person_id => id)) # # @example Initialize the enumerable with an array. # Enumerable.new([ post ]) diff --git a/lib/mongoid/association/referenced/has_many/proxy.rb b/lib/mongoid/association/referenced/has_many/proxy.rb index ef0bd2bd08..b9342e3c7f 100644 --- a/lib/mongoid/association/referenced/has_many/proxy.rb +++ b/lib/mongoid/association/referenced/has_many/proxy.rb @@ -160,7 +160,7 @@ def delete(document) # @example Delete all documents in the association. # person.posts.delete_all # - # @example Conditonally delete all documents in the association. + # @example Conditionally delete all documents in the association. # person.posts.delete_all({ :title => "Testing" }) # # @param [ Hash ] conditions Optional conditions to delete with. @@ -462,7 +462,7 @@ def cascade!(document) # # @return [ Criteria | Object ] A Criteria or return value from the target. # - # TODO: make sure we are consistingly using respond_to_missing + # TODO: make sure we are consistently using respond_to_missing # anywhere we define method_missing. # rubocop:disable Style/MissingRespondToMissing ruby2_keywords def method_missing(name, *args, &block) @@ -512,7 +512,7 @@ def persistable? # @example Delete all documents in the association. # person.posts.delete_all # - # @example Conditonally delete all documents in the association. + # @example Conditionally delete all documents in the association. # person.posts.delete_all({ :title => "Testing" }) # # @param [ Hash ] conditions Optional conditions to delete with. diff --git a/lib/mongoid/atomic/modifiers.rb b/lib/mongoid/atomic/modifiers.rb index d905e937b8..0a69ab7f16 100644 --- a/lib/mongoid/atomic/modifiers.rb +++ b/lib/mongoid/atomic/modifiers.rb @@ -119,7 +119,7 @@ def add_operation(mods, field, value) end # Adds or appends an array operation with the $each specifier used - # in conjuction with $push. + # in conjunction with $push. # # @example Add the operation. # modifications.add_operation(mods, field, value) diff --git a/lib/mongoid/attributes.rb b/lib/mongoid/attributes.rb index 063cfd3caa..1b321c3467 100644 --- a/lib/mongoid/attributes.rb +++ b/lib/mongoid/attributes.rb @@ -137,7 +137,7 @@ def read_attribute_before_type_cast(name) # @param [ String | Symbol ] name The name of the attribute to remove. # # @raise [ Errors::ReadonlyAttribute ] If the field cannot be removed due - # to being flagged as reaodnly. + # to being flagged as readonly. def remove_attribute(name) validate_writable_field_name!(name.to_s) as_writable_attribute!(name) do |access| diff --git a/lib/mongoid/config.rb b/lib/mongoid/config.rb index aac4ff63fe..7afc026f4a 100644 --- a/lib/mongoid/config.rb +++ b/lib/mongoid/config.rb @@ -166,7 +166,7 @@ module Config # # Setting this flag to true restores the pre-9.0 behavior, where callbacks # for embedded documents are called. This may lead to stack overflow errors - # if there are more than cicrca 1000 embedded documents in the root + # if there are more than circa 1000 embedded documents in the root # document's dependencies graph. # See https://jira.mongodb.org/browse/MONGOID-5658 for more details. option :around_callbacks_for_embeds, default: false diff --git a/lib/mongoid/contextual/aggregable/memory.rb b/lib/mongoid/contextual/aggregable/memory.rb index ae4aacffd2..7b8da89ea4 100644 --- a/lib/mongoid/contextual/aggregable/memory.rb +++ b/lib/mongoid/contextual/aggregable/memory.rb @@ -90,7 +90,7 @@ def min(field = nil) # @example Get the sum for the provided block. # aggregable.sum(&:likes) # - # @param [ Symbol | Numeric ] field The field to sum, or the intial + # @param [ Symbol | Numeric ] field The field to sum, or the initial # value of the sum when a block is given. # # @return [ Numeric ] The sum value. diff --git a/lib/mongoid/contextual/mongo.rb b/lib/mongoid/contextual/mongo.rb index 4972c83356..b6d6b8012b 100644 --- a/lib/mongoid/contextual/mongo.rb +++ b/lib/mongoid/contextual/mongo.rb @@ -85,7 +85,7 @@ def count(options = {}, &block) # Get the estimated number of documents matching the query. # # Unlike count, estimated_count does not take a block because it is not - # traditionally defined (with a block) on Enumarable like count is. + # traditionally defined (with a block) on Enumerable like count is. # # @example Get the estimated number of matching documents. # context.estimated_count @@ -1018,7 +1018,7 @@ def demongoize_hash(klass, hash) next end - # does the key represent an emebedded relation on the document? + # does the key represent an embedded relation on the document? aliased_name = klass.aliased_associations[key] || key if (assoc = klass.relations[aliased_name]) case value diff --git a/lib/mongoid/criteria.rb b/lib/mongoid/criteria.rb index 52cafa3204..6a6647563b 100644 --- a/lib/mongoid/criteria.rb +++ b/lib/mongoid/criteria.rb @@ -88,7 +88,7 @@ def ==(other) # and finds one or many documents for the provided _id values. # # If this method is given a block, it delegates to +Enumerable#find+ and - # returns the first document of those found by the current Crieria object + # returns the first document of those found by the current Criteria object # for which the block returns a truthy value. # # Note that the "default proc" argument of Enumerable is not specially @@ -99,7 +99,7 @@ def ==(other) # a nested array. Each array will be flattened. # # @example Finds a document by its _id, invokes Findable#find. - # critera.find("1234") + # criteria.find("1234") # # @example Finds the first matching document using a block, invokes Enumerable#find. # criteria.find { |item| item.name == "Depeche Mode" } @@ -364,7 +364,7 @@ def empty_and_chainable? !!@none end - # Overriden to include _type in the fields. + # Overridden to include _type in the fields. # # @example Limit the fields returned from the database. # Band.only(:name) @@ -398,7 +398,7 @@ def read(value = nil) end end - # Overriden to exclude _id from the fields. + # Overridden to exclude _id from the fields. # # @example Exclude fields returned from the database. # Band.without(:name) @@ -414,7 +414,7 @@ def without(*args) # Returns true if criteria responds to the given method. # # @example Does the criteria respond to the method? - # crtiteria.respond_to?(:each) + # criteria.respond_to?(:each) # # @param [ Symbol ] name The name of the class method on the +Document+. # @param [ true | false ] include_private Whether to include privates. @@ -483,8 +483,8 @@ def where(*args) # Historically this method required exactly one argument. # As of https://jira.mongodb.org/browse/MONGOID-4804 it also accepts # zero arguments. - # The underlying where implemetation that super invokes supports - # any number of arguments, but we don't presently allow mutiple + # The underlying where implementation that super invokes supports + # any number of arguments, but we don't presently allow multiple # arguments through this method. This API can be reconsidered in the # future. if args.length > 1 diff --git a/lib/mongoid/criteria/queryable/expandable.rb b/lib/mongoid/criteria/queryable/expandable.rb index 19767c458a..0636a09c49 100644 --- a/lib/mongoid/criteria/queryable/expandable.rb +++ b/lib/mongoid/criteria/queryable/expandable.rb @@ -23,7 +23,7 @@ module Expandable # # The following parameter forms are accepted: # - # - field is a string or symbol; value is the field query expresision + # - field is a string or symbol; value is the field query expression # - field is a Key instance; value is the field query expression # - field is a string corresponding to a MongoDB operator; value is # the operator value expression. diff --git a/lib/mongoid/criteria/scopable.rb b/lib/mongoid/criteria/scopable.rb index 576c10361d..f685b3a191 100644 --- a/lib/mongoid/criteria/scopable.rb +++ b/lib/mongoid/criteria/scopable.rb @@ -66,7 +66,7 @@ def remove_scoping(other) self end - # Forces the criteria to be scoped, unless its inside an unscoped block. + # Forces the criteria to be scoped, unless it's inside an unscoped block. # # @example Force the criteria to be scoped. # criteria.scoped(skip: 10) diff --git a/lib/mongoid/errors/unregistered_class.rb b/lib/mongoid/errors/unregistered_class.rb index 15432a9747..fb1099ae52 100644 --- a/lib/mongoid/errors/unregistered_class.rb +++ b/lib/mongoid/errors/unregistered_class.rb @@ -6,7 +6,7 @@ module Errors # class in a polymorphic association, but the class has not previously # been registered by resolver that was used for the query. # - # Here's an exammple: + # Here's an example: # # class Department # include Mongoid::Document diff --git a/lib/mongoid/factory.rb b/lib/mongoid/factory.rb index bbd21785c8..d8652a2c77 100644 --- a/lib/mongoid/factory.rb +++ b/lib/mongoid/factory.rb @@ -5,7 +5,7 @@ module Mongoid module Factory extend self - # A helper class for instantiating a model using either it's type + # A helper class for instantiating a model using either its type # class directly, or via a type class specified via a discriminator # key. # @@ -99,7 +99,7 @@ def instantiate_with_type(execute_callbacks) ) end - # Retreive the `Class` instance of the requested type, either by finding it + # Retrieve the `Class` instance of the requested type, either by finding it # in the `klass` discriminator mapping, or by otherwise finding a # Document model with the given name. # diff --git a/lib/mongoid/fields.rb b/lib/mongoid/fields.rb index 7a218255a8..b92301ae0d 100644 --- a/lib/mongoid/fields.rb +++ b/lib/mongoid/fields.rb @@ -324,7 +324,7 @@ def options # @param [ String ] key The key used to search the association tree. # @param [ Hash ] fields The fields to begin the search with. # @param [ Hash ] associations The associations to begin the search with. - # @param [ Hash ] aliased_associations The alaised associations to begin + # @param [ Hash ] aliased_associations The aliased associations to begin # the search with. # @param &block The block. # @yieldparam [ Symbol ] The current method. diff --git a/lib/mongoid/findable.rb b/lib/mongoid/findable.rb index 891c66077c..34748f7c7e 100644 --- a/lib/mongoid/findable.rb +++ b/lib/mongoid/findable.rb @@ -147,7 +147,7 @@ def exists?(id_or_conditions = :none) # during query construction. # # If this method is given a block, it delegates to +Enumerable#find+ and - # returns the first document of those found by the current Crieria object + # returns the first document of those found by the current Criteria object # for which the block returns a truthy value. If both a block and ids are # given, the block is ignored and the documents for the given ids are # returned. If a block and a Proc are given, the method delegates to diff --git a/lib/mongoid/matcher.rb b/lib/mongoid/matcher.rb index 9b2a0c1cf9..e785d59a62 100644 --- a/lib/mongoid/matcher.rb +++ b/lib/mongoid/matcher.rb @@ -45,7 +45,7 @@ module Matcher # @return [ Object | Array ] Field value or values. module_function def extract_attribute(document, key) # The matcher system will wind up sending atomic values to this as well, - # when attepting to match more complex types. If anything other than a + # when attempting to match more complex types. If anything other than a # Document or a Hash is given, we'll short-circuit the logic and just # return an empty array. return [] unless document.is_a?(Hash) || document.is_a?(Document) diff --git a/lib/mongoid/persistence_context.rb b/lib/mongoid/persistence_context.rb index 89d7f49e64..9a176bd84f 100644 --- a/lib/mongoid/persistence_context.rb +++ b/lib/mongoid/persistence_context.rb @@ -292,7 +292,7 @@ def context_store # Get the persistence context for a given object from the thread local # storage. # - # @param [ Object ] object Object to get the persistance context for. + # @param [ Object ] object Object to get the persistence context for. # # @return [ Mongoid::PersistenceContext | nil ] The persistence context # for the object if previously stored, otherwise nil. @@ -305,7 +305,7 @@ def get_context(object) # Store persistence context for a given object in the thread local # storage. # - # @param [ Object ] object Object to store the persistance context for. + # @param [ Object ] object Object to store the persistence context for. # @param [ Mongoid::PersistenceContext ] context Context to store # # @api private diff --git a/lib/mongoid/railtie.rb b/lib/mongoid/railtie.rb index 7a97d59172..b31cf49116 100644 --- a/lib/mongoid/railtie.rb +++ b/lib/mongoid/railtie.rb @@ -94,7 +94,7 @@ def self.rescue_responses end # Rails runs all initializers first before getting into any generator - # code, so we have no way in the intitializer to know if we are + # code, so we have no way in the initializer to know if we are # generating a mongoid.yml. So instead of failing, we catch all the # errors and print them out. def handle_configuration_error(e) diff --git a/lib/mongoid/stateful.rb b/lib/mongoid/stateful.rb index 1fd0ed5a5a..334db80e3c 100644 --- a/lib/mongoid/stateful.rb +++ b/lib/mongoid/stateful.rb @@ -76,7 +76,7 @@ def flagged_for_destroy? alias :marked_for_destruction? :flagged_for_destroy? alias :_destroy :flagged_for_destroy? - # Returns true if the +Document+ has been succesfully destroyed, and false + # Returns true if the +Document+ has been successfully destroyed, and false # if it hasn't. This is determined by the variable @destroyed and NOT # by checking the database. # diff --git a/lib/mongoid/threaded.rb b/lib/mongoid/threaded.rb index bb3c00de6b..6fb1a9ab31 100644 --- a/lib/mongoid/threaded.rb +++ b/lib/mongoid/threaded.rb @@ -41,7 +41,7 @@ module Threaded # given, and the variable does not already exist, the return value of the # block will be set as the value of the variable before returning it. # - # It is very important that applications (and espcially Mongoid) + # It is very important that applications (and especially Mongoid) # use this method instead of Thread#[], since Thread#[] is actually for # fiber-local variables, and Mongoid uses Fibers as an implementation # detail in some callbacks. Putting thread-local state in a fiber-local diff --git a/lib/rails/generators/mongoid/config/templates/mongoid.yml b/lib/rails/generators/mongoid/config/templates/mongoid.yml index 8cbb62d58c..0d57569ec9 100644 --- a/lib/rails/generators/mongoid/config/templates/mongoid.yml +++ b/lib/rails/generators/mongoid/config/templates/mongoid.yml @@ -135,7 +135,7 @@ development: driver_options: # When this flag is off, an aggregation done on a view will be executed over # the documents included in that view, instead of all documents in the - # collection. When this flag is on, the view fiter is ignored. + # collection. When this flag is on, the view filter is ignored. # broken_view_aggregate: true # When this flag is set to false, the view options will be correctly @@ -143,7 +143,7 @@ development: # broken_view_options: true # When this flag is set to true, the update and replace methods will - # validate the paramters and raise an error if they are invalid. + # validate the parameters and raise an error if they are invalid. # validate_update_replace: false diff --git a/perf/benchmark_ips.rb b/perf/benchmark_ips.rb index 6c8fba9615..686268fa97 100644 --- a/perf/benchmark_ips.rb +++ b/perf/benchmark_ips.rb @@ -215,7 +215,7 @@ def preferences end # IMPROVEME: - # the same problem here as was metioned above. + # the same problem here as was mentioned above. bm.report("#find") do person.posts.find(person_post_id) end diff --git a/spec/integration/associations/belongs_to_spec.rb b/spec/integration/associations/belongs_to_spec.rb index 752f245cbd..bb56d8d948 100644 --- a/spec/integration/associations/belongs_to_spec.rb +++ b/spec/integration/associations/belongs_to_spec.rb @@ -15,7 +15,7 @@ def quarantine(context, polymorphic:, dept_aliases:, team_aliases:) # Have to eval this, because otherwise we get syntax errors when defining a class # inside a method. # - # I know the scissors are sharp! But I want to run with them anwyay! + # I know the scissors are sharp! But I want to run with them anyway! Object.class_eval <<-RUBY class SandboxManager; include Mongoid::Document; end class SandboxDepartment; include Mongoid::Document; end diff --git a/spec/mongoid/association/embedded/embeds_many/proxy_spec.rb b/spec/mongoid/association/embedded/embeds_many/proxy_spec.rb index 28a8e9c9d7..fa5471aeb7 100644 --- a/spec/mongoid/association/embedded/embeds_many/proxy_spec.rb +++ b/spec/mongoid/association/embedded/embeds_many/proxy_spec.rb @@ -3806,7 +3806,7 @@ class TrackingIdValidationHistory person_two.addresses << address end - it "adds the document to the new paarent" do + it "adds the document to the new parent" do expect(person_two.addresses).to eq([ address ]) end @@ -4382,7 +4382,7 @@ class TrackingIdValidationHistory expect(artist.before_remove_embedded_called).to be true end - it "shoud clear the relation" do + it "clears the relation" do expect(artist.songs).to be_empty end end diff --git a/spec/mongoid/association/embedded/embeds_one/proxy_spec.rb b/spec/mongoid/association/embedded/embeds_one/proxy_spec.rb index 3ee5c91beb..28d36a35ed 100644 --- a/spec/mongoid/association/embedded/embeds_one/proxy_spec.rb +++ b/spec/mongoid/association/embedded/embeds_one/proxy_spec.rb @@ -78,7 +78,7 @@ class << person end end - it "sets the target without an invinite recursion" do + it "sets the target without an infinite recursion" do person.name = name expect(person.name).to be_present end diff --git a/spec/mongoid/association/nested/one_spec.rb b/spec/mongoid/association/nested/one_spec.rb index 89be7fca47..835e98b2b5 100644 --- a/spec/mongoid/association/nested/one_spec.rb +++ b/spec/mongoid/association/nested/one_spec.rb @@ -106,7 +106,7 @@ end end - context "when attributes are replacable" do + context "when attributes are replaceable" do let(:options) do {} diff --git a/spec/mongoid/association/referenced/has_many/enumerable_spec.rb b/spec/mongoid/association/referenced/has_many/enumerable_spec.rb index 23d5cdd20a..5d49883d30 100644 --- a/spec/mongoid/association/referenced/has_many/enumerable_spec.rb +++ b/spec/mongoid/association/referenced/has_many/enumerable_spec.rb @@ -1126,7 +1126,7 @@ enumerable.first end - context "when a perviously persisted unloaded doc exists" do + context "when a previously persisted unloaded doc exists" do it "returns the first added doc" do expect(first).to eq(post) diff --git a/spec/mongoid/association/syncable_spec.rb b/spec/mongoid/association/syncable_spec.rb index 93b52b80ab..166a01ba98 100644 --- a/spec/mongoid/association/syncable_spec.rb +++ b/spec/mongoid/association/syncable_spec.rb @@ -44,7 +44,7 @@ class TestModel Object.send(:remove_const, :TestModel) end - it 'prohibits the use of :_sycned as an attribute' do + it 'prohibits the use of :_synced as an attribute' do expect { model_synced }.to raise_exception(Mongoid::Errors::InvalidField) diff --git a/spec/mongoid/atomic_spec.rb b/spec/mongoid/atomic_spec.rb index 3fe062db5f..b7653029c9 100644 --- a/spec/mongoid/atomic_spec.rb +++ b/spec/mongoid/atomic_spec.rb @@ -292,7 +292,7 @@ end end - context "when adding a new child beetween two existing and updating one of them" do + context "when adding a new child between two existing and updating one of them" do let!(:new_address) do person.addresses.build(street: "Ipanema") diff --git a/spec/mongoid/attributes/nested_spec.rb b/spec/mongoid/attributes/nested_spec.rb index 39447a7892..90e297e7c4 100644 --- a/spec/mongoid/attributes/nested_spec.rb +++ b/spec/mongoid/attributes/nested_spec.rb @@ -3039,7 +3039,7 @@ class BandWithAllowDestroyedRecords < Band person.save! end - it "does not perist the invalid value" do + it "does not persist the invalid value" do expect(post_two.reload.title).to eq("First response") end end diff --git a/spec/mongoid/attributes_spec.rb b/spec/mongoid/attributes_spec.rb index 386b645f97..0e3a09a93e 100644 --- a/spec/mongoid/attributes_spec.rb +++ b/spec/mongoid/attributes_spec.rb @@ -1739,7 +1739,7 @@ context "when the key has been specified as a field" do - it "retuns the typed value" do + it "returns the typed value" do person.send(:typed_value_for, "age", "51") end end @@ -2695,7 +2695,7 @@ end end - context "when modifiying a hash referenced with the [] notation" do + context "when modifying a hash referenced with the [] notation" do let(:church) { Church.create!(location: { x: 1 }) } before do @@ -2709,7 +2709,7 @@ end end - context "when modifiying a set referenced with the [] notation" do + context "when modifying a set referenced with the [] notation" do let(:catalog) { Catalog.create!(set_field: [ 1 ].to_set) } before do diff --git a/spec/mongoid/clients/transactions_spec.rb b/spec/mongoid/clients/transactions_spec.rb index 95dc11606b..10ef1b3944 100644 --- a/spec/mongoid/clients/transactions_spec.rb +++ b/spec/mongoid/clients/transactions_spec.rb @@ -722,7 +722,7 @@ def capture_exception end end - it 'commits the transacrion' do + it 'commits the transaction' do expect(other_events.count { |e| e.command_name == 'abortTransaction'}).to be(0) expect(other_events.count { |e| e.command_name == 'commitTransaction'}).to be(1) end diff --git a/spec/mongoid/contextual/map_reduce_spec.rb b/spec/mongoid/contextual/map_reduce_spec.rb index 286e38f429..ce28869e57 100644 --- a/spec/mongoid/contextual/map_reduce_spec.rb +++ b/spec/mongoid/contextual/map_reduce_spec.rb @@ -149,7 +149,7 @@ end end - context "when the statstics are requested" do + context "when the statistics are requested" do max_server_version '4.2' it "raises an error" do diff --git a/spec/mongoid/contextual/mongo_spec.rb b/spec/mongoid/contextual/mongo_spec.rb index 4cead4cb8c..ac1cec94b6 100644 --- a/spec/mongoid/contextual/mongo_spec.rb +++ b/spec/mongoid/contextual/mongo_spec.rb @@ -277,7 +277,7 @@ Band.create!(name: "New Order") end - context "when the selector is contraining" do + context "when the selector is constraining" do let(:criteria) do Band.where(name: "Depeche Mode") @@ -331,7 +331,7 @@ end end - context "when the selector is not contraining" do + context "when the selector is not constraining" do let(:criteria) do Band.all @@ -381,7 +381,7 @@ Band.create!(name: "New Order") end - context "when the selector is contraining" do + context "when the selector is constraining" do let(:criteria) do Band.where(name: "Depeche Mode") @@ -435,7 +435,7 @@ end end - context "when the selector is not contraining" do + context "when the selector is not constraining" do let(:criteria) do Band.all diff --git a/spec/mongoid/criteria/includable_spec.rb b/spec/mongoid/criteria/includable_spec.rb index 85980effa0..0da09974fc 100644 --- a/spec/mongoid/criteria/includable_spec.rb +++ b/spec/mongoid/criteria/includable_spec.rb @@ -1135,7 +1135,7 @@ class D a.b = b end - context "when including the belongs_to assocation" do + context "when including the belongs_to association" do let!(:result) do C.includes(b: :a).first end @@ -1153,7 +1153,7 @@ class D end end - context "when including a doubly-nested belongs_to assocation" do + context "when including a doubly-nested belongs_to association" do let!(:result) do D.includes(c: { b: :a }).first end @@ -1172,7 +1172,7 @@ class D end end - context "when including the has_many assocation" do + context "when including the has_many association" do let!(:result) do A.includes(b: :c).first end @@ -1190,7 +1190,7 @@ class D end end - context "when including a doubly-nested has_many assocation" do + context "when including a doubly-nested has_many association" do let!(:result) do A.includes(b: { c: :d }).first end diff --git a/spec/mongoid/document_spec.rb b/spec/mongoid/document_spec.rb index 03915b1669..c44404fc71 100644 --- a/spec/mongoid/document_spec.rb +++ b/spec/mongoid/document_spec.rb @@ -852,7 +852,7 @@ class Manager < Person context "when the document has embedded documents" do - context "when the attribtues are protected" do + context "when the attributes are protected" do let!(:appointment) do manager.appointments.build diff --git a/spec/mongoid/extensions/string_spec.rb b/spec/mongoid/extensions/string_spec.rb index e7d27c7aa3..5f057ad17a 100644 --- a/spec/mongoid/extensions/string_spec.rb +++ b/spec/mongoid/extensions/string_spec.rb @@ -151,7 +151,7 @@ describe "#collectionize" do - context "when class is namepaced" do + context "when class is namespaced" do module Medical class Patient diff --git a/spec/mongoid/fields/foreign_key_spec.rb b/spec/mongoid/fields/foreign_key_spec.rb index fedfef3eca..6494b97d81 100644 --- a/spec/mongoid/fields/foreign_key_spec.rb +++ b/spec/mongoid/fields/foreign_key_spec.rb @@ -448,7 +448,7 @@ end end - context "when the association is polymoprhic" do + context "when the association is polymorphic" do let(:association) do Agent.reflect_on_association(:names) diff --git a/spec/mongoid/fields_spec.rb b/spec/mongoid/fields_spec.rb index 9e7485b97c..ff5276c2e7 100644 --- a/spec/mongoid/fields_spec.rb +++ b/spec/mongoid/fields_spec.rb @@ -371,7 +371,7 @@ expect(klass.field(:test, type: :range).type).to be(Range) end - it "converts :regexp to Rexegp" do + it "converts :regexp to Regexp" do expect(klass.field(:test, type: :regexp).type).to be(Regexp) end @@ -611,7 +611,7 @@ context "when the attribute has not been assigned" do - it "delgates to the getter" do + it "delegates to the getter" do expect(person.age_before_type_cast).to eq(person.age) end end diff --git a/spec/mongoid/findable_spec.rb b/spec/mongoid/findable_spec.rb index bbe576902b..8e01594410 100644 --- a/spec/mongoid/findable_spec.rb +++ b/spec/mongoid/findable_spec.rb @@ -864,7 +864,7 @@ Band.create!(name: "Photek") end - it 'returns the currect count' do + it 'returns the correct count' do expect(Band.count).to eq(2) end end diff --git a/spec/mongoid/reloadable_spec.rb b/spec/mongoid/reloadable_spec.rb index 825a42042f..9fad092f4b 100644 --- a/spec/mongoid/reloadable_spec.rb +++ b/spec/mongoid/reloadable_spec.rb @@ -289,7 +289,7 @@ end end - context "when embedded documents are unasssigned and reassigned" do + context "when embedded documents are unassigned and reassigned" do let(:palette) do Palette.new diff --git a/spec/mongoid/search_indexable_spec.rb b/spec/mongoid/search_indexable_spec.rb index 22115623bc..50c8c3758b 100644 --- a/spec/mongoid/search_indexable_spec.rb +++ b/spec/mongoid/search_indexable_spec.rb @@ -28,7 +28,7 @@ def wait_for(*names, &condition) # Wait until all of the indexes with the given names are absent from the # search index list. - def wait_for_absense_of(*names) + def wait_for_absence_of(*names) names.flatten.each do |name| timeboxed_wait do break if collection.search_indexes(name: name).empty? @@ -123,7 +123,7 @@ def filter_results(result, names) before do model.remove_search_index id: target_index['id'] - helper.wait_for_absense_of target_index['name'] + helper.wait_for_absence_of target_index['name'] end it 'removes the requested index' do @@ -135,7 +135,7 @@ def filter_results(result, names) before do actual_indexes # wait for the indexes to be created model.remove_search_indexes - helper.wait_for_absense_of(actual_indexes.map { |i| i['name'] }) + helper.wait_for_absence_of(actual_indexes.map { |i| i['name'] }) end it 'removes the indexes' do diff --git a/spec/mongoid/touchable_spec.rb b/spec/mongoid/touchable_spec.rb index 287e363839..79630be047 100644 --- a/spec/mongoid/touchable_spec.rb +++ b/spec/mongoid/touchable_spec.rb @@ -1460,7 +1460,7 @@ class TouchableChild expect(parent.after_touch_called).to eq(true) end - context 'when touch is calles on a child' do + context 'when touch is called on a child' do before do child.touch end diff --git a/spec/mongoid/validatable/uniqueness_spec.rb b/spec/mongoid/validatable/uniqueness_spec.rb index e931ac3d73..661066ccb5 100644 --- a/spec/mongoid/validatable/uniqueness_spec.rb +++ b/spec/mongoid/validatable/uniqueness_spec.rb @@ -337,7 +337,7 @@ context "when the document is not the match" do - context "when signle localization" do + context "when single localization" do before do Dictionary.create!(description: "english") @@ -539,7 +539,7 @@ Dictionary.reset_callbacks(:validate) end - context "when the document with the unqiue attribute is not in default scope" do + context "when the document with the unique attribute is not in default scope" do context "when the attribute is not unique" do