mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/psych/test_psych.rb: don't leave temporary files.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ba2ee2f04c
commit
0e5546df90
2 changed files with 16 additions and 8 deletions
|
@ -1,3 +1,7 @@
|
|||
Sat Apr 24 21:07:27 2010 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* test/psych/test_psych.rb: don't leave temporary files.
|
||||
|
||||
Sat Apr 24 16:27:48 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* Makefile.in (RUBY_PROGRAM_VERSION): added
|
||||
|
|
|
@ -83,17 +83,21 @@ class TestPsych < Psych::TestCase
|
|||
end
|
||||
|
||||
def test_load_file
|
||||
name = File.join(Dir.tmpdir, 'yikes.yml')
|
||||
File.open(name, 'wb') { |f| f.write('--- hello world') }
|
||||
|
||||
assert_equal 'hello world', Psych.load_file(name)
|
||||
t = Tempfile.new(['yikes', 'yml'])
|
||||
t.binmode
|
||||
t.write('--- hello world')
|
||||
t.close
|
||||
assert_equal 'hello world', Psych.load_file(t.path)
|
||||
t.close(true)
|
||||
end
|
||||
|
||||
def test_parse_file
|
||||
name = File.join(Dir.tmpdir, 'yikes.yml')
|
||||
File.open(name, 'wb') { |f| f.write('--- hello world') }
|
||||
|
||||
assert_equal 'hello world', Psych.parse_file(name).transform
|
||||
t = Tempfile.new(['yikes', 'yml'])
|
||||
t.binmode
|
||||
t.write('--- hello world')
|
||||
t.close
|
||||
assert_equal 'hello world', Psych.parse_file(t.path).transform
|
||||
t.close(true)
|
||||
end
|
||||
|
||||
def test_degenerate_strings
|
||||
|
|
Loading…
Add table
Reference in a new issue