diff options
| author | Benoit Daloze <eregontp@gmail.com> | 2026-01-28 22:30:21 +0100 |
|---|---|---|
| committer | Benoit Daloze <eregontp@gmail.com> | 2026-01-28 23:01:22 +0100 |
| commit | dbd2ff7adca9b49e4bfa7bc3ec8b83bd437f8cb7 (patch) | |
| tree | 5f4f1609d2015fde92c25b175b84078dfcf1c92f /spec/ruby/core/kernel/caller_spec.rb | |
| parent | a8b877a843643fbdccd1a42efaf94ad27705dd55 (diff) | |
Update to ruby/spec@83e26c9
Diffstat (limited to 'spec/ruby/core/kernel/caller_spec.rb')
| -rw-r--r-- | spec/ruby/core/kernel/caller_spec.rb | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/spec/ruby/core/kernel/caller_spec.rb b/spec/ruby/core/kernel/caller_spec.rb index 7cd703de5a..df051ef07f 100644 --- a/spec/ruby/core/kernel/caller_spec.rb +++ b/spec/ruby/core/kernel/caller_spec.rb @@ -84,14 +84,25 @@ describe 'Kernel#caller' do end guard -> { Kernel.instance_method(:tap).source_location } do - ruby_version_is ""..."4.0" do + ruby_version_is ""..."3.4" do it "includes core library methods defined in Ruby" do file, line = Kernel.instance_method(:tap).source_location file.should.start_with?('<internal:') loc = nil tap { loc = caller(1, 1)[0] } - loc.should =~ /\A<internal:.*in [`'](?:Kernel#)?tap'\z/ + loc.should =~ /\A<internal:.*in `tap'\z/ + end + end + + ruby_version_is "3.4"..."4.0" do + it "includes core library methods defined in Ruby" do + file, line = Kernel.instance_method(:tap).source_location + file.should.start_with?('<internal:') + + loc = nil + tap { loc = caller(1, 1)[0] } + loc.should =~ /\A<internal:.*in 'Kernel#tap'\z/ end end @@ -102,7 +113,7 @@ describe 'Kernel#caller' do loc = nil tap { loc = caller(1, 1)[0] } - loc.should =~ /\A#{ __FILE__ }:.*in [`'](?:Kernel#)?tap'\z/ + loc.should =~ /\A#{__FILE__}:.*in 'Kernel#tap'\z/ end end end |
