Skip to content

Commit

Permalink
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion core/basic_object.rb
Original file line number Diff line number Diff line change
@@ -39,7 +39,10 @@ def __id__
end

def method_missing(meth, *args)
::Kernel.raise ::NoMethodError, "Unable to send '#{meth}' on instance of BasicObject"
error = ::NoMethodError
.new("Unable to send '#{meth}' on instance of BasicObject", receiver: self)

::Kernel.raise(error)
end
private :method_missing

2 changes: 1 addition & 1 deletion spec/ruby/shared/kernel/method_missing.rb
Original file line number Diff line number Diff line change
@@ -117,7 +117,7 @@
begin
obj.method_private
rescue NoMethodError => error
error.receiver.should == obj
(error.receiver == obj).should == true
end
end
end

0 comments on commit 8b7d91b

Please sign in to comment.