From 4cddf21a3608b5cf5a1beda768a23fccb2403522 Mon Sep 17 00:00:00 2001 From: Vitaliy Geraymovych Date: Wed, 11 Jun 2008 14:11:36 -0400 Subject: [PATCH] fix failing spec for File.join with no arguments --- kernel/core/file.rb | 2 +- spec/tags/frozen/1.8/core/file/join_tags.txt | 1 - 2 files changed, 1 insertions(+), 2 deletions(-) diff --git a/kernel/core/file.rb b/kernel/core/file.rb index 0fcbdc6..2c211ae 100644 --- a/kernel/core/file.rb +++ b/kernel/core/file.rb @@ -368,7 +368,7 @@ class File < IO # let join/split deal with all the recursive array complexities # one small hack is to replace URI header with \0 and swap back later result = args.join(SEPARATOR).gsub(/\:\//, "\0").split(/#{SEPARATOR}+/o) - result << '' if args.last.empty? || args.last[-1] == SEPARATOR[0] + result << '' if args.empty? || args.last.empty? || args.last[-1] == SEPARATOR[0] result.join(SEPARATOR).gsub(/\0/, ':/') end diff --git a/spec/tags/frozen/1.8/core/file/join_tags.txt b/spec/tags/frozen/1.8/core/file/join_tags.txt index 1b2a1a2..e69de29 100644 --- a/spec/tags/frozen/1.8/core/file/join_tags.txt +++ b/spec/tags/frozen/1.8/core/file/join_tags.txt @@ -1 +0,0 @@ -fails:File.join returns an empty string when given no arguments -- 1.5.3.8