We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7a8f1dc commit 161a787Copy full SHA for 161a787
spec/ruby/core/module/define_method_spec.rb
@@ -188,16 +188,16 @@ def cool_method
188
end
189
190
191
- o = ProcFromMethod.new
192
- o.data = :foo
+ object1 = ProcFromMethod.new
+ object1.data = :foo
193
194
- p = o.method(:cool_method).to_proc
+ method_proc = object1.method(:cool_method).to_proc
195
klass = Class.new(ProcFromMethod)
196
- klass.send(:define_method, :other_cool_method, p)
+ klass.send(:define_method, :other_cool_method, &method_proc)
197
198
- object = klass.new
199
- object.data = :bar
200
- object.other_cool_method.should == "data is foo"
+ object2 = klass.new
+ object2.data = :bar
+ object2.other_cool_method.should == "data is foo"
201
202
203
it "maintains the Proc's scope" do
0 commit comments