We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e500c8 commit 09794e2Copy full SHA for 09794e2
spec/ruby/core/module/define_method_spec.rb
@@ -396,6 +396,14 @@ class DefineMethodSpecClass
396
klass.new.should respond_to(:bar)
397
end
398
399
+
400
+ it "allows an UnboundMethod of a Kernel method retrieved from Object to defined on a BasicObject subclass" do
401
+ klass = Class.new(BasicObject) do
402
+ define_method :instance_of?, ::Object.instance_method(:instance_of?)
403
+ end
404
+ klass.new.instance_of?(klass).should == true
405
406
407
it "raises a TypeError when an UnboundMethod from a child class is defined on a parent class" do
408
lambda {
409
ParentClass = Class.new { define_method(:foo) { :bar } }
0 commit comments