Skip to content

Commit c4afc88

Browse files
committedFeb 23, 2018
Eliminate old JRuby tests that use make_tmpname removed by MRI.
1 parent ca25471 commit c4afc88

File tree

2 files changed

+0
-32
lines changed

2 files changed

+0
-32
lines changed
 

Diff for: ‎test/jruby/test_file.rb

-22
Original file line numberDiff line numberDiff line change
@@ -1213,28 +1213,6 @@ def test_umask_respects_existing_umask_value
12131213
end
12141214
end
12151215

1216-
def test_allow_override_of_make_tmpname
1217-
# mimics behavior of attachment_fu, which overrides private #make_tmpname
1218-
Tempfile.class_eval do
1219-
alias_method :save_make_tmpname, :make_tmpname
1220-
def make_tmpname(basename, n)
1221-
ext = nil
1222-
sprintf("%s%d-%d%s", basename.to_s.gsub(/\.\w+$/) { |s| ext = s; '' }, $$, n, ext)
1223-
end
1224-
end
1225-
1226-
@teardown_blocks << proc do
1227-
Tempfile.class_eval { alias_method :make_tmpname, :save_make_tmpname }
1228-
end
1229-
1230-
begin
1231-
t = Tempfile.new "tcttac.jpg", File.dirname(__FILE__)
1232-
assert t.path =~ /\.jpg$/
1233-
ensure
1234-
t.close
1235-
end
1236-
end
1237-
12381216
unless WINDOWS
12391217
def test_mode_of_tempfile_is_600
12401218
t = Tempfile.new "tcttac.jpg"

Diff for: ‎test/jruby/test_pathname.rb

-10
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,6 @@ def test_dup
1010
assert_equal 'some/path', Pathname.new('some/path').dup.to_s
1111
end
1212

13-
def test_realpath_symlink; require 'tempfile'
14-
target = Tempfile.new 'target'
15-
link = Dir::Tmpname.make_tmpname 'link', nil
16-
File.symlink(target, link)
17-
assert_equal Pathname.new(target).realpath, Pathname.new(link).realpath
18-
ensure
19-
target.close! if target
20-
File.delete(link) if link && File.exists?(link)
21-
end unless WINDOWS # Don't have symlinks on Windows.
22-
2313
# GH-3392
2414
def test_dirname_ending_in_!
2515
x = "joe"

0 commit comments

Comments
 (0)
Please sign in to comment.