# Path: snakeguice/modules.py
# class Module(object):
#     """Base class for all standard modules."""
# 
#     def __init__(self):
#         self._injector = None
# 
#     def install(self, binder, module):
#         """Add another module's bindings to a binder."""
#         ModuleAdapter(module, self._injector).configure(binder)
# 
#     def run_configure(self, binder):
#         """A hook for intercepting the configure method. Allows different
#         module implementations to change the binder passed to configure.
#         """
#         self.configure(binder)
# 
#     def configure(self, binder):
#         """A subclass should override this to configure a binder."""
#         raise NotImplementedError
# 
#     def set_injector(self, injector):
#         self._injector = injector


from nose.tools import raises
from mock import Mock
from contextlib import nested
from snakeguice.modules import Module
#TODO: define simple and standard modules in the documentation




def given_a_standard_module():

    class StandardModule(Module): pass
    mod = StandardModule()
    binder = Mock()

    def when_installing_a_simple_module():
        simple_module = Mock(spec=['configure'])
        mod.install(binder, simple_module)

        def then_the_simple_modules_configure_method_is_called():
            assert simple_module.configure.called

        def then_the_binder_is_pass_into_the_configure_method():
            assert simple_module.configure.call_args == ((binder,), {})

    def when_installing_a_standard_module():


# Path: snakeguice/modules.py
# class Module(object):
#     """Base class for all standard modules."""
# 
#     def __init__(self):
#         self._injector = None
# 
#     def install(self, binder, module):
#         """Add another module's bindings to a binder."""
#         ModuleAdapter(module, self._injector).configure(binder)
# 
#     def run_configure(self, binder):
#         """A hook for intercepting the configure method. Allows different
#         module implementations to change the binder passed to configure.
#         """
#         self.configure(binder)
# 
#     def configure(self, binder):
#         """A subclass should override this to configure a binder."""
#         raise NotImplementedError
# 
#     def set_injector(self, injector):
#         self._injector = injector


# Path: specs/modules_spec.py
from nose.tools import raises
from mock import Mock
from contextlib import nested
from snakeguice.modules import Module

#TODO: define simple and standard modules in the documentation




def given_a_standard_module():

    class StandardModule(Module): pass
    mod = StandardModule()
    binder = Mock()

    def when_installing_a_simple_module():
        simple_module = Mock(spec=['configure'])
        mod.install(binder, simple_module)

        def then_the_simple_modules_configure_method_is_called():
            assert simple_module.configure.called

        def then_the_binder_is_pass_into_the_configure_method():
            assert simple_module.configure.call_args == ((binder,), {})

    def when_installing_a_standard_module():


        class FakeModule(Module):