From fbb2d30ee69c68ffad6287c12ca5a43753cd1b9a Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sun, 11 Oct 2020 13:51:34 +0200 Subject: [PATCH] Add specs that #caller and #caller_locations include core library methods defined in Ruby --- spec/ruby/core/kernel/caller_locations_spec.rb | 12 ++++++++++++ spec/ruby/core/kernel/caller_spec.rb | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/spec/ruby/core/kernel/caller_locations_spec.rb b/spec/ruby/core/kernel/caller_locations_spec.rb index c4e0084085..8050b5b3ab 100644 --- a/spec/ruby/core/kernel/caller_locations_spec.rb +++ b/spec/ruby/core/kernel/caller_locations_spec.rb @@ -65,4 +65,16 @@ describe 'Kernel#caller_locations' do it "must return the same locations when called with 1..-1 and when called with no arguments" do caller_locations.map(&:to_s).should == caller_locations(1..-1).map(&:to_s) end + + guard -> { Kernel.instance_method(:tap).source_location } do + it "includes core library methods defined in Ruby" do + file, line = Kernel.instance_method(:tap).source_location + file.should.start_with?(' { Kernel.instance_method(:tap).source_location } do + it "includes core library methods defined in Ruby" do + file, line = Kernel.instance_method(:tap).source_location + file.should.start_with?('