summaryrefslogtreecommitdiff
path: root/test/psych/test_array.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-03-26 17:32:15 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-03-26 17:32:15 -0700
commit2195fb15a7b6c4f3ea17885b184f386e6cc82787 (patch)
treecd5a0b31eed6fb79d367b43bdb7aeb8382911a0c /test/psych/test_array.rb
parent50dd7278528e4323c6fdfc2e0587616eb6a815b5 (diff)
downloadpsych-2195fb15a7b6c4f3ea17885b184f386e6cc82787.tar.gz
moving tests under the psych directory
Diffstat (limited to 'test/psych/test_array.rb')
-rw-r--r--test/psych/test_array.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/psych/test_array.rb b/test/psych/test_array.rb
new file mode 100644
index 0000000..ab83270
--- /dev/null
+++ b/test/psych/test_array.rb
@@ -0,0 +1,23 @@
+require 'minitest/autorun'
+require 'psych'
+
+module Psych
+ class TestArray < MiniTest::Unit::TestCase
+ def setup
+ @list = [{ :a => 'b' }, 'foo']
+ end
+
+ def test_self_referential
+ @list << @list
+ assert_equal @list, Psych.load(@list.to_yaml)
+ end
+
+ def test_to_yaml
+ assert_equal @list, Psych.load(@list.to_yaml)
+ end
+
+ def test_dump
+ assert_equal @list, Psych.load(Psych.dump(@list))
+ end
+ end
+end