public void testEmitWithTags() {
TestObject result = parseObject(Util.getLocalResource("ruby/ruby1.yaml"));
DumperOptions options = new DumperOptions();
options.setExplicitStart(true);
Representer repr = new Representer();
repr.addClassTag(TestObject.class, new Tag("!ruby/object:Test::Module::Object"));
repr.addClassTag(Sub1.class, new Tag("!ruby/object:Test::Module::Sub1"));
repr.addClassTag(Sub2.class, new Tag("!ruby/object:Test::Module::Sub2"));
Yaml yaml2 = new Yaml(repr, options);
String output = yaml2.dump(result);
// System.out.println(output);
assertTrue("Tags must be present.",
output.startsWith("--- !ruby/object:Test::Module::Object"));