summaryrefslogtreecommitdiff
path: root/spec/ruby/core/proc/source_location_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/proc/source_location_spec.rb')
-rw-r--r--spec/ruby/core/proc/source_location_spec.rb14
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