From 3456ef11196406f4ae6908d89ec66d38dc716738 Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Tue, 6 Sep 2011 13:45:19 +0100 Subject: [PATCH] Use broken YAML that will fail with Syck as well as Psych. Fixes test_broken_yaml_exception in fixtures_test.rb on Ruby 1.8.7. Cherry-pick from 3-1-stable: b8d46924e70e0847e92e1d2dbaaec8c11381072c --- activerecord/test/cases/fixtures_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/activerecord/test/cases/fixtures_test.rb b/activerecord/test/cases/fixtures_test.rb index 1166c45843..7e2dafcd01 100644 --- a/activerecord/test/cases/fixtures_test.rb +++ b/activerecord/test/cases/fixtures_test.rb @@ -48,11 +48,11 @@ class FixturesTest < ActiveRecord::TestCase def test_broken_yaml_exception badyaml = Tempfile.new ['foo', '.yml'] - badyaml.write 'a: !ruby.yaml.org,2002:str |\nfoo' + badyaml.write 'a: : ' badyaml.flush dir = File.dirname badyaml.path - name =File.basename badyaml.path, '.yml' + name = File.basename badyaml.path, '.yml' assert_raises(ActiveRecord::Fixture::FormatError) do ActiveRecord::Fixtures.create_fixtures(dir, name) end