summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-13 09:29:19 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-13 09:29:19 +0000
commitb75f68ab8d54f2c4f85a71fe129074ecb554d53a (patch)
tree4b3cce0e27d952492b9ae9f86d94997dc2931b0b /test
parent16e804117ca644a2ab14ba639d9d0313ba64de87 (diff)
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
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_file_exhaustive.rb13
1 files changed, 13 insertions, 0 deletions
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))