Test grok_component() in an ordinary doctest.

We already have tests for grok_component(), but these were placed
inside a module. We will now test grok_component() in a pure doctest
context. This used to demonstrate an error in martian when dealing
with the __builtin__ module (fixed in martian 0.9.2).

grokcore.component.testing.grok_component() can be used to grok individual
components within a doctest, such as adapters. It sets up just enough
context for some grokking to work, though more complicated grokkers
which need module context (such as view grokkers) might not work.

This defines the object we want to provide an adapter for::

  >>> class Bar(object):
  ...    pass

This is the interface that we want to adapt to::

  >>> from zope.interface import Interface
  >>> class IFoo(Interface):
  ...    pass

This is the adapter itself::

  >>> import grokcore.component as grok
  >>> class MyAdapter(grok.Adapter):
  ...    grok.provides(IFoo)
  ...    grok.context(Bar)

Now we will register the adapter using grok_component()::

  >>> from grokcore.component.testing import grok, grok_component
  >>> grok('grokcore.component.meta')
  >>> grok_component('MyAdapter', MyAdapter)
  True
  
The adapter should now be available::

  >>> adapted = IFoo(Bar())
  >>> isinstance(adapted, MyAdapter)
  True
