summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-20 01:19:44 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-20 01:19:44 +0000
commit8208e9872a20cc6a0da9bd199fe1187c38b7c0d3 (patch)
treecb3401fce0f1bb5ffcafa1054f8dd9951e632cb6
parenteed593eba6a18a71d876ac49178aeeb0aad6b7c0 (diff)
test_parser.rb: tempfile
* test/rss/test_parser.rb (RSS::TestParser#setup): use temporary file, should not use fixed path working files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/rss/test_parser.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/rss/test_parser.rb b/test/rss/test_parser.rb
index 2e8c9be4d3..e9ab668214 100644
--- a/test/rss/test_parser.rb
+++ b/test/rss/test_parser.rb
@@ -1,4 +1,4 @@
-require "fileutils"
+require "tempfile"
require "rss-testcase"
@@ -15,13 +15,15 @@ module RSS
#{make_textinput}
#{make_image}
EOR
- @rss_file = "rss10.rdf"
- File.open(@rss_file, "w") {|f| f.print(@rss10)}
+ @rss_tmp = Tempfile.new(%w"rss10- .rdf")
+ @rss_tmp.print(@rss10)
+ @rss_tmp.close
+ @rss_file = @rss_tmp.path.untaint.trust
end
def teardown
Parser.default_parser = @_default_parser
- FileUtils.rm_f(@rss_file)
+ @rss_tmp.close(true)
end
def test_default_parser