diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-02-04 23:11:58 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-02-04 23:11:58 -0800 |
commit | 2af19a1e54678beba6e107400fc2b34b7350354e (patch) | |
tree | c354095858373b01e0a69a151fb17ae17f8191d9 /test | |
parent | 785d44b0e5cc477e8586b927d7125ebbc0964355 (diff) | |
download | psych-2af19a1e54678beba6e107400fc2b34b7350354e.zip |
adding load_file method
Diffstat (limited to 'test')
-rw-r--r-- | test/test_psych.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test_psych.rb b/test/test_psych.rb index 4bea1b3..c01d539 100644 --- a/test/test_psych.rb +++ b/test/test_psych.rb @@ -1,5 +1,6 @@ require 'minitest/autorun' require 'psych' +require 'tempfile' class TestPsych < MiniTest::Unit::TestCase def test_simple @@ -34,4 +35,11 @@ class TestPsych < MiniTest::Unit::TestCase Psych.load("--- !foo.bar,2002/foo\nhello: world") assert_equal({ 'hello' => 'world' }, got) 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) + end end |