]> git.wincent.com - walrat.git/commitdiff
Don't shadow "proc" method
authorGreg Hurrell <greg@hurrell.net>
Mon, 20 Oct 2014 04:00:18 +0000 (21:00 -0700)
committerGreg Hurrell <greg@hurrell.net>
Mon, 20 Oct 2014 04:00:18 +0000 (21:00 -0700)
At some point, around 1.9 I think, `proc` became a shorthand for
`Proc.new`; we shouldn't be shadowing it in this way.

spec/additions/proc_spec.rb

index 5270575d478c9bd1ccde3a4ab051baa6fd55bc92..d43a7b96e2b7a09e2e17a545bc95fdffc7a86759 100755 (executable)
@@ -5,8 +5,8 @@ require 'spec_helper'
 
 describe 'proc additions' do
   it 'responds to "to_parseable", "parse" and "memoizing_parse"' do
-    proc = lambda { |string, options| 'foo' }.to_parseable
-    expect(proc.parse('bar')).to eq('foo')
-    expect(proc.memoizing_parse('bar')).to eq('foo')
+    fn = lambda { |string, options| 'foo' }.to_parseable
+    expect(fn.parse('bar')).to eq('foo')
+    expect(fn.memoizing_parse('bar')).to eq('foo')
   end
 end