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

* test/psych/test_yamlstore.rb: use tmpdir for tmpfile.

* test/syck/test_yamlstore.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ayumin 2011-09-27 19:44:02 +00:00
parent fcb2bb8bd6
commit 2865b450e0
3 changed files with 25 additions and 4 deletions

View file

@ -1,3 +1,8 @@
Wed Sep 28 04:41:35 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
* test/psych/test_yamlstore.rb: use tmpdir for tmpfile.
* test/syck/test_yamlstore.rb: ditto.
Wed Sep 28 04:10:46 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
* ext/bigdecimal/README: update report to.

View file

@ -1,18 +1,26 @@
require 'test/unit'
require 'yaml/store'
require 'tmpdir'
Psych::Store = YAML::Store unless defined?(Psych::Store)
module Psych
class YAMLStoreTest < Test::Unit::TestCase
def setup
@engine, YAML::ENGINE.yamler = YAML::ENGINE.yamler, 'psych'
@yamlstore_file = "yamlstore.tmp.#{Process.pid}"
@dir = Dir.mktmpdir("rubytest-file")
File.chown(-1, Process.gid, @dir)
@yamlstore_file = make_tmp_filename("yamlstore")
@yamlstore = YAML::Store.new(@yamlstore_file)
end
def teardown
YAML::ENGINE.yamler = @engine
File.unlink(@yamlstore_file) rescue nil
FileUtils.remove_entry_secure @dir
end
def make_tmp_filename(prefix)
@dir + "/" + prefix + File.basename(__FILE__) + ".#{$$}.test"
end
def test_opening_new_file_in_readonly_mode_should_result_in_empty_values

View file

@ -1,18 +1,26 @@
require 'test/unit'
require 'yaml/store'
require 'tmpdir'
Syck::Store = YAML::Store unless defined?(Syck::Store)
module Syck
class YAMLStoreTest < Test::Unit::TestCase
def setup
@engine, YAML::ENGINE.yamler = YAML::ENGINE.yamler, 'syck'
@yamlstore_file = "yamlstore.tmp.#{Process.pid}"
@dir = Dir.mktmpdir("rubytest-file")
File.chown(-1, Process.gid, @dir)
@yamlstore_file = make_tmp_filename("yamlstore")
@yamlstore = YAML::Store.new(@yamlstore_file)
end
def teardown
YAML::ENGINE.yamler = @engine
File.unlink(@yamlstore_file) rescue nil
FileUtils.remove_entry_secure @dir
end
def make_tmp_filename(prefix)
@dir + "/" + prefix + File.basename(__FILE__) + ".#{$$}.test"
end
def test_opening_new_file_in_readonly_mode_should_result_in_empty_values