Skip to content

Commit

Permalink
Prefer NoMethodError over NotImplmentedError
Browse files Browse the repository at this point in the history
  • Loading branch information
tak1n committed May 24, 2022
1 parent 7ef19f3 commit ccd1de7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/hanami/utils/basic_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def respond_to?(method_name, include_all = false)
# @since 0.3.5
# @api private
def respond_to_missing?(_method_name, _include_all)
::Kernel.raise ::NotImplementedError
::Kernel.raise ::NoMethodError
end

# @since 0.3.5
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/hanami/utils/basic_object_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def external
describe "#respond_to_missing?" do
it "raises an exception if respond_to? method is not implemented" do
expect { TestClass.new.respond_to?(:no_existing_method) }
.to raise_error(NotImplementedError)
.to raise_error(NoMethodError)
end

it "returns true given respond_to? method was implemented" do
Expand Down

0 comments on commit ccd1de7

Please sign in to comment.