test/test_yamlloader.rb in review-3.2.0 vs test/test_yamlloader.rb in review-4.0.0
- old
+ new
@@ -182,6 +182,19 @@
'name6' => 'N2',
'name7' => 'N1' } },
yaml)
end
end
+
+ def test_empty_file
+ Dir.mktmpdir do |dir|
+ yaml_file = File.join(dir, 'test.yml')
+ File.open(yaml_file, 'w') do |f|
+ f.write <<EOB
+#
+EOB
+ end
+ e = assert_raise(RuntimeError) { @loader.load_file(yaml_file) }
+ assert_match('test.yml is malformed.', e.message)
+ end
+ end
end