@Test
  public void testBuildContainerWithParentAndChildAssemblyScopes() throws IOException {
    String scriptValue =
        "A = org.picocontainer.script.testmodel.A\n"
            + "B = org.picocontainer.script.testmodel.B\n"
            + "ParentAssemblyScope = org.picocontainer.script.testmodel.ParentAssemblyScope\n"
            + "SomeAssemblyScope = org.picocontainer.script.testmodel.SomeAssemblyScope\n"
            + "container(:parent => $parent) {\n"
            + "  puts 'assembly_scope:'+$assembly_scope.inspect\n "
            + "  case $assembly_scope\n"
            + "  when ParentAssemblyScope\n "
            + "    puts 'parent scope'\n "
            + "    component(A)\n"
            + "  when SomeAssemblyScope\n "
            + "    puts 'child scope'\n "
            + "    component(B)\n"
            + "  else \n"
            + "     raise 'Invalid Scope: ' +  $assembly_scope.inspect\n"
            + "  end\n "
            + "}\n";

    Reader script = new StringReader(scriptValue);
    ClassLoadingPicoContainer parent =
        new DefaultClassLoadingPicoContainer(
            buildContainer(script, null, new ParentAssemblyScope()));
    assertNotNull(parent.getComponentAdapter(A.class, (NameBinding) null));

    script = new StringReader(scriptValue);
    PicoContainer pico = buildContainer(script, parent, new SomeAssemblyScope());
    assertNotNull(pico.getComponent(B.class));
  }