summaryrefslogtreecommitdiff
path: root/test/ruby/test_file.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_file.rb')
-rw-r--r--test/ruby/test_file.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_file.rb b/test/ruby/test_file.rb
index 0d0ea389a4..f51e55f0c6 100644
--- a/test/ruby/test_file.rb
+++ b/test/ruby/test_file.rb
@@ -1,4 +1,7 @@
require 'test/unit'
+require 'tempfile'
+$:.replace([File.dirname(File.expand_path(__FILE__))] | $:)
+require 'ut_eof'
$KCODE = 'none'
@@ -29,4 +32,12 @@ class TestFile < Test::Unit::TestCase
File.unlink(filename) if File.exist?(filename)
end
end
+
+ include TestEOF
+ def open_file(content)
+ f = Tempfile.new("test-eof")
+ f << content
+ f.rewind
+ yield f
+ end
end