Skip to content

Commit

Permalink
Showing 2 changed files with 23 additions and 3 deletions.
3 changes: 0 additions & 3 deletions core/src/main/java/org/jruby/ir/runtime/IRRuntimeHelpers.java
Original file line number Diff line number Diff line change
@@ -825,9 +825,6 @@ public static RubyModule findInstanceMethodContainer(ThreadContext context, Dyna
// in b65a5842ecf56ca32edc2a17800968f021b6a064. At that time,
// I was wondering if it would affect this site here and looks
// like it does.
//
// Verify that the test in GH issue 4014 runs when ripping out
// this special instanceof check below.
return self instanceof RubyModule ? (RubyModule) self : self.getMetaClass();

case INSTANCE_METHOD:
23 changes: 23 additions & 0 deletions spec/regression/GH-4014_method_define_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Regression spec courtesy Jason Lunn to for GH issue 4104
module DefinesMethod
def def_meth &block
define_method :foo, &block
end
end

class RegressionTest
extend DefinesMethod
def_meth do
def bar
'Success'
end
end
end

describe "NameError created internally using a format string" do

This comment has been minimized.

Copy link
@JasonLunn

JasonLunn Jul 26, 2016

Contributor

Is this the description you meant to put here?

This comment has been minimized.

Copy link
@subbuss

subbuss Jul 26, 2016

Author Contributor

Argh :( .. this is what happens when I do a rush job in the middle of a regular work day ... will fix. thanks for catching.

it "does not warn in verbose mode" do
o = RegressionTest.new
o.foo
expect(o.bar).to eq "Success"
end
end

0 comments on commit d9203da

Please sign in to comment.