diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-09-25 10:41:16 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-09-25 10:41:16 +0000 |
commit | e87fb88be844f0fae736768846954b6f6f7dc7c3 (patch) | |
tree | cbe2ab069e40b5b7f3217ce95b793426b303a305 /spec/ruby/core/proc | |
parent | e59bf54b3a88d0465cca021afae7dc05b6db57a7 (diff) |
Update to ruby/spec@241f9e7
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/core/proc')
-rw-r--r-- | spec/ruby/core/proc/source_location_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/ruby/core/proc/source_location_spec.rb b/spec/ruby/core/proc/source_location_spec.rb index 772ca7876d..89409c357b 100644 --- a/spec/ruby/core/proc/source_location_spec.rb +++ b/spec/ruby/core/proc/source_location_spec.rb @@ -69,4 +69,18 @@ describe "Proc#source_location" do ProcSpecs::SourceLocation.my_detached_proc_new.source_location.last.should == 51 ProcSpecs::SourceLocation.my_detached_lambda.source_location.last.should == 46 end + + it "returns the same value for a proc-ified method as the method reports" do + method = ProcSpecs::SourceLocation.method(:my_proc) + proc = method.to_proc + + method.source_location.should == proc.source_location + end + + it "returns nil for a core method that has been proc-ified" do + method = [].method(:<<) + proc = method.to_proc + + proc.source_location.should == nil + end end |