Skip to content

Commit

Permalink
don't use single letter variable names [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
tak1n committed Feb 6, 2016
1 parent 7a8f1dc commit 161a787
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions spec/ruby/core/module/define_method_spec.rb
Expand Up @@ -188,16 +188,16 @@ def cool_method
end
end

o = ProcFromMethod.new
o.data = :foo
object1 = ProcFromMethod.new
object1.data = :foo

p = o.method(:cool_method).to_proc
method_proc = object1.method(:cool_method).to_proc
klass = Class.new(ProcFromMethod)
klass.send(:define_method, :other_cool_method, p)
klass.send(:define_method, :other_cool_method, &method_proc)

object = klass.new
object.data = :bar
object.other_cool_method.should == "data is foo"
object2 = klass.new
object2.data = :bar
object2.other_cool_method.should == "data is foo"
end

it "maintains the Proc's scope" do
Expand Down

0 comments on commit 161a787

Please sign in to comment.