1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2013-01-20 01:19:44 +00:00
parent eed593eba6
commit 8208e9872a

View file

@ -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