From b75f68ab8d54f2c4f85a71fe129074ecb554d53a Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 13 Mar 2017 09:29:19 +0000 Subject: file.c: join with / * file.c (rb_file_join): join using "/" always, not a constant. and fix the document. [ruby-core:79579] [Bug #13223] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_file_exhaustive.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/ruby/test_file_exhaustive.rb') diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb index 49e695fc75..229104050b 100644 --- a/test/ruby/test_file_exhaustive.rb +++ b/test/ruby/test_file_exhaustive.rb @@ -1260,6 +1260,19 @@ class TestFileExhaustive < Test::Unit::TestCase assert_raise(Encoding::CompatibilityError, bug7168) {File.join(names)} end + def test_join_with_changed_separator + assert_separately([], "#{<<~"begin;"}\n#{<<~"end;"}") + bug = '[ruby-core:79579] [Bug #13223]' + begin; + class File + remove_const :Separator + remove_const :SEPARATOR + end + GC.start + assert_equal("hello/world", File.join("hello", "world"), bug) + end; + end + def test_truncate [regular_file, utf8_file].each do |file| assert_equal(0, File.truncate(file, 1)) -- cgit v1.2.3