1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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: b8d46924e7
This commit is contained in:
Jon Leighton 2011-09-06 13:45:19 +01:00 committed by Jeremy Kemper
parent 8dba127188
commit 3456ef1119

View file

@ -48,11 +48,11 @@ class FixturesTest < ActiveRecord::TestCase
def test_broken_yaml_exception def test_broken_yaml_exception
badyaml = Tempfile.new ['foo', '.yml'] badyaml = Tempfile.new ['foo', '.yml']
badyaml.write 'a: !ruby.yaml.org,2002:str |\nfoo' badyaml.write 'a: : '
badyaml.flush badyaml.flush
dir = File.dirname badyaml.path dir = File.dirname badyaml.path
name =File.basename badyaml.path, '.yml' name = File.basename badyaml.path, '.yml'
assert_raises(ActiveRecord::Fixture::FormatError) do assert_raises(ActiveRecord::Fixture::FormatError) do
ActiveRecord::Fixtures.create_fixtures(dir, name) ActiveRecord::Fixtures.create_fixtures(dir, name)
end end