diff options
author | Benoit Daloze <eregontp@gmail.com> | 2020-11-27 14:55:31 +0100 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2020-11-27 14:55:31 +0100 |
commit | f02d2f82bf10351f480ea312f40cb840e2437f93 (patch) | |
tree | 0b53098bffe6dacadb09880183ebcaea06e95153 /spec/ruby/core/proc/shared | |
parent | f0bfa266d70651dc295a63b026938b246693499b (diff) |
Update to ruby/spec@ac878ad
Diffstat (limited to 'spec/ruby/core/proc/shared')
-rw-r--r-- | spec/ruby/core/proc/shared/to_s.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/spec/ruby/core/proc/shared/to_s.rb b/spec/ruby/core/proc/shared/to_s.rb index 7edd11b1e1..7f167a3d9d 100644 --- a/spec/ruby/core/proc/shared/to_s.rb +++ b/spec/ruby/core/proc/shared/to_s.rb @@ -33,8 +33,13 @@ describe :proc_to_s, shared: true do describe "for a proc created with UnboundMethod#to_proc" do it "returns a description including '(lambda)' and optionally including file and line number" do - def hello; end - method("hello").to_proc.send(@method).should =~ /^#<Proc:([^ ]*?)(#{sep}#{Regexp.escape __FILE__}:#{__LINE__ })? \(lambda\)>$/ + def hello; end + s = method("hello").to_proc.send(@method) + if s.include? __FILE__ + s.should =~ /^#<Proc:([^ ]*?)#{sep}#{Regexp.escape __FILE__}:#{__LINE__ - 3} \(lambda\)>$/ + else + s.should =~ /^#<Proc:([^ ]*?) \(lambda\)>$/ + end end it "has a binary encoding" do |