{
  events.setFailFast(false);
  Path buildFile=scratch.file("/duplicaterulename/BUILD","# -*- python -*-","proto_library(name = 'spell_proto', srcs = ['spell.proto'], cc_api_version = 2)","cc_library(name = 'spell_proto')");
  Package pkg=packages.createPackage("duplicaterulename",buildFile);
  events.assertContainsError("cc_library rule 'spell_proto' in package " + "'duplicaterulename' conflicts with existing proto_library rule");
  assertTrue(pkg.containsErrors());
}
