old_contents: from spec import Spec, skip, eq_
  from mock import patch
  
  from invoke.context import Context
  from invoke.config import Config
  
  
  class Context_(Spec):
      class init:
          "__init__"
          def takes_optional_config_arg(self):
              # Meh-tastic doesn't-barf tests. MEH.
              Context()
              Context(config={'foo': 'bar'})
  
      class run_:
          def _honors(self, kwarg, value):
              with patch('invoke.context.run') as run:
                  Context(config={'run': {kwarg: value}}).run('x')
                  run.assert_called_with('x', **{kwarg: value})
  
          def warn(self):
              self._honors('warn', True)
  
          def hide(self):
              self._honors('hide', 'both')
  
          def pty(self):
              self._honors('pty', True)
  
          def echo(self):
              self._honors('echo', True)
  
      class clone:
          def returns_deep_copy_of_self(self):
              skip()
  
      class configuration_proxy:
          "Dict-like proxy for self.config"
          def setup(self):
              self.c = Context(config={'foo': 'bar'})
  
          def direct_access_allowed(self):
              eq_(self.c.config.__class__, Config)
              eq_(self.c.config['foo'], 'bar')
              eq_(self.c.config.foo, 'bar')
  
          def getitem(self):
              "___getitem__"
              eq_(self.c['foo'], 'bar')
  
          def getattr(self):
              "__getattr__"
              eq_(self.c.foo, 'bar')
  
          def get(self):
              eq_(self.c.get('foo'), 'bar')
              eq_(self.c.get('biz', 'baz'), 'baz')
  
          def keys(self):
              skip()
  
          def values(self):
              skip()
  
          def iter(self):
              "__iter__"
              skip()
  
          def update(self):
              self.c.update({'newkey': 'newval'})
              eq_(self.c['newkey'], 'newval')
  
new_contents: from spec import Spec, skip, eq_
  from mock import patch
  
  from invoke.context import Context
  from invoke.config import Config
  
  
  class Context_(Spec):
      class init:
          "__init__"
          def takes_optional_config_arg(self):
              # Meh-tastic doesn't-barf tests. MEH.
              Context()
              Context(config={'foo': 'bar'})
  
      class run_:
          def _honors(self, kwarg, value):
              with patch('invoke.context.run') as run:
                  Context(config={'run': {kwarg: value}}).run('x')
                  run.assert_called_with('x', **{kwarg: value})
  
          def warn(self):
              self._honors('warn', True)
  
          def hide(self):
              self._honors('hide', 'both')
  
          def pty(self):
              self._honors('pty', True)
  
          def echo(self):
              self._honors('echo', True)
  
      class clone:
          def returns_deep_copy_of_self(self):
              skip()
  
      class configuration_proxy:
          "Dict-like proxy for self.config"
          def setup(self):
              config = Config(foo='bar')
              config.load()
              self.c = Context(config=config)
  
          def direct_access_allowed(self):
              eq_(self.c.config.__class__, Config)
              eq_(self.c.config['foo'], 'bar')
              eq_(self.c.config.foo, 'bar')
  
          def getitem(self):
              "___getitem__"
              eq_(self.c['foo'], 'bar')
  
          def getattr(self):
              "__getattr__"
              eq_(self.c.foo, 'bar')
  
          def get(self):
              eq_(self.c.get('foo'), 'bar')
              eq_(self.c.get('biz', 'baz'), 'baz')
  
          def keys(self):
              skip()
  
          def values(self):
              skip()
  
          def iter(self):
              "__iter__"
              skip()
  
          def update(self):
              self.c.update({'newkey': 'newval'})
              eq_(self.c['newkey'], 'newval')
  
subject: Fix up moar tests