aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_file_exhaustive.rb
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
commit56260ece997c1b628a4e4e4403e6624e9a888aa9 (patch)
tree4b3cce0e27d952492b9ae9f86d94997dc2931b0b /test/ruby/test_file_exhaustive.rb
parent641c5372edb19e5739408bb2ade46704059cd79f (diff)
downloadruby-56260ece997c1b628a4e4e4403e6624e9a888aa9.tar.gz
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/ruby/test_file_exhaustive.rb')
-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))