Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

Commit

Permalink
User 'override' in place of 'overwrite' in documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasdespres committed May 23, 2013
1 parent 4b82485 commit 9c7c884
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/respect/composite_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Respect
# A composite schema is a schema composed of another schema.
#
# Sub-classing {CompositeSchema} is the easiest way to add a user-defined
# schema. Indeed, you just have to overwrite {#schema_definition} and optionally
# schema. Indeed, you just have to override {#schema_definition} and optionally
# {#sanitize}. Your schema will be handled properly by all other part
# of the library (i.e. mainly dumpers and the DSL).
#
Expand Down
4 changes: 2 additions & 2 deletions lib/respect/core_statements.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ module CoreStatements
# end
# end
#
# or you can overwrite the +class+ method in the context of your choice:
# or you can override the +class+ method in the context of your choice:
#
# module Respect
# class GlobalDef
Expand All @@ -130,7 +130,7 @@ module CoreStatements
# end
# end
#
# Do not un-define or overwrite 'method' and 'methods' since {FakeNameProxy}
# Do not un-define or override 'method' and 'methods' since {FakeNameProxy}
# use them.
def method_missing(method_name, *args, &block)
if respond_to_missing?(method_name, false)
Expand Down
2 changes: 1 addition & 1 deletion lib/respect/global_def.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def eval(&block)
# Overwrite this method in sub-classes to return the result value
# of this evaluation context.
def evaluation_result
raise NoMethodError, "overwrite me in sub-classes"
raise NoMethodError, "override me in sub-classes"
end
end

Expand Down
4 changes: 2 additions & 2 deletions lib/respect/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def statement_name
end

# Return the default options for this schema class.
# If you overwrite this method in sub-classes, call super and merge the
# If you override this method in sub-classes, call super and merge the
# result with your default options.
def default_options
{
Expand Down Expand Up @@ -201,7 +201,7 @@ def validate?(object)
# this process and you can access it via {#sanitized_object}.
# Rewrite it in sub-classes.
def validate(object)
raise NoMethodError, "overwrite me in sub-classes"
raise NoMethodError, "override me in sub-classes"
end

# Return +true+ or +false+ whether this schema validates the given +object+.
Expand Down
4 changes: 2 additions & 2 deletions lib/respect/validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ def to_h(format = :org3)
private

# Called when {#to_h} is called with +:org3+ format.
# Sub-classes are supposed to overwrite this methods and to return
# Sub-classes are supposed to override this methods and to return
# their conversion to the JSON schema standard draft v3.
def to_h_org3
raise NoMethodError, "overwrite me in sub-classes"
raise NoMethodError, "override me in sub-classes"
end
end
end
4 changes: 2 additions & 2 deletions test/hash_def_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_hash_schema_definition_accept_array
assert_schema_validate s, { "test" => [], "opt" => [] }
end

def test_cannot_overwrite_property
def test_cannot_override_property
assert_raise(Respect::InvalidSchemaError) do
Respect::HashSchema.define do |s|
s.integer "id", equal_to: 42
Expand All @@ -65,7 +65,7 @@ def test_cannot_overwrite_property
end
end

def test_extra_properties_overwrite_expected_ones
def test_extra_properties_override_expected_ones
assert_raise(Respect::InvalidSchemaError) do
Respect::HashSchema.define(strict: true) do |s|
s.integer "test", equal_to: 42
Expand Down
2 changes: 1 addition & 1 deletion test/hash_schema_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def test_default_value_used_when_property_unset
assert_equal({ "test" => 42 }, s.sanitized_object)
end

def test_default_value_do_not_overwrite_defined_one
def test_default_value_do_not_override_defined_one
s = Respect::HashSchema.define do |s|
s.integer "test", default: 42
end
Expand Down

0 comments on commit 9c7c884

Please sign in to comment.