зеркало из https://github.com/github/ruby.git
* 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:
Родитель
fcb2bb8bd6
Коммит
2865b450e0
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче